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

Side by Side Diff: generated/googleapis/lib/discovery/v1.dart

Issue 560323003: Add discovery service to stable APIs (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: New generator hash in pubspec.yaml, test files renamed ot have _test.dart postfix Created 6 years, 3 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
« no previous file with comments | « generated/googleapis/README.md ('k') | generated/googleapis/lib/src/common_internal.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library googleapis.discovery.v1;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 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 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /**
17 * Lets you discover information about other Google APIs, such as what APIs are
18 * available, the resource and method details for each API.
19 */
20 class DiscoveryApi {
21
22 final common_internal.ApiRequester _requester;
23
24 ApisResourceApi get apis => new ApisResourceApi(_requester);
25
26 DiscoveryApi(http.Client client) :
27 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/discovery/v1/");
28 }
29
30
31 /** Not documented yet. */
32 class ApisResourceApi {
33 final common_internal.ApiRequester _requester;
34
35 ApisResourceApi(common_internal.ApiRequester client) :
36 _requester = client;
37
38 /**
39 * Retrieve the description of a particular version of an api.
40 *
41 * Request parameters:
42 *
43 * [api] - The name of the API.
44 *
45 * [version] - The version of the API.
46 *
47 * Completes with a [RestDescription].
48 *
49 * Completes with a [common.ApiRequestError] if the API endpoint returned an
50 * error.
51 *
52 * If the used [http.Client] completes with an error when making a REST call,
53 * this method will complete with the same error.
54 */
55 async.Future<RestDescription> getRest(core.String api, core.String version) {
56 var _url = null;
57 var _queryParams = new core.Map();
58 var _uploadMedia = null;
59 var _uploadOptions = null;
60 var _downloadOptions = common.DownloadOptions.Metadata;
61 var _body = null;
62
63 if (api == null) {
64 throw new core.ArgumentError("Parameter api is required.");
65 }
66 if (version == null) {
67 throw new core.ArgumentError("Parameter version is required.");
68 }
69
70
71 _url = 'apis/' + common_internal.Escaper.ecapeVariable('$api') + '/' + commo n_internal.Escaper.ecapeVariable('$version') + '/rest';
72
73 var _response = _requester.request(_url,
74 "GET",
75 body: _body,
76 queryParams: _queryParams,
77 uploadOptions: _uploadOptions,
78 uploadMedia: _uploadMedia,
79 downloadOptions: _downloadOptions);
80 return _response.then((data) => new RestDescription.fromJson(data));
81 }
82
83 /**
84 * Retrieve the list of APIs supported at this endpoint.
85 *
86 * Request parameters:
87 *
88 * [name] - Only include APIs with the given name.
89 *
90 * [preferred] - Return only the preferred version of an API.
91 *
92 * Completes with a [DirectoryList].
93 *
94 * Completes with a [common.ApiRequestError] if the API endpoint returned an
95 * error.
96 *
97 * If the used [http.Client] completes with an error when making a REST call,
98 * this method will complete with the same error.
99 */
100 async.Future<DirectoryList> list({core.String name, core.bool preferred}) {
101 var _url = null;
102 var _queryParams = new core.Map();
103 var _uploadMedia = null;
104 var _uploadOptions = null;
105 var _downloadOptions = common.DownloadOptions.Metadata;
106 var _body = null;
107
108 if (name != null) {
109 _queryParams["name"] = [name];
110 }
111 if (preferred != null) {
112 _queryParams["preferred"] = ["${preferred}"];
113 }
114
115
116 _url = 'apis';
117
118 var _response = _requester.request(_url,
119 "GET",
120 body: _body,
121 queryParams: _queryParams,
122 uploadOptions: _uploadOptions,
123 uploadMedia: _uploadMedia,
124 downloadOptions: _downloadOptions);
125 return _response.then((data) => new DirectoryList.fromJson(data));
126 }
127
128 }
129
130
131
132 /** Links to 16x16 and 32x32 icons representing the API. */
133 class DirectoryListItemsIcons {
134 /** The URL of the 16x16 icon. */
135 core.String x16;
136
137 /** The URL of the 32x32 icon. */
138 core.String x32;
139
140
141 DirectoryListItemsIcons();
142
143 DirectoryListItemsIcons.fromJson(core.Map _json) {
144 if (_json.containsKey("x16")) {
145 x16 = _json["x16"];
146 }
147 if (_json.containsKey("x32")) {
148 x32 = _json["x32"];
149 }
150 }
151
152 core.Map toJson() {
153 var _json = new core.Map();
154 if (x16 != null) {
155 _json["x16"] = x16;
156 }
157 if (x32 != null) {
158 _json["x32"] = x32;
159 }
160 return _json;
161 }
162 }
163
164
165 /** Not documented yet. */
166 class DirectoryListItems {
167 /** The description of this API. */
168 core.String description;
169
170 /** A link to the discovery document. */
171 core.String discoveryLink;
172
173 /** The URL for the discovery REST document. */
174 core.String discoveryRestUrl;
175
176 /** A link to human readable documentation for the API. */
177 core.String documentationLink;
178
179 /** Links to 16x16 and 32x32 icons representing the API. */
180 DirectoryListItemsIcons icons;
181
182 /** The id of this API. */
183 core.String id;
184
185 /** The kind for this response. */
186 core.String kind;
187
188 /** Labels for the status of this API, such as labs or deprecated. */
189 core.List<core.String> labels;
190
191 /** The name of the API. */
192 core.String name;
193
194 /** True if this version is the preferred version to use. */
195 core.bool preferred;
196
197 /** The title of this API. */
198 core.String title;
199
200 /** The version of the API. */
201 core.String version;
202
203
204 DirectoryListItems();
205
206 DirectoryListItems.fromJson(core.Map _json) {
207 if (_json.containsKey("description")) {
208 description = _json["description"];
209 }
210 if (_json.containsKey("discoveryLink")) {
211 discoveryLink = _json["discoveryLink"];
212 }
213 if (_json.containsKey("discoveryRestUrl")) {
214 discoveryRestUrl = _json["discoveryRestUrl"];
215 }
216 if (_json.containsKey("documentationLink")) {
217 documentationLink = _json["documentationLink"];
218 }
219 if (_json.containsKey("icons")) {
220 icons = new DirectoryListItemsIcons.fromJson(_json["icons"]);
221 }
222 if (_json.containsKey("id")) {
223 id = _json["id"];
224 }
225 if (_json.containsKey("kind")) {
226 kind = _json["kind"];
227 }
228 if (_json.containsKey("labels")) {
229 labels = _json["labels"];
230 }
231 if (_json.containsKey("name")) {
232 name = _json["name"];
233 }
234 if (_json.containsKey("preferred")) {
235 preferred = _json["preferred"];
236 }
237 if (_json.containsKey("title")) {
238 title = _json["title"];
239 }
240 if (_json.containsKey("version")) {
241 version = _json["version"];
242 }
243 }
244
245 core.Map toJson() {
246 var _json = new core.Map();
247 if (description != null) {
248 _json["description"] = description;
249 }
250 if (discoveryLink != null) {
251 _json["discoveryLink"] = discoveryLink;
252 }
253 if (discoveryRestUrl != null) {
254 _json["discoveryRestUrl"] = discoveryRestUrl;
255 }
256 if (documentationLink != null) {
257 _json["documentationLink"] = documentationLink;
258 }
259 if (icons != null) {
260 _json["icons"] = (icons).toJson();
261 }
262 if (id != null) {
263 _json["id"] = id;
264 }
265 if (kind != null) {
266 _json["kind"] = kind;
267 }
268 if (labels != null) {
269 _json["labels"] = labels;
270 }
271 if (name != null) {
272 _json["name"] = name;
273 }
274 if (preferred != null) {
275 _json["preferred"] = preferred;
276 }
277 if (title != null) {
278 _json["title"] = title;
279 }
280 if (version != null) {
281 _json["version"] = version;
282 }
283 return _json;
284 }
285 }
286
287
288 /** Not documented yet. */
289 class DirectoryList {
290 /** Indicate the version of the Discovery API used to generate this doc. */
291 core.String discoveryVersion;
292
293 /** The individual directory entries. One entry per api/version pair. */
294 core.List<DirectoryListItems> items;
295
296 /** The kind for this response. */
297 core.String kind;
298
299
300 DirectoryList();
301
302 DirectoryList.fromJson(core.Map _json) {
303 if (_json.containsKey("discoveryVersion")) {
304 discoveryVersion = _json["discoveryVersion"];
305 }
306 if (_json.containsKey("items")) {
307 items = _json["items"].map((value) => new DirectoryListItems.fromJson(valu e)).toList();
308 }
309 if (_json.containsKey("kind")) {
310 kind = _json["kind"];
311 }
312 }
313
314 core.Map toJson() {
315 var _json = new core.Map();
316 if (discoveryVersion != null) {
317 _json["discoveryVersion"] = discoveryVersion;
318 }
319 if (items != null) {
320 _json["items"] = items.map((value) => (value).toJson()).toList();
321 }
322 if (kind != null) {
323 _json["kind"] = kind;
324 }
325 return _json;
326 }
327 }
328
329
330 /** Additional information about this property. */
331 class JsonSchemaAnnotations {
332 /** A list of methods for which this property is required on requests. */
333 core.List<core.String> required;
334
335
336 JsonSchemaAnnotations();
337
338 JsonSchemaAnnotations.fromJson(core.Map _json) {
339 if (_json.containsKey("required")) {
340 required = _json["required"];
341 }
342 }
343
344 core.Map toJson() {
345 var _json = new core.Map();
346 if (required != null) {
347 _json["required"] = required;
348 }
349 return _json;
350 }
351 }
352
353
354 /** Not documented yet. */
355 class JsonSchemaVariantMap {
356 /** Not documented yet. */
357 core.String P_ref;
358
359 /** Not documented yet. */
360 core.String typeValue;
361
362
363 JsonSchemaVariantMap();
364
365 JsonSchemaVariantMap.fromJson(core.Map _json) {
366 if (_json.containsKey("\$ref")) {
367 P_ref = _json["\$ref"];
368 }
369 if (_json.containsKey("type_value")) {
370 typeValue = _json["type_value"];
371 }
372 }
373
374 core.Map toJson() {
375 var _json = new core.Map();
376 if (P_ref != null) {
377 _json["\$ref"] = P_ref;
378 }
379 if (typeValue != null) {
380 _json["type_value"] = typeValue;
381 }
382 return _json;
383 }
384 }
385
386
387 /**
388 * In a variant data type, the value of one property is used to determine how to
389 * interpret the entire entity. Its value must exist in a map of descriminant
390 * values to schema names.
391 */
392 class JsonSchemaVariant {
393 /** The name of the type discriminant property. */
394 core.String discriminant;
395
396 /** The map of discriminant value to schema to use for parsing.. */
397 core.List<JsonSchemaVariantMap> map;
398
399
400 JsonSchemaVariant();
401
402 JsonSchemaVariant.fromJson(core.Map _json) {
403 if (_json.containsKey("discriminant")) {
404 discriminant = _json["discriminant"];
405 }
406 if (_json.containsKey("map")) {
407 map = _json["map"].map((value) => new JsonSchemaVariantMap.fromJson(value) ).toList();
408 }
409 }
410
411 core.Map toJson() {
412 var _json = new core.Map();
413 if (discriminant != null) {
414 _json["discriminant"] = discriminant;
415 }
416 if (map != null) {
417 _json["map"] = map.map((value) => (value).toJson()).toList();
418 }
419 return _json;
420 }
421 }
422
423
424 /** Not documented yet. */
425 class JsonSchema {
426 /**
427 * A reference to another schema. The value of this property is the "id" of
428 * another schema.
429 */
430 core.String P_ref;
431
432 /**
433 * If this is a schema for an object, this property is the schema for any
434 * additional properties with dynamic keys on this object.
435 */
436 JsonSchema additionalProperties;
437
438 /** Additional information about this property. */
439 JsonSchemaAnnotations annotations;
440
441 /** The default value of this property (if one exists). */
442 core.String default_;
443
444 /** A description of this object. */
445 core.String description;
446
447 /** Values this parameter may take (if it is an enum). */
448 core.List<core.String> enum_;
449
450 /**
451 * The descriptions for the enums. Each position maps to the corresponding
452 * value in the "enum" array.
453 */
454 core.List<core.String> enumDescriptions;
455
456 /**
457 * An additional regular expression or key that helps constrain the value. For
458 * more details see:
459 * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23
460 */
461 core.String format;
462
463 /** Unique identifier for this schema. */
464 core.String id;
465
466 /**
467 * If this is a schema for an array, this property is the schema for each
468 * element in the array.
469 */
470 JsonSchema items;
471
472 /**
473 * Whether this parameter goes in the query or the path for REST requests.
474 */
475 core.String location;
476
477 /** The maximum value of this parameter. */
478 core.String maximum;
479
480 /** The minimum value of this parameter. */
481 core.String minimum;
482
483 /**
484 * The regular expression this parameter must conform to. Uses Java 6 regex
485 * format:
486 * http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
487 */
488 core.String pattern;
489
490 /**
491 * If this is a schema for an object, list the schema for each property of
492 * this object.
493 */
494 core.Map<core.String, JsonSchema> properties;
495
496 /**
497 * The value is read-only, generated by the service. The value cannot be
498 * modified by the client. If the value is included in a POST, PUT, or PATCH
499 * request, it is ignored by the service.
500 */
501 core.bool readOnly;
502
503 /** Whether this parameter may appear multiple times. */
504 core.bool repeated;
505
506 /** Whether the parameter is required. */
507 core.bool required;
508
509 /**
510 * The value type for this schema. A list of values can be found here:
511 * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
512 */
513 core.String type;
514
515 /**
516 * In a variant data type, the value of one property is used to determine how
517 * to interpret the entire entity. Its value must exist in a map of
518 * descriminant values to schema names.
519 */
520 JsonSchemaVariant variant;
521
522
523 JsonSchema();
524
525 JsonSchema.fromJson(core.Map _json) {
526 if (_json.containsKey("\$ref")) {
527 P_ref = _json["\$ref"];
528 }
529 if (_json.containsKey("additionalProperties")) {
530 additionalProperties = new JsonSchema.fromJson(_json["additionalProperties "]);
531 }
532 if (_json.containsKey("annotations")) {
533 annotations = new JsonSchemaAnnotations.fromJson(_json["annotations"]);
534 }
535 if (_json.containsKey("default")) {
536 default_ = _json["default"];
537 }
538 if (_json.containsKey("description")) {
539 description = _json["description"];
540 }
541 if (_json.containsKey("enum")) {
542 enum_ = _json["enum"];
543 }
544 if (_json.containsKey("enumDescriptions")) {
545 enumDescriptions = _json["enumDescriptions"];
546 }
547 if (_json.containsKey("format")) {
548 format = _json["format"];
549 }
550 if (_json.containsKey("id")) {
551 id = _json["id"];
552 }
553 if (_json.containsKey("items")) {
554 items = new JsonSchema.fromJson(_json["items"]);
555 }
556 if (_json.containsKey("location")) {
557 location = _json["location"];
558 }
559 if (_json.containsKey("maximum")) {
560 maximum = _json["maximum"];
561 }
562 if (_json.containsKey("minimum")) {
563 minimum = _json["minimum"];
564 }
565 if (_json.containsKey("pattern")) {
566 pattern = _json["pattern"];
567 }
568 if (_json.containsKey("properties")) {
569 properties = common_internal.mapMap(_json["properties"], (item) => new Jso nSchema.fromJson(item));
570 }
571 if (_json.containsKey("readOnly")) {
572 readOnly = _json["readOnly"];
573 }
574 if (_json.containsKey("repeated")) {
575 repeated = _json["repeated"];
576 }
577 if (_json.containsKey("required")) {
578 required = _json["required"];
579 }
580 if (_json.containsKey("type")) {
581 type = _json["type"];
582 }
583 if (_json.containsKey("variant")) {
584 variant = new JsonSchemaVariant.fromJson(_json["variant"]);
585 }
586 }
587
588 core.Map toJson() {
589 var _json = new core.Map();
590 if (P_ref != null) {
591 _json["\$ref"] = P_ref;
592 }
593 if (additionalProperties != null) {
594 _json["additionalProperties"] = (additionalProperties).toJson();
595 }
596 if (annotations != null) {
597 _json["annotations"] = (annotations).toJson();
598 }
599 if (default_ != null) {
600 _json["default"] = default_;
601 }
602 if (description != null) {
603 _json["description"] = description;
604 }
605 if (enum_ != null) {
606 _json["enum"] = enum_;
607 }
608 if (enumDescriptions != null) {
609 _json["enumDescriptions"] = enumDescriptions;
610 }
611 if (format != null) {
612 _json["format"] = format;
613 }
614 if (id != null) {
615 _json["id"] = id;
616 }
617 if (items != null) {
618 _json["items"] = (items).toJson();
619 }
620 if (location != null) {
621 _json["location"] = location;
622 }
623 if (maximum != null) {
624 _json["maximum"] = maximum;
625 }
626 if (minimum != null) {
627 _json["minimum"] = minimum;
628 }
629 if (pattern != null) {
630 _json["pattern"] = pattern;
631 }
632 if (properties != null) {
633 _json["properties"] = common_internal.mapMap(properties, (item) => (item). toJson());
634 }
635 if (readOnly != null) {
636 _json["readOnly"] = readOnly;
637 }
638 if (repeated != null) {
639 _json["repeated"] = repeated;
640 }
641 if (required != null) {
642 _json["required"] = required;
643 }
644 if (type != null) {
645 _json["type"] = type;
646 }
647 if (variant != null) {
648 _json["variant"] = (variant).toJson();
649 }
650 return _json;
651 }
652 }
653
654
655 /** The scope value. */
656 class RestDescriptionAuthOauth2ScopesValue {
657 /** Description of scope. */
658 core.String description;
659
660
661 RestDescriptionAuthOauth2ScopesValue();
662
663 RestDescriptionAuthOauth2ScopesValue.fromJson(core.Map _json) {
664 if (_json.containsKey("description")) {
665 description = _json["description"];
666 }
667 }
668
669 core.Map toJson() {
670 var _json = new core.Map();
671 if (description != null) {
672 _json["description"] = description;
673 }
674 return _json;
675 }
676 }
677
678
679 /** OAuth 2.0 authentication information. */
680 class RestDescriptionAuthOauth2 {
681 /** Available OAuth 2.0 scopes. */
682 core.Map<core.String, RestDescriptionAuthOauth2ScopesValue> scopes;
683
684
685 RestDescriptionAuthOauth2();
686
687 RestDescriptionAuthOauth2.fromJson(core.Map _json) {
688 if (_json.containsKey("scopes")) {
689 scopes = common_internal.mapMap(_json["scopes"], (item) => new RestDescrip tionAuthOauth2ScopesValue.fromJson(item));
690 }
691 }
692
693 core.Map toJson() {
694 var _json = new core.Map();
695 if (scopes != null) {
696 _json["scopes"] = common_internal.mapMap(scopes, (item) => (item).toJson() );
697 }
698 return _json;
699 }
700 }
701
702
703 /** Authentication information. */
704 class RestDescriptionAuth {
705 /** OAuth 2.0 authentication information. */
706 RestDescriptionAuthOauth2 oauth2;
707
708
709 RestDescriptionAuth();
710
711 RestDescriptionAuth.fromJson(core.Map _json) {
712 if (_json.containsKey("oauth2")) {
713 oauth2 = new RestDescriptionAuthOauth2.fromJson(_json["oauth2"]);
714 }
715 }
716
717 core.Map toJson() {
718 var _json = new core.Map();
719 if (oauth2 != null) {
720 _json["oauth2"] = (oauth2).toJson();
721 }
722 return _json;
723 }
724 }
725
726
727 /** Links to 16x16 and 32x32 icons representing the API. */
728 class RestDescriptionIcons {
729 /** The URL of the 16x16 icon. */
730 core.String x16;
731
732 /** The URL of the 32x32 icon. */
733 core.String x32;
734
735
736 RestDescriptionIcons();
737
738 RestDescriptionIcons.fromJson(core.Map _json) {
739 if (_json.containsKey("x16")) {
740 x16 = _json["x16"];
741 }
742 if (_json.containsKey("x32")) {
743 x32 = _json["x32"];
744 }
745 }
746
747 core.Map toJson() {
748 var _json = new core.Map();
749 if (x16 != null) {
750 _json["x16"] = x16;
751 }
752 if (x32 != null) {
753 _json["x32"] = x32;
754 }
755 return _json;
756 }
757 }
758
759
760 /** Not documented yet. */
761 class RestDescription {
762 /** Authentication information. */
763 RestDescriptionAuth auth;
764
765 /** [DEPRECATED] The base path for REST requests. */
766 core.String basePath;
767
768 /** [DEPRECATED] The base URL for REST requests. */
769 core.String baseUrl;
770
771 /** The path for REST batch requests. */
772 core.String batchPath;
773
774 /**
775 * Indicates how the API name should be capitalized and split into various
776 * parts. Useful for generating pretty class names.
777 */
778 core.String canonicalName;
779
780 /** The description of this API. */
781 core.String description;
782
783 /** Indicate the version of the Discovery API used to generate this doc. */
784 core.String discoveryVersion;
785
786 /** A link to human readable documentation for the API. */
787 core.String documentationLink;
788
789 /** The ETag for this response. */
790 core.String etag;
791
792 /** A list of supported features for this API. */
793 core.List<core.String> features;
794
795 /** Links to 16x16 and 32x32 icons representing the API. */
796 RestDescriptionIcons icons;
797
798 /** The ID of this API. */
799 core.String id;
800
801 /** The kind for this response. */
802 core.String kind;
803
804 /** Labels for the status of this API, such as labs or deprecated. */
805 core.List<core.String> labels;
806
807 /** API-level methods for this API. */
808 core.Map<core.String, RestMethod> methods;
809
810 /** The name of this API. */
811 core.String name;
812
813 /**
814 * The domain of the owner of this API. Together with the ownerName and a
815 * packagePath values, this can be used to generate a library for this API
816 * which would have a unique fully qualified name.
817 */
818 core.String ownerDomain;
819
820 /** The name of the owner of this API. See ownerDomain. */
821 core.String ownerName;
822
823 /** The package of the owner of this API. See ownerDomain. */
824 core.String packagePath;
825
826 /** Common parameters that apply across all apis. */
827 core.Map<core.String, JsonSchema> parameters;
828
829 /** The protocol described by this document. */
830 core.String protocol;
831
832 /** The resources in this API. */
833 core.Map<core.String, RestResource> resources;
834
835 /** The version of this API. */
836 core.String revision;
837
838 /** The root URL under which all API services live. */
839 core.String rootUrl;
840
841 /** The schemas for this API. */
842 core.Map<core.String, JsonSchema> schemas;
843
844 /** The base path for all REST requests. */
845 core.String servicePath;
846
847 /** The title of this API. */
848 core.String title;
849
850 /** The version of this API. */
851 core.String version;
852
853
854 RestDescription();
855
856 RestDescription.fromJson(core.Map _json) {
857 if (_json.containsKey("auth")) {
858 auth = new RestDescriptionAuth.fromJson(_json["auth"]);
859 }
860 if (_json.containsKey("basePath")) {
861 basePath = _json["basePath"];
862 }
863 if (_json.containsKey("baseUrl")) {
864 baseUrl = _json["baseUrl"];
865 }
866 if (_json.containsKey("batchPath")) {
867 batchPath = _json["batchPath"];
868 }
869 if (_json.containsKey("canonicalName")) {
870 canonicalName = _json["canonicalName"];
871 }
872 if (_json.containsKey("description")) {
873 description = _json["description"];
874 }
875 if (_json.containsKey("discoveryVersion")) {
876 discoveryVersion = _json["discoveryVersion"];
877 }
878 if (_json.containsKey("documentationLink")) {
879 documentationLink = _json["documentationLink"];
880 }
881 if (_json.containsKey("etag")) {
882 etag = _json["etag"];
883 }
884 if (_json.containsKey("features")) {
885 features = _json["features"];
886 }
887 if (_json.containsKey("icons")) {
888 icons = new RestDescriptionIcons.fromJson(_json["icons"]);
889 }
890 if (_json.containsKey("id")) {
891 id = _json["id"];
892 }
893 if (_json.containsKey("kind")) {
894 kind = _json["kind"];
895 }
896 if (_json.containsKey("labels")) {
897 labels = _json["labels"];
898 }
899 if (_json.containsKey("methods")) {
900 methods = common_internal.mapMap(_json["methods"], (item) => new RestMetho d.fromJson(item));
901 }
902 if (_json.containsKey("name")) {
903 name = _json["name"];
904 }
905 if (_json.containsKey("ownerDomain")) {
906 ownerDomain = _json["ownerDomain"];
907 }
908 if (_json.containsKey("ownerName")) {
909 ownerName = _json["ownerName"];
910 }
911 if (_json.containsKey("packagePath")) {
912 packagePath = _json["packagePath"];
913 }
914 if (_json.containsKey("parameters")) {
915 parameters = common_internal.mapMap(_json["parameters"], (item) => new Jso nSchema.fromJson(item));
916 }
917 if (_json.containsKey("protocol")) {
918 protocol = _json["protocol"];
919 }
920 if (_json.containsKey("resources")) {
921 resources = common_internal.mapMap(_json["resources"], (item) => new RestR esource.fromJson(item));
922 }
923 if (_json.containsKey("revision")) {
924 revision = _json["revision"];
925 }
926 if (_json.containsKey("rootUrl")) {
927 rootUrl = _json["rootUrl"];
928 }
929 if (_json.containsKey("schemas")) {
930 schemas = common_internal.mapMap(_json["schemas"], (item) => new JsonSchem a.fromJson(item));
931 }
932 if (_json.containsKey("servicePath")) {
933 servicePath = _json["servicePath"];
934 }
935 if (_json.containsKey("title")) {
936 title = _json["title"];
937 }
938 if (_json.containsKey("version")) {
939 version = _json["version"];
940 }
941 }
942
943 core.Map toJson() {
944 var _json = new core.Map();
945 if (auth != null) {
946 _json["auth"] = (auth).toJson();
947 }
948 if (basePath != null) {
949 _json["basePath"] = basePath;
950 }
951 if (baseUrl != null) {
952 _json["baseUrl"] = baseUrl;
953 }
954 if (batchPath != null) {
955 _json["batchPath"] = batchPath;
956 }
957 if (canonicalName != null) {
958 _json["canonicalName"] = canonicalName;
959 }
960 if (description != null) {
961 _json["description"] = description;
962 }
963 if (discoveryVersion != null) {
964 _json["discoveryVersion"] = discoveryVersion;
965 }
966 if (documentationLink != null) {
967 _json["documentationLink"] = documentationLink;
968 }
969 if (etag != null) {
970 _json["etag"] = etag;
971 }
972 if (features != null) {
973 _json["features"] = features;
974 }
975 if (icons != null) {
976 _json["icons"] = (icons).toJson();
977 }
978 if (id != null) {
979 _json["id"] = id;
980 }
981 if (kind != null) {
982 _json["kind"] = kind;
983 }
984 if (labels != null) {
985 _json["labels"] = labels;
986 }
987 if (methods != null) {
988 _json["methods"] = common_internal.mapMap(methods, (item) => (item).toJson ());
989 }
990 if (name != null) {
991 _json["name"] = name;
992 }
993 if (ownerDomain != null) {
994 _json["ownerDomain"] = ownerDomain;
995 }
996 if (ownerName != null) {
997 _json["ownerName"] = ownerName;
998 }
999 if (packagePath != null) {
1000 _json["packagePath"] = packagePath;
1001 }
1002 if (parameters != null) {
1003 _json["parameters"] = common_internal.mapMap(parameters, (item) => (item). toJson());
1004 }
1005 if (protocol != null) {
1006 _json["protocol"] = protocol;
1007 }
1008 if (resources != null) {
1009 _json["resources"] = common_internal.mapMap(resources, (item) => (item).to Json());
1010 }
1011 if (revision != null) {
1012 _json["revision"] = revision;
1013 }
1014 if (rootUrl != null) {
1015 _json["rootUrl"] = rootUrl;
1016 }
1017 if (schemas != null) {
1018 _json["schemas"] = common_internal.mapMap(schemas, (item) => (item).toJson ());
1019 }
1020 if (servicePath != null) {
1021 _json["servicePath"] = servicePath;
1022 }
1023 if (title != null) {
1024 _json["title"] = title;
1025 }
1026 if (version != null) {
1027 _json["version"] = version;
1028 }
1029 return _json;
1030 }
1031 }
1032
1033
1034 /** Supports the Resumable Media Upload protocol. */
1035 class RestMethodMediaUploadProtocolsResumable {
1036 /** True if this endpoint supports uploading multipart media. */
1037 core.bool multipart;
1038
1039 /**
1040 * The URI path to be used for upload. Should be used in conjunction with the
1041 * basePath property at the api-level.
1042 */
1043 core.String path;
1044
1045
1046 RestMethodMediaUploadProtocolsResumable();
1047
1048 RestMethodMediaUploadProtocolsResumable.fromJson(core.Map _json) {
1049 if (_json.containsKey("multipart")) {
1050 multipart = _json["multipart"];
1051 }
1052 if (_json.containsKey("path")) {
1053 path = _json["path"];
1054 }
1055 }
1056
1057 core.Map toJson() {
1058 var _json = new core.Map();
1059 if (multipart != null) {
1060 _json["multipart"] = multipart;
1061 }
1062 if (path != null) {
1063 _json["path"] = path;
1064 }
1065 return _json;
1066 }
1067 }
1068
1069
1070 /** Supports uploading as a single HTTP request. */
1071 class RestMethodMediaUploadProtocolsSimple {
1072 /** True if this endpoint supports upload multipart media. */
1073 core.bool multipart;
1074
1075 /**
1076 * The URI path to be used for upload. Should be used in conjunction with the
1077 * basePath property at the api-level.
1078 */
1079 core.String path;
1080
1081
1082 RestMethodMediaUploadProtocolsSimple();
1083
1084 RestMethodMediaUploadProtocolsSimple.fromJson(core.Map _json) {
1085 if (_json.containsKey("multipart")) {
1086 multipart = _json["multipart"];
1087 }
1088 if (_json.containsKey("path")) {
1089 path = _json["path"];
1090 }
1091 }
1092
1093 core.Map toJson() {
1094 var _json = new core.Map();
1095 if (multipart != null) {
1096 _json["multipart"] = multipart;
1097 }
1098 if (path != null) {
1099 _json["path"] = path;
1100 }
1101 return _json;
1102 }
1103 }
1104
1105
1106 /** Supported upload protocols. */
1107 class RestMethodMediaUploadProtocols {
1108 /** Supports the Resumable Media Upload protocol. */
1109 RestMethodMediaUploadProtocolsResumable resumable;
1110
1111 /** Supports uploading as a single HTTP request. */
1112 RestMethodMediaUploadProtocolsSimple simple;
1113
1114
1115 RestMethodMediaUploadProtocols();
1116
1117 RestMethodMediaUploadProtocols.fromJson(core.Map _json) {
1118 if (_json.containsKey("resumable")) {
1119 resumable = new RestMethodMediaUploadProtocolsResumable.fromJson(_json["re sumable"]);
1120 }
1121 if (_json.containsKey("simple")) {
1122 simple = new RestMethodMediaUploadProtocolsSimple.fromJson(_json["simple"] );
1123 }
1124 }
1125
1126 core.Map toJson() {
1127 var _json = new core.Map();
1128 if (resumable != null) {
1129 _json["resumable"] = (resumable).toJson();
1130 }
1131 if (simple != null) {
1132 _json["simple"] = (simple).toJson();
1133 }
1134 return _json;
1135 }
1136 }
1137
1138
1139 /** Media upload parameters. */
1140 class RestMethodMediaUpload {
1141 /** MIME Media Ranges for acceptable media uploads to this method. */
1142 core.List<core.String> accept;
1143
1144 /** Maximum size of a media upload, such as "1MB", "2GB" or "3TB". */
1145 core.String maxSize;
1146
1147 /** Supported upload protocols. */
1148 RestMethodMediaUploadProtocols protocols;
1149
1150
1151 RestMethodMediaUpload();
1152
1153 RestMethodMediaUpload.fromJson(core.Map _json) {
1154 if (_json.containsKey("accept")) {
1155 accept = _json["accept"];
1156 }
1157 if (_json.containsKey("maxSize")) {
1158 maxSize = _json["maxSize"];
1159 }
1160 if (_json.containsKey("protocols")) {
1161 protocols = new RestMethodMediaUploadProtocols.fromJson(_json["protocols"] );
1162 }
1163 }
1164
1165 core.Map toJson() {
1166 var _json = new core.Map();
1167 if (accept != null) {
1168 _json["accept"] = accept;
1169 }
1170 if (maxSize != null) {
1171 _json["maxSize"] = maxSize;
1172 }
1173 if (protocols != null) {
1174 _json["protocols"] = (protocols).toJson();
1175 }
1176 return _json;
1177 }
1178 }
1179
1180
1181 /** The schema for the request. */
1182 class RestMethodRequest {
1183 /** Schema ID for the request schema. */
1184 core.String P_ref;
1185
1186 /** parameter name. */
1187 core.String parameterName;
1188
1189
1190 RestMethodRequest();
1191
1192 RestMethodRequest.fromJson(core.Map _json) {
1193 if (_json.containsKey("\$ref")) {
1194 P_ref = _json["\$ref"];
1195 }
1196 if (_json.containsKey("parameterName")) {
1197 parameterName = _json["parameterName"];
1198 }
1199 }
1200
1201 core.Map toJson() {
1202 var _json = new core.Map();
1203 if (P_ref != null) {
1204 _json["\$ref"] = P_ref;
1205 }
1206 if (parameterName != null) {
1207 _json["parameterName"] = parameterName;
1208 }
1209 return _json;
1210 }
1211 }
1212
1213
1214 /** The schema for the response. */
1215 class RestMethodResponse {
1216 /** Schema ID for the response schema. */
1217 core.String P_ref;
1218
1219
1220 RestMethodResponse();
1221
1222 RestMethodResponse.fromJson(core.Map _json) {
1223 if (_json.containsKey("\$ref")) {
1224 P_ref = _json["\$ref"];
1225 }
1226 }
1227
1228 core.Map toJson() {
1229 var _json = new core.Map();
1230 if (P_ref != null) {
1231 _json["\$ref"] = P_ref;
1232 }
1233 return _json;
1234 }
1235 }
1236
1237
1238 /** Not documented yet. */
1239 class RestMethod {
1240 /** Description of this method. */
1241 core.String description;
1242
1243 /**
1244 * Whether this method requires an ETag to be specified. The ETag is sent as
1245 * an HTTP If-Match or If-None-Match header.
1246 */
1247 core.bool etagRequired;
1248
1249 /** HTTP method used by this method. */
1250 core.String httpMethod;
1251
1252 /**
1253 * A unique ID for this method. This property can be used to match methods
1254 * between different versions of Discovery.
1255 */
1256 core.String id;
1257
1258 /** Media upload parameters. */
1259 RestMethodMediaUpload mediaUpload;
1260
1261 /**
1262 * Ordered list of required parameters, serves as a hint to clients on how to
1263 * structure their method signatures. The array is ordered such that the
1264 * "most-significant" parameter appears first.
1265 */
1266 core.List<core.String> parameterOrder;
1267
1268 /** Details for all parameters in this method. */
1269 core.Map<core.String, JsonSchema> parameters;
1270
1271 /**
1272 * The URI path of this REST method. Should be used in conjunction with the
1273 * basePath property at the api-level.
1274 */
1275 core.String path;
1276
1277 /** The schema for the request. */
1278 RestMethodRequest request;
1279
1280 /** The schema for the response. */
1281 RestMethodResponse response;
1282
1283 /** OAuth 2.0 scopes applicable to this method. */
1284 core.List<core.String> scopes;
1285
1286 /** Whether this method supports media downloads. */
1287 core.bool supportsMediaDownload;
1288
1289 /** Whether this method supports media uploads. */
1290 core.bool supportsMediaUpload;
1291
1292 /** Whether this method supports subscriptions. */
1293 core.bool supportsSubscription;
1294
1295
1296 RestMethod();
1297
1298 RestMethod.fromJson(core.Map _json) {
1299 if (_json.containsKey("description")) {
1300 description = _json["description"];
1301 }
1302 if (_json.containsKey("etagRequired")) {
1303 etagRequired = _json["etagRequired"];
1304 }
1305 if (_json.containsKey("httpMethod")) {
1306 httpMethod = _json["httpMethod"];
1307 }
1308 if (_json.containsKey("id")) {
1309 id = _json["id"];
1310 }
1311 if (_json.containsKey("mediaUpload")) {
1312 mediaUpload = new RestMethodMediaUpload.fromJson(_json["mediaUpload"]);
1313 }
1314 if (_json.containsKey("parameterOrder")) {
1315 parameterOrder = _json["parameterOrder"];
1316 }
1317 if (_json.containsKey("parameters")) {
1318 parameters = common_internal.mapMap(_json["parameters"], (item) => new Jso nSchema.fromJson(item));
1319 }
1320 if (_json.containsKey("path")) {
1321 path = _json["path"];
1322 }
1323 if (_json.containsKey("request")) {
1324 request = new RestMethodRequest.fromJson(_json["request"]);
1325 }
1326 if (_json.containsKey("response")) {
1327 response = new RestMethodResponse.fromJson(_json["response"]);
1328 }
1329 if (_json.containsKey("scopes")) {
1330 scopes = _json["scopes"];
1331 }
1332 if (_json.containsKey("supportsMediaDownload")) {
1333 supportsMediaDownload = _json["supportsMediaDownload"];
1334 }
1335 if (_json.containsKey("supportsMediaUpload")) {
1336 supportsMediaUpload = _json["supportsMediaUpload"];
1337 }
1338 if (_json.containsKey("supportsSubscription")) {
1339 supportsSubscription = _json["supportsSubscription"];
1340 }
1341 }
1342
1343 core.Map toJson() {
1344 var _json = new core.Map();
1345 if (description != null) {
1346 _json["description"] = description;
1347 }
1348 if (etagRequired != null) {
1349 _json["etagRequired"] = etagRequired;
1350 }
1351 if (httpMethod != null) {
1352 _json["httpMethod"] = httpMethod;
1353 }
1354 if (id != null) {
1355 _json["id"] = id;
1356 }
1357 if (mediaUpload != null) {
1358 _json["mediaUpload"] = (mediaUpload).toJson();
1359 }
1360 if (parameterOrder != null) {
1361 _json["parameterOrder"] = parameterOrder;
1362 }
1363 if (parameters != null) {
1364 _json["parameters"] = common_internal.mapMap(parameters, (item) => (item). toJson());
1365 }
1366 if (path != null) {
1367 _json["path"] = path;
1368 }
1369 if (request != null) {
1370 _json["request"] = (request).toJson();
1371 }
1372 if (response != null) {
1373 _json["response"] = (response).toJson();
1374 }
1375 if (scopes != null) {
1376 _json["scopes"] = scopes;
1377 }
1378 if (supportsMediaDownload != null) {
1379 _json["supportsMediaDownload"] = supportsMediaDownload;
1380 }
1381 if (supportsMediaUpload != null) {
1382 _json["supportsMediaUpload"] = supportsMediaUpload;
1383 }
1384 if (supportsSubscription != null) {
1385 _json["supportsSubscription"] = supportsSubscription;
1386 }
1387 return _json;
1388 }
1389 }
1390
1391
1392 /** Not documented yet. */
1393 class RestResource {
1394 /** Methods on this resource. */
1395 core.Map<core.String, RestMethod> methods;
1396
1397 /** Sub-resources on this resource. */
1398 core.Map<core.String, RestResource> resources;
1399
1400
1401 RestResource();
1402
1403 RestResource.fromJson(core.Map _json) {
1404 if (_json.containsKey("methods")) {
1405 methods = common_internal.mapMap(_json["methods"], (item) => new RestMetho d.fromJson(item));
1406 }
1407 if (_json.containsKey("resources")) {
1408 resources = common_internal.mapMap(_json["resources"], (item) => new RestR esource.fromJson(item));
1409 }
1410 }
1411
1412 core.Map toJson() {
1413 var _json = new core.Map();
1414 if (methods != null) {
1415 _json["methods"] = common_internal.mapMap(methods, (item) => (item).toJson ());
1416 }
1417 if (resources != null) {
1418 _json["resources"] = common_internal.mapMap(resources, (item) => (item).to Json());
1419 }
1420 return _json;
1421 }
1422 }
1423
1424
OLDNEW
« no previous file with comments | « generated/googleapis/README.md ('k') | generated/googleapis/lib/src/common_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698