mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
Just to have another, different set of api information to deal with, and not accidentally hard-code things to work with youtube only. Prepared dealing with media uploads, and it turns out to be best to adjust the 'doit()' to take the respective type parameter. We also have to think about downloads, like the ones for google drive, which requires custom query parameters.
42 lines
1.1 KiB
Mako
42 lines
1.1 KiB
Mako
<%! import util %>\
|
|
|
|
## source should be ${self.uri}
|
|
## you need to escape the output, using a filter for example
|
|
<%def name="gen_info(source)">\
|
|
DO NOT EDIT !
|
|
This file was generated automatically from '${source}'
|
|
DO NOT EDIT !\
|
|
</%def>
|
|
|
|
## This will only work within a substitution, not within python code
|
|
<%def name="to_api_version(v)" buffered="True">\
|
|
<% assert len(v) >= 2 and v[0] == 'v'%>\
|
|
## convert it once to int, just to be sure it is an int
|
|
${v[1:]}\
|
|
</%def>
|
|
|
|
<%def name="repository_url()" buffered="True">\
|
|
${cargo.repo_base_url}/${OUTPUT_DIR}\
|
|
</%def>
|
|
|
|
<%def name="library_name()" buffered="True">\
|
|
${util.library_name(name, version)}\
|
|
</%def>
|
|
|
|
## All crates and standard `use` declaration, required for all examples
|
|
## Must be outside of a test function
|
|
<%def name="test_prelude()">\
|
|
extern crate hyper;
|
|
extern crate "yup-oauth2" as oauth2;
|
|
extern crate "rustc-serialize" as rustc_serialize;
|
|
extern crate ${self.library_name()};
|
|
</%def>
|
|
|
|
## Define the canonical name, if present, or name otherwise
|
|
<%def name="canonical_name()" buffered="True">\
|
|
% if canonicalName is UNDEFINED:
|
|
${name}\
|
|
% else:
|
|
${canonicalName}\
|
|
% endif
|
|
</%def> |