fix(API): scopes were used illegally

Which caused a compile error. This was fixed by assuring the code
uses the same function to determine whether or not scopes are present
per method.

[skip ci]
This commit is contained in:
Sebastian Thiel
2015-04-17 07:18:08 +02:00
parent 9ea3fea775
commit d8fdf9df9f
4 changed files with 2 additions and 6 deletions

View File

@@ -2794,7 +2794,6 @@ impl<'a, C, A> StreamingVariantStoreMethods<'a, C, A> {
hub: self.hub,
_request: request.clone(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}

View File

@@ -1519,7 +1519,6 @@ impl<'a, C, A> AccountMethods<'a, C, A> {
_account_type: account_type.to_string(),
_account_name: account_name.to_string(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}

View File

@@ -565,7 +565,6 @@ impl<'a, C, A> MethodMethods<'a, C, A> {
_id_token: Default::default(),
_access_token: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
@@ -574,7 +573,6 @@ impl<'a, C, A> MethodMethods<'a, C, A> {
MethodGetCertForOpenIdConnectCall {
hub: self.hub,
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}

View File

@@ -6,7 +6,7 @@
rust_copy_value_s, is_required_property, organize_params, REQUEST_VALUE_PROPERTY_NAME,
build_all_params, rb_type_params_s, hub_type_params_s, mb_type_params_s, mb_additional_type_params,
struct_type_bounds_s, METHODS_RESOURCE, SPACES_PER_TAB, prefix_all_but_first_with,
METHODS_BUILDER_MARKER_TRAIT, remove_empty_lines)
METHODS_BUILDER_MARKER_TRAIT, remove_empty_lines, method_default_scope)
%>\
<%namespace name="util" file="../../lib/util.mako"/>\
<%namespace name="lib" file="lib.mako"/>\
@@ -108,7 +108,7 @@ impl${rb_params} ${ThisType} {
${property(p.name)}: Default::default(),
% endfor
% for prop_key, custom_name in api.properties.iteritems():
% if prop_key == 'scopes' and (not auth or not auth.oauth2):
% if prop_key == 'scopes' and not method_default_scope(m):
<% continue %>\
% endif
${custom_name}: Default::default(),