mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
@@ -454,6 +454,24 @@ else {
|
||||
self.${api.properties.scopes}.insert(${scope_url_to_variant(name, default_scope, fully_qualified=True)}.as_slice().to_string(), ());
|
||||
}
|
||||
% endif
|
||||
## Only one of them is going to be set, even though we generate code that doesn't care
|
||||
% if media_params:
|
||||
{
|
||||
let protocol =\
|
||||
% for mp in media_params:
|
||||
% if loop.first:
|
||||
if \
|
||||
% else:
|
||||
else if \
|
||||
% endif
|
||||
${mp.type.arg_name}.is_some() {
|
||||
"${mp.protocol}"
|
||||
}\
|
||||
% endfor
|
||||
else { unreachable!() };
|
||||
params.push(("uploadType", protocol.to_string()));
|
||||
}
|
||||
% endif
|
||||
|
||||
url.push('?');
|
||||
url.push_str(&url::form_urlencoded::serialize(params.iter().map(|t| (t.0, t.1.as_slice()))));
|
||||
|
||||
@@ -10,6 +10,10 @@ re_linestart = re.compile('^', flags=re.MULTILINE)
|
||||
re_first_4_spaces = re.compile('^ {1,4}', flags=re.MULTILINE)
|
||||
re_desc_parts = re.compile("((the part (names|properties) that you can include in the parameter value are)|(supported values are ))(.*?)\.", flags=re.IGNORECASE|re.MULTILINE)
|
||||
|
||||
re_find_replacements = re.compile("\{\w+\}")
|
||||
|
||||
|
||||
|
||||
USE_FORMAT = 'use_format_field'
|
||||
TYPE_MAP = {'boolean' : 'bool',
|
||||
'integer' : USE_FORMAT,
|
||||
@@ -524,7 +528,8 @@ def method_media_params(m):
|
||||
except KeyError:
|
||||
raise AssertionError("media upload protocol '%s' is not implemented" % pn)
|
||||
p = type(m)({'name': 'media_%s',
|
||||
'info': pi,
|
||||
'info': pi,
|
||||
'protocol': pn,
|
||||
'path': proto.path,
|
||||
'type': ti,
|
||||
'description': ti.description,
|
||||
|
||||
Reference in New Issue
Block a user