Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1451)

Side by Side Diff: generated/googleapis/lib/oauth2/v2.dart

Issue 1078053002: Roll of googleapis as of 4/7/2015. (Closed) Base URL: https://github.com/dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This is a generated file (see the discoveryapis_generator project).
2
1 library googleapis.oauth2.v2; 3 library googleapis.oauth2.v2;
2 4
3 import "dart:core" as core; 5 import 'dart:core' as core;
4 import "dart:collection" as collection; 6 import 'dart:collection' as collection;
5 import "dart:async" as async; 7 import 'dart:async' as async;
6 import "dart:convert" as convert; 8 import 'dart:convert' as convert;
7 9
8 import "package:crypto/crypto.dart" as crypto; 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
11 import 'package:crypto/crypto.dart' as crypto;
9 import 'package:http/http.dart' as http; 12 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12 13
13 export '../common/common.dart' show ApiRequestError; 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
14 export '../common/common.dart' show DetailedApiRequestError; 15 ApiRequestError, DetailedApiRequestError;
16
17 const core.String USER_AGENT = 'dart-api-client oauth2/v2';
15 18
16 /** Lets you access OAuth2 protocol related APIs. */ 19 /** Lets you access OAuth2 protocol related APIs. */
17 class Oauth2Api { 20 class Oauth2Api {
18 /** Know your basic profile info and list of people in your circles. */ 21 /** Know your basic profile info and list of people in your circles. */
19 static const PlusLoginScope = "https://www.googleapis.com/auth/plus.login"; 22 static const PlusLoginScope = "https://www.googleapis.com/auth/plus.login";
20 23
21 /** Know who you are on Google */ 24 /** Know who you are on Google */
22 static const PlusMeScope = "https://www.googleapis.com/auth/plus.me"; 25 static const PlusMeScope = "https://www.googleapis.com/auth/plus.me";
23 26
24 /** View your email address */ 27 /** View your email address */
25 static const UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.em ail"; 28 static const UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.em ail";
26 29
27 /** View your basic profile info */ 30 /** View your basic profile info */
28 static const UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo. profile"; 31 static const UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo. profile";
29 32
30 33
31 final common_internal.ApiRequester _requester; 34 final commons.ApiRequester _requester;
32 35
33 UserinfoResourceApi get userinfo => new UserinfoResourceApi(_requester); 36 UserinfoResourceApi get userinfo => new UserinfoResourceApi(_requester);
34 37
35 Oauth2Api(http.Client client, {core.String rootUrl: "https://www.googleapis.co m/", core.String servicePath: ""}) : 38 Oauth2Api(http.Client client, {core.String rootUrl: "https://www.googleapis.co m/", core.String servicePath: ""}) :
36 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath ); 39 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
37 40
38 /** 41 /**
39 * Not documented yet.
40 *
41 * Request parameters: 42 * Request parameters:
42 * 43 *
43 * Completes with a [Jwk]. 44 * Completes with a [Jwk].
44 * 45 *
45 * Completes with a [common.ApiRequestError] if the API endpoint returned an 46 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
46 * error. 47 * error.
47 * 48 *
48 * If the used [http.Client] completes with an error when making a REST call, 49 * If the used [http.Client] completes with an error when making a REST call,
49 * this method will complete with the same error. 50 * this method will complete with the same error.
50 */ 51 */
51 async.Future<Jwk> getCertForOpenIdConnect() { 52 async.Future<Jwk> getCertForOpenIdConnect() {
52 var _url = null; 53 var _url = null;
53 var _queryParams = new core.Map(); 54 var _queryParams = new core.Map();
54 var _uploadMedia = null; 55 var _uploadMedia = null;
55 var _uploadOptions = null; 56 var _uploadOptions = null;
56 var _downloadOptions = common.DownloadOptions.Metadata; 57 var _downloadOptions = commons.DownloadOptions.Metadata;
57 var _body = null; 58 var _body = null;
58 59
59 60
60 61
61 _url = 'oauth2/v2/certs'; 62 _url = 'oauth2/v2/certs';
62 63
63 var _response = _requester.request(_url, 64 var _response = _requester.request(_url,
64 "GET", 65 "GET",
65 body: _body, 66 body: _body,
66 queryParams: _queryParams, 67 queryParams: _queryParams,
67 uploadOptions: _uploadOptions, 68 uploadOptions: _uploadOptions,
68 uploadMedia: _uploadMedia, 69 uploadMedia: _uploadMedia,
69 downloadOptions: _downloadOptions); 70 downloadOptions: _downloadOptions);
70 return _response.then((data) => new Jwk.fromJson(data)); 71 return _response.then((data) => new Jwk.fromJson(data));
71 } 72 }
72 73
73 /** 74 /**
74 * Not documented yet.
75 *
76 * Request parameters: 75 * Request parameters:
77 * 76 *
78 * [accessToken] - null 77 * [accessToken] - null
79 * 78 *
80 * [idToken] - null 79 * [idToken] - null
81 * 80 *
81 * [tokenHandle] - null
82 *
82 * Completes with a [Tokeninfo]. 83 * Completes with a [Tokeninfo].
83 * 84 *
84 * Completes with a [common.ApiRequestError] if the API endpoint returned an 85 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
85 * error. 86 * error.
86 * 87 *
87 * If the used [http.Client] completes with an error when making a REST call, 88 * If the used [http.Client] completes with an error when making a REST call,
88 * this method will complete with the same error. 89 * this method will complete with the same error.
89 */ 90 */
90 async.Future<Tokeninfo> tokeninfo({core.String accessToken, core.String idToke n}) { 91 async.Future<Tokeninfo> tokeninfo({core.String accessToken, core.String idToke n, core.String tokenHandle}) {
91 var _url = null; 92 var _url = null;
92 var _queryParams = new core.Map(); 93 var _queryParams = new core.Map();
93 var _uploadMedia = null; 94 var _uploadMedia = null;
94 var _uploadOptions = null; 95 var _uploadOptions = null;
95 var _downloadOptions = common.DownloadOptions.Metadata; 96 var _downloadOptions = commons.DownloadOptions.Metadata;
96 var _body = null; 97 var _body = null;
97 98
98 if (accessToken != null) { 99 if (accessToken != null) {
99 _queryParams["access_token"] = [accessToken]; 100 _queryParams["access_token"] = [accessToken];
100 } 101 }
101 if (idToken != null) { 102 if (idToken != null) {
102 _queryParams["id_token"] = [idToken]; 103 _queryParams["id_token"] = [idToken];
103 } 104 }
105 if (tokenHandle != null) {
106 _queryParams["token_handle"] = [tokenHandle];
107 }
104 108
105 109
106 _url = 'oauth2/v2/tokeninfo'; 110 _url = 'oauth2/v2/tokeninfo';
107 111
108 var _response = _requester.request(_url, 112 var _response = _requester.request(_url,
109 "POST", 113 "POST",
110 body: _body, 114 body: _body,
111 queryParams: _queryParams, 115 queryParams: _queryParams,
112 uploadOptions: _uploadOptions, 116 uploadOptions: _uploadOptions,
113 uploadMedia: _uploadMedia, 117 uploadMedia: _uploadMedia,
114 downloadOptions: _downloadOptions); 118 downloadOptions: _downloadOptions);
115 return _response.then((data) => new Tokeninfo.fromJson(data)); 119 return _response.then((data) => new Tokeninfo.fromJson(data));
116 } 120 }
117 121
118 } 122 }
119 123
120 124
121 /** Not documented yet. */
122 class UserinfoResourceApi { 125 class UserinfoResourceApi {
123 final common_internal.ApiRequester _requester; 126 final commons.ApiRequester _requester;
124 127
125 UserinfoV2ResourceApi get v2 => new UserinfoV2ResourceApi(_requester); 128 UserinfoV2ResourceApi get v2 => new UserinfoV2ResourceApi(_requester);
126 129
127 UserinfoResourceApi(common_internal.ApiRequester client) : 130 UserinfoResourceApi(commons.ApiRequester client) :
128 _requester = client; 131 _requester = client;
129 132
130 /** 133 /**
131 * Not documented yet.
132 *
133 * Request parameters: 134 * Request parameters:
134 * 135 *
135 * Completes with a [Userinfoplus]. 136 * Completes with a [Userinfoplus].
136 * 137 *
137 * Completes with a [common.ApiRequestError] if the API endpoint returned an 138 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
138 * error. 139 * error.
139 * 140 *
140 * If the used [http.Client] completes with an error when making a REST call, 141 * If the used [http.Client] completes with an error when making a REST call,
141 * this method will complete with the same error. 142 * this method will complete with the same error.
142 */ 143 */
143 async.Future<Userinfoplus> get() { 144 async.Future<Userinfoplus> get() {
144 var _url = null; 145 var _url = null;
145 var _queryParams = new core.Map(); 146 var _queryParams = new core.Map();
146 var _uploadMedia = null; 147 var _uploadMedia = null;
147 var _uploadOptions = null; 148 var _uploadOptions = null;
148 var _downloadOptions = common.DownloadOptions.Metadata; 149 var _downloadOptions = commons.DownloadOptions.Metadata;
149 var _body = null; 150 var _body = null;
150 151
151 152
152 153
153 _url = 'oauth2/v2/userinfo'; 154 _url = 'oauth2/v2/userinfo';
154 155
155 var _response = _requester.request(_url, 156 var _response = _requester.request(_url,
156 "GET", 157 "GET",
157 body: _body, 158 body: _body,
158 queryParams: _queryParams, 159 queryParams: _queryParams,
159 uploadOptions: _uploadOptions, 160 uploadOptions: _uploadOptions,
160 uploadMedia: _uploadMedia, 161 uploadMedia: _uploadMedia,
161 downloadOptions: _downloadOptions); 162 downloadOptions: _downloadOptions);
162 return _response.then((data) => new Userinfoplus.fromJson(data)); 163 return _response.then((data) => new Userinfoplus.fromJson(data));
163 } 164 }
164 165
165 } 166 }
166 167
167 168
168 /** Not documented yet. */
169 class UserinfoV2ResourceApi { 169 class UserinfoV2ResourceApi {
170 final common_internal.ApiRequester _requester; 170 final commons.ApiRequester _requester;
171 171
172 UserinfoV2MeResourceApi get me => new UserinfoV2MeResourceApi(_requester); 172 UserinfoV2MeResourceApi get me => new UserinfoV2MeResourceApi(_requester);
173 173
174 UserinfoV2ResourceApi(common_internal.ApiRequester client) : 174 UserinfoV2ResourceApi(commons.ApiRequester client) :
175 _requester = client; 175 _requester = client;
176 } 176 }
177 177
178 178
179 /** Not documented yet. */
180 class UserinfoV2MeResourceApi { 179 class UserinfoV2MeResourceApi {
181 final common_internal.ApiRequester _requester; 180 final commons.ApiRequester _requester;
182 181
183 UserinfoV2MeResourceApi(common_internal.ApiRequester client) : 182 UserinfoV2MeResourceApi(commons.ApiRequester client) :
184 _requester = client; 183 _requester = client;
185 184
186 /** 185 /**
187 * Not documented yet.
188 *
189 * Request parameters: 186 * Request parameters:
190 * 187 *
191 * Completes with a [Userinfoplus]. 188 * Completes with a [Userinfoplus].
192 * 189 *
193 * Completes with a [common.ApiRequestError] if the API endpoint returned an 190 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
194 * error. 191 * error.
195 * 192 *
196 * If the used [http.Client] completes with an error when making a REST call, 193 * If the used [http.Client] completes with an error when making a REST call,
197 * this method will complete with the same error. 194 * this method will complete with the same error.
198 */ 195 */
199 async.Future<Userinfoplus> get() { 196 async.Future<Userinfoplus> get() {
200 var _url = null; 197 var _url = null;
201 var _queryParams = new core.Map(); 198 var _queryParams = new core.Map();
202 var _uploadMedia = null; 199 var _uploadMedia = null;
203 var _uploadOptions = null; 200 var _uploadOptions = null;
204 var _downloadOptions = common.DownloadOptions.Metadata; 201 var _downloadOptions = commons.DownloadOptions.Metadata;
205 var _body = null; 202 var _body = null;
206 203
207 204
208 205
209 _url = 'userinfo/v2/me'; 206 _url = 'userinfo/v2/me';
210 207
211 var _response = _requester.request(_url, 208 var _response = _requester.request(_url,
212 "GET", 209 "GET",
213 body: _body, 210 body: _body,
214 queryParams: _queryParams, 211 queryParams: _queryParams,
215 uploadOptions: _uploadOptions, 212 uploadOptions: _uploadOptions,
216 uploadMedia: _uploadMedia, 213 uploadMedia: _uploadMedia,
217 downloadOptions: _downloadOptions); 214 downloadOptions: _downloadOptions);
218 return _response.then((data) => new Userinfoplus.fromJson(data)); 215 return _response.then((data) => new Userinfoplus.fromJson(data));
219 } 216 }
220 217
221 } 218 }
222 219
223 220
224 221
225 /** Not documented yet. */
226 class JwkKeys { 222 class JwkKeys {
227 /** Not documented yet. */
228 core.String alg; 223 core.String alg;
229 224
230 /** Not documented yet. */
231 core.String e; 225 core.String e;
232 226
233 /** Not documented yet. */
234 core.String kid; 227 core.String kid;
235 228
236 /** Not documented yet. */
237 core.String kty; 229 core.String kty;
238 230
239 /** Not documented yet. */
240 core.String n; 231 core.String n;
241 232
242 /** Not documented yet. */
243 core.String use; 233 core.String use;
244 234
245 235
246 JwkKeys(); 236 JwkKeys();
247 237
248 JwkKeys.fromJson(core.Map _json) { 238 JwkKeys.fromJson(core.Map _json) {
249 if (_json.containsKey("alg")) { 239 if (_json.containsKey("alg")) {
250 alg = _json["alg"]; 240 alg = _json["alg"];
251 } 241 }
252 if (_json.containsKey("e")) { 242 if (_json.containsKey("e")) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 _json["n"] = n; 274 _json["n"] = n;
285 } 275 }
286 if (use != null) { 276 if (use != null) {
287 _json["use"] = use; 277 _json["use"] = use;
288 } 278 }
289 return _json; 279 return _json;
290 } 280 }
291 } 281 }
292 282
293 283
294 /** Not documented yet. */
295 class Jwk { 284 class Jwk {
296 /** Not documented yet. */
297 core.List<JwkKeys> keys; 285 core.List<JwkKeys> keys;
298 286
299 287
300 Jwk(); 288 Jwk();
301 289
302 Jwk.fromJson(core.Map _json) { 290 Jwk.fromJson(core.Map _json) {
303 if (_json.containsKey("keys")) { 291 if (_json.containsKey("keys")) {
304 keys = _json["keys"].map((value) => new JwkKeys.fromJson(value)).toList(); 292 keys = _json["keys"].map((value) => new JwkKeys.fromJson(value)).toList();
305 } 293 }
306 } 294 }
307 295
308 core.Map toJson() { 296 core.Map toJson() {
309 var _json = new core.Map(); 297 var _json = new core.Map();
310 if (keys != null) { 298 if (keys != null) {
311 _json["keys"] = keys.map((value) => (value).toJson()).toList(); 299 _json["keys"] = keys.map((value) => (value).toJson()).toList();
312 } 300 }
313 return _json; 301 return _json;
314 } 302 }
315 } 303 }
316 304
317 305
318 /** Not documented yet. */
319 class Tokeninfo { 306 class Tokeninfo {
320 /** The access type granted with this token. It can be offline or online. */ 307 /** The access type granted with this token. It can be offline or online. */
321 core.String accessType; 308 core.String accessType;
322 309
323 /** 310 /**
324 * Who is the intended audience for this token. In general the same as 311 * Who is the intended audience for this token. In general the same as
325 * issued_to. 312 * issued_to.
326 */ 313 */
327 core.String audience; 314 core.String audience;
328 315
329 /** 316 /**
330 * The email address of the user. Present only if the email scope is present 317 * The email address of the user. Present only if the email scope is present
331 * in the request. 318 * in the request.
332 */ 319 */
333 core.String email; 320 core.String email;
334 321
335 /** The expiry time of the token, as number of seconds left until expiry. */ 322 /** The expiry time of the token, as number of seconds left until expiry. */
336 core.int expiresIn; 323 core.int expiresIn;
337 324
338 /** To whom was the token issued to. In general the same as audience. */ 325 /** To whom was the token issued to. In general the same as audience. */
339 core.String issuedTo; 326 core.String issuedTo;
340 327
341 /** The space separated list of scopes granted to this token. */ 328 /** The space separated list of scopes granted to this token. */
342 core.String scope; 329 core.String scope;
343 330
344 /** The Gaia obfuscated user id. */ 331 /** The token handle associated with this token. */
332 core.String tokenHandle;
333
334 /** The obfuscated user id. */
345 core.String userId; 335 core.String userId;
346 336
347 /** 337 /**
348 * Boolean flag which is true if the email address is verified. Present only 338 * Boolean flag which is true if the email address is verified. Present only
349 * if the email scope is present in the request. 339 * if the email scope is present in the request.
350 */ 340 */
351 core.bool verifiedEmail; 341 core.bool verifiedEmail;
352 342
353 343
354 Tokeninfo(); 344 Tokeninfo();
(...skipping 10 matching lines...) Expand all
365 } 355 }
366 if (_json.containsKey("expires_in")) { 356 if (_json.containsKey("expires_in")) {
367 expiresIn = _json["expires_in"]; 357 expiresIn = _json["expires_in"];
368 } 358 }
369 if (_json.containsKey("issued_to")) { 359 if (_json.containsKey("issued_to")) {
370 issuedTo = _json["issued_to"]; 360 issuedTo = _json["issued_to"];
371 } 361 }
372 if (_json.containsKey("scope")) { 362 if (_json.containsKey("scope")) {
373 scope = _json["scope"]; 363 scope = _json["scope"];
374 } 364 }
365 if (_json.containsKey("token_handle")) {
366 tokenHandle = _json["token_handle"];
367 }
375 if (_json.containsKey("user_id")) { 368 if (_json.containsKey("user_id")) {
376 userId = _json["user_id"]; 369 userId = _json["user_id"];
377 } 370 }
378 if (_json.containsKey("verified_email")) { 371 if (_json.containsKey("verified_email")) {
379 verifiedEmail = _json["verified_email"]; 372 verifiedEmail = _json["verified_email"];
380 } 373 }
381 } 374 }
382 375
383 core.Map toJson() { 376 core.Map toJson() {
384 var _json = new core.Map(); 377 var _json = new core.Map();
385 if (accessType != null) { 378 if (accessType != null) {
386 _json["access_type"] = accessType; 379 _json["access_type"] = accessType;
387 } 380 }
388 if (audience != null) { 381 if (audience != null) {
389 _json["audience"] = audience; 382 _json["audience"] = audience;
390 } 383 }
391 if (email != null) { 384 if (email != null) {
392 _json["email"] = email; 385 _json["email"] = email;
393 } 386 }
394 if (expiresIn != null) { 387 if (expiresIn != null) {
395 _json["expires_in"] = expiresIn; 388 _json["expires_in"] = expiresIn;
396 } 389 }
397 if (issuedTo != null) { 390 if (issuedTo != null) {
398 _json["issued_to"] = issuedTo; 391 _json["issued_to"] = issuedTo;
399 } 392 }
400 if (scope != null) { 393 if (scope != null) {
401 _json["scope"] = scope; 394 _json["scope"] = scope;
402 } 395 }
396 if (tokenHandle != null) {
397 _json["token_handle"] = tokenHandle;
398 }
403 if (userId != null) { 399 if (userId != null) {
404 _json["user_id"] = userId; 400 _json["user_id"] = userId;
405 } 401 }
406 if (verifiedEmail != null) { 402 if (verifiedEmail != null) {
407 _json["verified_email"] = verifiedEmail; 403 _json["verified_email"] = verifiedEmail;
408 } 404 }
409 return _json; 405 return _json;
410 } 406 }
411 } 407 }
412 408
413 409
414 /** Not documented yet. */
415 class Userinfoplus { 410 class Userinfoplus {
416 /** The user's email address. */ 411 /** The user's email address. */
417 core.String email; 412 core.String email;
418 413
419 /** The user's last name. */ 414 /** The user's last name. */
420 core.String familyName; 415 core.String familyName;
421 416
422 /** The user's gender. */ 417 /** The user's gender. */
423 core.String gender; 418 core.String gender;
424 419
425 /** The user's first name. */ 420 /** The user's first name. */
426 core.String givenName; 421 core.String givenName;
427 422
428 /** The hosted domain e.g. example.com if the user is Google apps user. */ 423 /** The hosted domain e.g. example.com if the user is Google apps user. */
429 core.String hd; 424 core.String hd;
430 425
431 /** The focus obfuscated gaia id of the user. */ 426 /** The obfuscated ID of the user. */
432 core.String id; 427 core.String id;
433 428
434 /** URL of the profile page. */ 429 /** URL of the profile page. */
435 core.String link; 430 core.String link;
436 431
437 /** The user's preferred locale. */ 432 /** The user's preferred locale. */
438 core.String locale; 433 core.String locale;
439 434
440 /** The user's full name. */ 435 /** The user's full name. */
441 core.String name; 436 core.String name;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 } 514 }
520 if (picture != null) { 515 if (picture != null) {
521 _json["picture"] = picture; 516 _json["picture"] = picture;
522 } 517 }
523 if (verifiedEmail != null) { 518 if (verifiedEmail != null) {
524 _json["verified_email"] = verifiedEmail; 519 _json["verified_email"] = verifiedEmail;
525 } 520 }
526 return _json; 521 return _json;
527 } 522 }
528 } 523 }
529
530
OLDNEW
« no previous file with comments | « generated/googleapis/lib/mirror/v1.dart ('k') | generated/googleapis/lib/pagespeedonline/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698