| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 1 library googleapis.discovery.v1; | 3 library googleapis.discovery.v1; |
| 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 discovery/v1'; |
| 15 | 18 |
| 16 /** | 19 /** |
| 17 * Lets you discover information about other Google APIs, such as what APIs are | 20 * Lets you discover information about other Google APIs, such as what APIs are |
| 18 * available, the resource and method details for each API. | 21 * available, the resource and method details for each API. |
| 19 */ | 22 */ |
| 20 class DiscoveryApi { | 23 class DiscoveryApi { |
| 21 | 24 |
| 22 final common_internal.ApiRequester _requester; | 25 final commons.ApiRequester _requester; |
| 23 | 26 |
| 24 ApisResourceApi get apis => new ApisResourceApi(_requester); | 27 ApisResourceApi get apis => new ApisResourceApi(_requester); |
| 25 | 28 |
| 26 DiscoveryApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "discovery/v1/"}) : | 29 DiscoveryApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "discovery/v1/"}) : |
| 27 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 30 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 28 } | 31 } |
| 29 | 32 |
| 30 | 33 |
| 31 /** Not documented yet. */ | |
| 32 class ApisResourceApi { | 34 class ApisResourceApi { |
| 33 final common_internal.ApiRequester _requester; | 35 final commons.ApiRequester _requester; |
| 34 | 36 |
| 35 ApisResourceApi(common_internal.ApiRequester client) : | 37 ApisResourceApi(commons.ApiRequester client) : |
| 36 _requester = client; | 38 _requester = client; |
| 37 | 39 |
| 38 /** | 40 /** |
| 39 * Retrieve the description of a particular version of an api. | 41 * Retrieve the description of a particular version of an api. |
| 40 * | 42 * |
| 41 * Request parameters: | 43 * Request parameters: |
| 42 * | 44 * |
| 43 * [api] - The name of the API. | 45 * [api] - The name of the API. |
| 44 * | 46 * |
| 45 * [version] - The version of the API. | 47 * [version] - The version of the API. |
| 46 * | 48 * |
| 47 * Completes with a [RestDescription]. | 49 * Completes with a [RestDescription]. |
| 48 * | 50 * |
| 49 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 51 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 50 * error. | 52 * error. |
| 51 * | 53 * |
| 52 * If the used [http.Client] completes with an error when making a REST call, | 54 * If the used [http.Client] completes with an error when making a REST call, |
| 53 * this method will complete with the same error. | 55 * this method will complete with the same error. |
| 54 */ | 56 */ |
| 55 async.Future<RestDescription> getRest(core.String api, core.String version) { | 57 async.Future<RestDescription> getRest(core.String api, core.String version) { |
| 56 var _url = null; | 58 var _url = null; |
| 57 var _queryParams = new core.Map(); | 59 var _queryParams = new core.Map(); |
| 58 var _uploadMedia = null; | 60 var _uploadMedia = null; |
| 59 var _uploadOptions = null; | 61 var _uploadOptions = null; |
| 60 var _downloadOptions = common.DownloadOptions.Metadata; | 62 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 61 var _body = null; | 63 var _body = null; |
| 62 | 64 |
| 63 if (api == null) { | 65 if (api == null) { |
| 64 throw new core.ArgumentError("Parameter api is required."); | 66 throw new core.ArgumentError("Parameter api is required."); |
| 65 } | 67 } |
| 66 if (version == null) { | 68 if (version == null) { |
| 67 throw new core.ArgumentError("Parameter version is required."); | 69 throw new core.ArgumentError("Parameter version is required."); |
| 68 } | 70 } |
| 69 | 71 |
| 70 | 72 |
| 71 _url = 'apis/' + common_internal.Escaper.ecapeVariable('$api') + '/' + commo
n_internal.Escaper.ecapeVariable('$version') + '/rest'; | 73 _url = 'apis/' + commons.Escaper.ecapeVariable('$api') + '/' + commons.Escap
er.ecapeVariable('$version') + '/rest'; |
| 72 | 74 |
| 73 var _response = _requester.request(_url, | 75 var _response = _requester.request(_url, |
| 74 "GET", | 76 "GET", |
| 75 body: _body, | 77 body: _body, |
| 76 queryParams: _queryParams, | 78 queryParams: _queryParams, |
| 77 uploadOptions: _uploadOptions, | 79 uploadOptions: _uploadOptions, |
| 78 uploadMedia: _uploadMedia, | 80 uploadMedia: _uploadMedia, |
| 79 downloadOptions: _downloadOptions); | 81 downloadOptions: _downloadOptions); |
| 80 return _response.then((data) => new RestDescription.fromJson(data)); | 82 return _response.then((data) => new RestDescription.fromJson(data)); |
| 81 } | 83 } |
| 82 | 84 |
| 83 /** | 85 /** |
| 84 * Retrieve the list of APIs supported at this endpoint. | 86 * Retrieve the list of APIs supported at this endpoint. |
| 85 * | 87 * |
| 86 * Request parameters: | 88 * Request parameters: |
| 87 * | 89 * |
| 88 * [name] - Only include APIs with the given name. | 90 * [name] - Only include APIs with the given name. |
| 89 * | 91 * |
| 90 * [preferred] - Return only the preferred version of an API. | 92 * [preferred] - Return only the preferred version of an API. |
| 91 * | 93 * |
| 92 * Completes with a [DirectoryList]. | 94 * Completes with a [DirectoryList]. |
| 93 * | 95 * |
| 94 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 96 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 95 * error. | 97 * error. |
| 96 * | 98 * |
| 97 * If the used [http.Client] completes with an error when making a REST call, | 99 * If the used [http.Client] completes with an error when making a REST call, |
| 98 * this method will complete with the same error. | 100 * this method will complete with the same error. |
| 99 */ | 101 */ |
| 100 async.Future<DirectoryList> list({core.String name, core.bool preferred}) { | 102 async.Future<DirectoryList> list({core.String name, core.bool preferred}) { |
| 101 var _url = null; | 103 var _url = null; |
| 102 var _queryParams = new core.Map(); | 104 var _queryParams = new core.Map(); |
| 103 var _uploadMedia = null; | 105 var _uploadMedia = null; |
| 104 var _uploadOptions = null; | 106 var _uploadOptions = null; |
| 105 var _downloadOptions = common.DownloadOptions.Metadata; | 107 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 106 var _body = null; | 108 var _body = null; |
| 107 | 109 |
| 108 if (name != null) { | 110 if (name != null) { |
| 109 _queryParams["name"] = [name]; | 111 _queryParams["name"] = [name]; |
| 110 } | 112 } |
| 111 if (preferred != null) { | 113 if (preferred != null) { |
| 112 _queryParams["preferred"] = ["${preferred}"]; | 114 _queryParams["preferred"] = ["${preferred}"]; |
| 113 } | 115 } |
| 114 | 116 |
| 115 | 117 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 _json["x16"] = x16; | 157 _json["x16"] = x16; |
| 156 } | 158 } |
| 157 if (x32 != null) { | 159 if (x32 != null) { |
| 158 _json["x32"] = x32; | 160 _json["x32"] = x32; |
| 159 } | 161 } |
| 160 return _json; | 162 return _json; |
| 161 } | 163 } |
| 162 } | 164 } |
| 163 | 165 |
| 164 | 166 |
| 165 /** Not documented yet. */ | |
| 166 class DirectoryListItems { | 167 class DirectoryListItems { |
| 167 /** The description of this API. */ | 168 /** The description of this API. */ |
| 168 core.String description; | 169 core.String description; |
| 169 | 170 |
| 170 /** A link to the discovery document. */ | 171 /** A link to the discovery document. */ |
| 171 core.String discoveryLink; | 172 core.String discoveryLink; |
| 172 | 173 |
| 173 /** The URL for the discovery REST document. */ | 174 /** The URL for the discovery REST document. */ |
| 174 core.String discoveryRestUrl; | 175 core.String discoveryRestUrl; |
| 175 | 176 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 _json["title"] = title; | 279 _json["title"] = title; |
| 279 } | 280 } |
| 280 if (version != null) { | 281 if (version != null) { |
| 281 _json["version"] = version; | 282 _json["version"] = version; |
| 282 } | 283 } |
| 283 return _json; | 284 return _json; |
| 284 } | 285 } |
| 285 } | 286 } |
| 286 | 287 |
| 287 | 288 |
| 288 /** Not documented yet. */ | |
| 289 class DirectoryList { | 289 class DirectoryList { |
| 290 /** Indicate the version of the Discovery API used to generate this doc. */ | 290 /** Indicate the version of the Discovery API used to generate this doc. */ |
| 291 core.String discoveryVersion; | 291 core.String discoveryVersion; |
| 292 | 292 |
| 293 /** The individual directory entries. One entry per api/version pair. */ | 293 /** The individual directory entries. One entry per api/version pair. */ |
| 294 core.List<DirectoryListItems> items; | 294 core.List<DirectoryListItems> items; |
| 295 | 295 |
| 296 /** The kind for this response. */ | 296 /** The kind for this response. */ |
| 297 core.String kind; | 297 core.String kind; |
| 298 | 298 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 core.Map toJson() { | 344 core.Map toJson() { |
| 345 var _json = new core.Map(); | 345 var _json = new core.Map(); |
| 346 if (required != null) { | 346 if (required != null) { |
| 347 _json["required"] = required; | 347 _json["required"] = required; |
| 348 } | 348 } |
| 349 return _json; | 349 return _json; |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 /** Not documented yet. */ | |
| 355 class JsonSchemaVariantMap { | 354 class JsonSchemaVariantMap { |
| 356 /** Not documented yet. */ | |
| 357 core.String P_ref; | 355 core.String P_ref; |
| 358 | 356 |
| 359 /** Not documented yet. */ | |
| 360 core.String typeValue; | 357 core.String typeValue; |
| 361 | 358 |
| 362 | 359 |
| 363 JsonSchemaVariantMap(); | 360 JsonSchemaVariantMap(); |
| 364 | 361 |
| 365 JsonSchemaVariantMap.fromJson(core.Map _json) { | 362 JsonSchemaVariantMap.fromJson(core.Map _json) { |
| 366 if (_json.containsKey("\$ref")) { | 363 if (_json.containsKey("\$ref")) { |
| 367 P_ref = _json["\$ref"]; | 364 P_ref = _json["\$ref"]; |
| 368 } | 365 } |
| 369 if (_json.containsKey("type_value")) { | 366 if (_json.containsKey("type_value")) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 _json["discriminant"] = discriminant; | 411 _json["discriminant"] = discriminant; |
| 415 } | 412 } |
| 416 if (map != null) { | 413 if (map != null) { |
| 417 _json["map"] = map.map((value) => (value).toJson()).toList(); | 414 _json["map"] = map.map((value) => (value).toJson()).toList(); |
| 418 } | 415 } |
| 419 return _json; | 416 return _json; |
| 420 } | 417 } |
| 421 } | 418 } |
| 422 | 419 |
| 423 | 420 |
| 424 /** Not documented yet. */ | |
| 425 class JsonSchema { | 421 class JsonSchema { |
| 426 /** | 422 /** |
| 427 * A reference to another schema. The value of this property is the "id" of | 423 * A reference to another schema. The value of this property is the "id" of |
| 428 * another schema. | 424 * another schema. |
| 429 */ | 425 */ |
| 430 core.String P_ref; | 426 core.String P_ref; |
| 431 | 427 |
| 432 /** | 428 /** |
| 433 * If this is a schema for an object, this property is the schema for any | 429 * If this is a schema for an object, this property is the schema for any |
| 434 * additional properties with dynamic keys on this object. | 430 * additional properties with dynamic keys on this object. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 if (_json.containsKey("maximum")) { | 555 if (_json.containsKey("maximum")) { |
| 560 maximum = _json["maximum"]; | 556 maximum = _json["maximum"]; |
| 561 } | 557 } |
| 562 if (_json.containsKey("minimum")) { | 558 if (_json.containsKey("minimum")) { |
| 563 minimum = _json["minimum"]; | 559 minimum = _json["minimum"]; |
| 564 } | 560 } |
| 565 if (_json.containsKey("pattern")) { | 561 if (_json.containsKey("pattern")) { |
| 566 pattern = _json["pattern"]; | 562 pattern = _json["pattern"]; |
| 567 } | 563 } |
| 568 if (_json.containsKey("properties")) { | 564 if (_json.containsKey("properties")) { |
| 569 properties = common_internal.mapMap(_json["properties"], (item) => new Jso
nSchema.fromJson(item)); | 565 properties = commons.mapMap(_json["properties"], (item) => new JsonSchema.
fromJson(item)); |
| 570 } | 566 } |
| 571 if (_json.containsKey("readOnly")) { | 567 if (_json.containsKey("readOnly")) { |
| 572 readOnly = _json["readOnly"]; | 568 readOnly = _json["readOnly"]; |
| 573 } | 569 } |
| 574 if (_json.containsKey("repeated")) { | 570 if (_json.containsKey("repeated")) { |
| 575 repeated = _json["repeated"]; | 571 repeated = _json["repeated"]; |
| 576 } | 572 } |
| 577 if (_json.containsKey("required")) { | 573 if (_json.containsKey("required")) { |
| 578 required = _json["required"]; | 574 required = _json["required"]; |
| 579 } | 575 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 if (maximum != null) { | 619 if (maximum != null) { |
| 624 _json["maximum"] = maximum; | 620 _json["maximum"] = maximum; |
| 625 } | 621 } |
| 626 if (minimum != null) { | 622 if (minimum != null) { |
| 627 _json["minimum"] = minimum; | 623 _json["minimum"] = minimum; |
| 628 } | 624 } |
| 629 if (pattern != null) { | 625 if (pattern != null) { |
| 630 _json["pattern"] = pattern; | 626 _json["pattern"] = pattern; |
| 631 } | 627 } |
| 632 if (properties != null) { | 628 if (properties != null) { |
| 633 _json["properties"] = common_internal.mapMap(properties, (item) => (item).
toJson()); | 629 _json["properties"] = commons.mapMap(properties, (item) => (item).toJson()
); |
| 634 } | 630 } |
| 635 if (readOnly != null) { | 631 if (readOnly != null) { |
| 636 _json["readOnly"] = readOnly; | 632 _json["readOnly"] = readOnly; |
| 637 } | 633 } |
| 638 if (repeated != null) { | 634 if (repeated != null) { |
| 639 _json["repeated"] = repeated; | 635 _json["repeated"] = repeated; |
| 640 } | 636 } |
| 641 if (required != null) { | 637 if (required != null) { |
| 642 _json["required"] = required; | 638 _json["required"] = required; |
| 643 } | 639 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 /** OAuth 2.0 authentication information. */ | 675 /** OAuth 2.0 authentication information. */ |
| 680 class RestDescriptionAuthOauth2 { | 676 class RestDescriptionAuthOauth2 { |
| 681 /** Available OAuth 2.0 scopes. */ | 677 /** Available OAuth 2.0 scopes. */ |
| 682 core.Map<core.String, RestDescriptionAuthOauth2ScopesValue> scopes; | 678 core.Map<core.String, RestDescriptionAuthOauth2ScopesValue> scopes; |
| 683 | 679 |
| 684 | 680 |
| 685 RestDescriptionAuthOauth2(); | 681 RestDescriptionAuthOauth2(); |
| 686 | 682 |
| 687 RestDescriptionAuthOauth2.fromJson(core.Map _json) { | 683 RestDescriptionAuthOauth2.fromJson(core.Map _json) { |
| 688 if (_json.containsKey("scopes")) { | 684 if (_json.containsKey("scopes")) { |
| 689 scopes = common_internal.mapMap(_json["scopes"], (item) => new RestDescrip
tionAuthOauth2ScopesValue.fromJson(item)); | 685 scopes = commons.mapMap(_json["scopes"], (item) => new RestDescriptionAuth
Oauth2ScopesValue.fromJson(item)); |
| 690 } | 686 } |
| 691 } | 687 } |
| 692 | 688 |
| 693 core.Map toJson() { | 689 core.Map toJson() { |
| 694 var _json = new core.Map(); | 690 var _json = new core.Map(); |
| 695 if (scopes != null) { | 691 if (scopes != null) { |
| 696 _json["scopes"] = common_internal.mapMap(scopes, (item) => (item).toJson()
); | 692 _json["scopes"] = commons.mapMap(scopes, (item) => (item).toJson()); |
| 697 } | 693 } |
| 698 return _json; | 694 return _json; |
| 699 } | 695 } |
| 700 } | 696 } |
| 701 | 697 |
| 702 | 698 |
| 703 /** Authentication information. */ | 699 /** Authentication information. */ |
| 704 class RestDescriptionAuth { | 700 class RestDescriptionAuth { |
| 705 /** OAuth 2.0 authentication information. */ | 701 /** OAuth 2.0 authentication information. */ |
| 706 RestDescriptionAuthOauth2 oauth2; | 702 RestDescriptionAuthOauth2 oauth2; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 _json["x16"] = x16; | 746 _json["x16"] = x16; |
| 751 } | 747 } |
| 752 if (x32 != null) { | 748 if (x32 != null) { |
| 753 _json["x32"] = x32; | 749 _json["x32"] = x32; |
| 754 } | 750 } |
| 755 return _json; | 751 return _json; |
| 756 } | 752 } |
| 757 } | 753 } |
| 758 | 754 |
| 759 | 755 |
| 760 /** Not documented yet. */ | |
| 761 class RestDescription { | 756 class RestDescription { |
| 762 /** Authentication information. */ | 757 /** Authentication information. */ |
| 763 RestDescriptionAuth auth; | 758 RestDescriptionAuth auth; |
| 764 | 759 |
| 765 /** [DEPRECATED] The base path for REST requests. */ | 760 /** [DEPRECATED] The base path for REST requests. */ |
| 766 core.String basePath; | 761 core.String basePath; |
| 767 | 762 |
| 768 /** [DEPRECATED] The base URL for REST requests. */ | 763 /** [DEPRECATED] The base URL for REST requests. */ |
| 769 core.String baseUrl; | 764 core.String baseUrl; |
| 770 | 765 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 if (_json.containsKey("id")) { | 885 if (_json.containsKey("id")) { |
| 891 id = _json["id"]; | 886 id = _json["id"]; |
| 892 } | 887 } |
| 893 if (_json.containsKey("kind")) { | 888 if (_json.containsKey("kind")) { |
| 894 kind = _json["kind"]; | 889 kind = _json["kind"]; |
| 895 } | 890 } |
| 896 if (_json.containsKey("labels")) { | 891 if (_json.containsKey("labels")) { |
| 897 labels = _json["labels"]; | 892 labels = _json["labels"]; |
| 898 } | 893 } |
| 899 if (_json.containsKey("methods")) { | 894 if (_json.containsKey("methods")) { |
| 900 methods = common_internal.mapMap(_json["methods"], (item) => new RestMetho
d.fromJson(item)); | 895 methods = commons.mapMap(_json["methods"], (item) => new RestMethod.fromJs
on(item)); |
| 901 } | 896 } |
| 902 if (_json.containsKey("name")) { | 897 if (_json.containsKey("name")) { |
| 903 name = _json["name"]; | 898 name = _json["name"]; |
| 904 } | 899 } |
| 905 if (_json.containsKey("ownerDomain")) { | 900 if (_json.containsKey("ownerDomain")) { |
| 906 ownerDomain = _json["ownerDomain"]; | 901 ownerDomain = _json["ownerDomain"]; |
| 907 } | 902 } |
| 908 if (_json.containsKey("ownerName")) { | 903 if (_json.containsKey("ownerName")) { |
| 909 ownerName = _json["ownerName"]; | 904 ownerName = _json["ownerName"]; |
| 910 } | 905 } |
| 911 if (_json.containsKey("packagePath")) { | 906 if (_json.containsKey("packagePath")) { |
| 912 packagePath = _json["packagePath"]; | 907 packagePath = _json["packagePath"]; |
| 913 } | 908 } |
| 914 if (_json.containsKey("parameters")) { | 909 if (_json.containsKey("parameters")) { |
| 915 parameters = common_internal.mapMap(_json["parameters"], (item) => new Jso
nSchema.fromJson(item)); | 910 parameters = commons.mapMap(_json["parameters"], (item) => new JsonSchema.
fromJson(item)); |
| 916 } | 911 } |
| 917 if (_json.containsKey("protocol")) { | 912 if (_json.containsKey("protocol")) { |
| 918 protocol = _json["protocol"]; | 913 protocol = _json["protocol"]; |
| 919 } | 914 } |
| 920 if (_json.containsKey("resources")) { | 915 if (_json.containsKey("resources")) { |
| 921 resources = common_internal.mapMap(_json["resources"], (item) => new RestR
esource.fromJson(item)); | 916 resources = commons.mapMap(_json["resources"], (item) => new RestResource.
fromJson(item)); |
| 922 } | 917 } |
| 923 if (_json.containsKey("revision")) { | 918 if (_json.containsKey("revision")) { |
| 924 revision = _json["revision"]; | 919 revision = _json["revision"]; |
| 925 } | 920 } |
| 926 if (_json.containsKey("rootUrl")) { | 921 if (_json.containsKey("rootUrl")) { |
| 927 rootUrl = _json["rootUrl"]; | 922 rootUrl = _json["rootUrl"]; |
| 928 } | 923 } |
| 929 if (_json.containsKey("schemas")) { | 924 if (_json.containsKey("schemas")) { |
| 930 schemas = common_internal.mapMap(_json["schemas"], (item) => new JsonSchem
a.fromJson(item)); | 925 schemas = commons.mapMap(_json["schemas"], (item) => new JsonSchema.fromJs
on(item)); |
| 931 } | 926 } |
| 932 if (_json.containsKey("servicePath")) { | 927 if (_json.containsKey("servicePath")) { |
| 933 servicePath = _json["servicePath"]; | 928 servicePath = _json["servicePath"]; |
| 934 } | 929 } |
| 935 if (_json.containsKey("title")) { | 930 if (_json.containsKey("title")) { |
| 936 title = _json["title"]; | 931 title = _json["title"]; |
| 937 } | 932 } |
| 938 if (_json.containsKey("version")) { | 933 if (_json.containsKey("version")) { |
| 939 version = _json["version"]; | 934 version = _json["version"]; |
| 940 } | 935 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 if (id != null) { | 973 if (id != null) { |
| 979 _json["id"] = id; | 974 _json["id"] = id; |
| 980 } | 975 } |
| 981 if (kind != null) { | 976 if (kind != null) { |
| 982 _json["kind"] = kind; | 977 _json["kind"] = kind; |
| 983 } | 978 } |
| 984 if (labels != null) { | 979 if (labels != null) { |
| 985 _json["labels"] = labels; | 980 _json["labels"] = labels; |
| 986 } | 981 } |
| 987 if (methods != null) { | 982 if (methods != null) { |
| 988 _json["methods"] = common_internal.mapMap(methods, (item) => (item).toJson
()); | 983 _json["methods"] = commons.mapMap(methods, (item) => (item).toJson()); |
| 989 } | 984 } |
| 990 if (name != null) { | 985 if (name != null) { |
| 991 _json["name"] = name; | 986 _json["name"] = name; |
| 992 } | 987 } |
| 993 if (ownerDomain != null) { | 988 if (ownerDomain != null) { |
| 994 _json["ownerDomain"] = ownerDomain; | 989 _json["ownerDomain"] = ownerDomain; |
| 995 } | 990 } |
| 996 if (ownerName != null) { | 991 if (ownerName != null) { |
| 997 _json["ownerName"] = ownerName; | 992 _json["ownerName"] = ownerName; |
| 998 } | 993 } |
| 999 if (packagePath != null) { | 994 if (packagePath != null) { |
| 1000 _json["packagePath"] = packagePath; | 995 _json["packagePath"] = packagePath; |
| 1001 } | 996 } |
| 1002 if (parameters != null) { | 997 if (parameters != null) { |
| 1003 _json["parameters"] = common_internal.mapMap(parameters, (item) => (item).
toJson()); | 998 _json["parameters"] = commons.mapMap(parameters, (item) => (item).toJson()
); |
| 1004 } | 999 } |
| 1005 if (protocol != null) { | 1000 if (protocol != null) { |
| 1006 _json["protocol"] = protocol; | 1001 _json["protocol"] = protocol; |
| 1007 } | 1002 } |
| 1008 if (resources != null) { | 1003 if (resources != null) { |
| 1009 _json["resources"] = common_internal.mapMap(resources, (item) => (item).to
Json()); | 1004 _json["resources"] = commons.mapMap(resources, (item) => (item).toJson()); |
| 1010 } | 1005 } |
| 1011 if (revision != null) { | 1006 if (revision != null) { |
| 1012 _json["revision"] = revision; | 1007 _json["revision"] = revision; |
| 1013 } | 1008 } |
| 1014 if (rootUrl != null) { | 1009 if (rootUrl != null) { |
| 1015 _json["rootUrl"] = rootUrl; | 1010 _json["rootUrl"] = rootUrl; |
| 1016 } | 1011 } |
| 1017 if (schemas != null) { | 1012 if (schemas != null) { |
| 1018 _json["schemas"] = common_internal.mapMap(schemas, (item) => (item).toJson
()); | 1013 _json["schemas"] = commons.mapMap(schemas, (item) => (item).toJson()); |
| 1019 } | 1014 } |
| 1020 if (servicePath != null) { | 1015 if (servicePath != null) { |
| 1021 _json["servicePath"] = servicePath; | 1016 _json["servicePath"] = servicePath; |
| 1022 } | 1017 } |
| 1023 if (title != null) { | 1018 if (title != null) { |
| 1024 _json["title"] = title; | 1019 _json["title"] = title; |
| 1025 } | 1020 } |
| 1026 if (version != null) { | 1021 if (version != null) { |
| 1027 _json["version"] = version; | 1022 _json["version"] = version; |
| 1028 } | 1023 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 core.Map toJson() { | 1223 core.Map toJson() { |
| 1229 var _json = new core.Map(); | 1224 var _json = new core.Map(); |
| 1230 if (P_ref != null) { | 1225 if (P_ref != null) { |
| 1231 _json["\$ref"] = P_ref; | 1226 _json["\$ref"] = P_ref; |
| 1232 } | 1227 } |
| 1233 return _json; | 1228 return _json; |
| 1234 } | 1229 } |
| 1235 } | 1230 } |
| 1236 | 1231 |
| 1237 | 1232 |
| 1238 /** Not documented yet. */ | |
| 1239 class RestMethod { | 1233 class RestMethod { |
| 1240 /** Description of this method. */ | 1234 /** Description of this method. */ |
| 1241 core.String description; | 1235 core.String description; |
| 1242 | 1236 |
| 1243 /** | 1237 /** |
| 1244 * Whether this method requires an ETag to be specified. The ETag is sent as | 1238 * Whether this method requires an ETag to be specified. The ETag is sent as |
| 1245 * an HTTP If-Match or If-None-Match header. | 1239 * an HTTP If-Match or If-None-Match header. |
| 1246 */ | 1240 */ |
| 1247 core.bool etagRequired; | 1241 core.bool etagRequired; |
| 1248 | 1242 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 | 1279 |
| 1286 /** Whether this method supports media downloads. */ | 1280 /** Whether this method supports media downloads. */ |
| 1287 core.bool supportsMediaDownload; | 1281 core.bool supportsMediaDownload; |
| 1288 | 1282 |
| 1289 /** Whether this method supports media uploads. */ | 1283 /** Whether this method supports media uploads. */ |
| 1290 core.bool supportsMediaUpload; | 1284 core.bool supportsMediaUpload; |
| 1291 | 1285 |
| 1292 /** Whether this method supports subscriptions. */ | 1286 /** Whether this method supports subscriptions. */ |
| 1293 core.bool supportsSubscription; | 1287 core.bool supportsSubscription; |
| 1294 | 1288 |
| 1289 /** |
| 1290 * Indicates that downloads from this method should use the download service |
| 1291 * URL (i.e. "/download"). Only applies if the method supports media download. |
| 1292 */ |
| 1293 core.bool useMediaDownloadService; |
| 1294 |
| 1295 | 1295 |
| 1296 RestMethod(); | 1296 RestMethod(); |
| 1297 | 1297 |
| 1298 RestMethod.fromJson(core.Map _json) { | 1298 RestMethod.fromJson(core.Map _json) { |
| 1299 if (_json.containsKey("description")) { | 1299 if (_json.containsKey("description")) { |
| 1300 description = _json["description"]; | 1300 description = _json["description"]; |
| 1301 } | 1301 } |
| 1302 if (_json.containsKey("etagRequired")) { | 1302 if (_json.containsKey("etagRequired")) { |
| 1303 etagRequired = _json["etagRequired"]; | 1303 etagRequired = _json["etagRequired"]; |
| 1304 } | 1304 } |
| 1305 if (_json.containsKey("httpMethod")) { | 1305 if (_json.containsKey("httpMethod")) { |
| 1306 httpMethod = _json["httpMethod"]; | 1306 httpMethod = _json["httpMethod"]; |
| 1307 } | 1307 } |
| 1308 if (_json.containsKey("id")) { | 1308 if (_json.containsKey("id")) { |
| 1309 id = _json["id"]; | 1309 id = _json["id"]; |
| 1310 } | 1310 } |
| 1311 if (_json.containsKey("mediaUpload")) { | 1311 if (_json.containsKey("mediaUpload")) { |
| 1312 mediaUpload = new RestMethodMediaUpload.fromJson(_json["mediaUpload"]); | 1312 mediaUpload = new RestMethodMediaUpload.fromJson(_json["mediaUpload"]); |
| 1313 } | 1313 } |
| 1314 if (_json.containsKey("parameterOrder")) { | 1314 if (_json.containsKey("parameterOrder")) { |
| 1315 parameterOrder = _json["parameterOrder"]; | 1315 parameterOrder = _json["parameterOrder"]; |
| 1316 } | 1316 } |
| 1317 if (_json.containsKey("parameters")) { | 1317 if (_json.containsKey("parameters")) { |
| 1318 parameters = common_internal.mapMap(_json["parameters"], (item) => new Jso
nSchema.fromJson(item)); | 1318 parameters = commons.mapMap(_json["parameters"], (item) => new JsonSchema.
fromJson(item)); |
| 1319 } | 1319 } |
| 1320 if (_json.containsKey("path")) { | 1320 if (_json.containsKey("path")) { |
| 1321 path = _json["path"]; | 1321 path = _json["path"]; |
| 1322 } | 1322 } |
| 1323 if (_json.containsKey("request")) { | 1323 if (_json.containsKey("request")) { |
| 1324 request = new RestMethodRequest.fromJson(_json["request"]); | 1324 request = new RestMethodRequest.fromJson(_json["request"]); |
| 1325 } | 1325 } |
| 1326 if (_json.containsKey("response")) { | 1326 if (_json.containsKey("response")) { |
| 1327 response = new RestMethodResponse.fromJson(_json["response"]); | 1327 response = new RestMethodResponse.fromJson(_json["response"]); |
| 1328 } | 1328 } |
| 1329 if (_json.containsKey("scopes")) { | 1329 if (_json.containsKey("scopes")) { |
| 1330 scopes = _json["scopes"]; | 1330 scopes = _json["scopes"]; |
| 1331 } | 1331 } |
| 1332 if (_json.containsKey("supportsMediaDownload")) { | 1332 if (_json.containsKey("supportsMediaDownload")) { |
| 1333 supportsMediaDownload = _json["supportsMediaDownload"]; | 1333 supportsMediaDownload = _json["supportsMediaDownload"]; |
| 1334 } | 1334 } |
| 1335 if (_json.containsKey("supportsMediaUpload")) { | 1335 if (_json.containsKey("supportsMediaUpload")) { |
| 1336 supportsMediaUpload = _json["supportsMediaUpload"]; | 1336 supportsMediaUpload = _json["supportsMediaUpload"]; |
| 1337 } | 1337 } |
| 1338 if (_json.containsKey("supportsSubscription")) { | 1338 if (_json.containsKey("supportsSubscription")) { |
| 1339 supportsSubscription = _json["supportsSubscription"]; | 1339 supportsSubscription = _json["supportsSubscription"]; |
| 1340 } | 1340 } |
| 1341 if (_json.containsKey("useMediaDownloadService")) { |
| 1342 useMediaDownloadService = _json["useMediaDownloadService"]; |
| 1343 } |
| 1341 } | 1344 } |
| 1342 | 1345 |
| 1343 core.Map toJson() { | 1346 core.Map toJson() { |
| 1344 var _json = new core.Map(); | 1347 var _json = new core.Map(); |
| 1345 if (description != null) { | 1348 if (description != null) { |
| 1346 _json["description"] = description; | 1349 _json["description"] = description; |
| 1347 } | 1350 } |
| 1348 if (etagRequired != null) { | 1351 if (etagRequired != null) { |
| 1349 _json["etagRequired"] = etagRequired; | 1352 _json["etagRequired"] = etagRequired; |
| 1350 } | 1353 } |
| 1351 if (httpMethod != null) { | 1354 if (httpMethod != null) { |
| 1352 _json["httpMethod"] = httpMethod; | 1355 _json["httpMethod"] = httpMethod; |
| 1353 } | 1356 } |
| 1354 if (id != null) { | 1357 if (id != null) { |
| 1355 _json["id"] = id; | 1358 _json["id"] = id; |
| 1356 } | 1359 } |
| 1357 if (mediaUpload != null) { | 1360 if (mediaUpload != null) { |
| 1358 _json["mediaUpload"] = (mediaUpload).toJson(); | 1361 _json["mediaUpload"] = (mediaUpload).toJson(); |
| 1359 } | 1362 } |
| 1360 if (parameterOrder != null) { | 1363 if (parameterOrder != null) { |
| 1361 _json["parameterOrder"] = parameterOrder; | 1364 _json["parameterOrder"] = parameterOrder; |
| 1362 } | 1365 } |
| 1363 if (parameters != null) { | 1366 if (parameters != null) { |
| 1364 _json["parameters"] = common_internal.mapMap(parameters, (item) => (item).
toJson()); | 1367 _json["parameters"] = commons.mapMap(parameters, (item) => (item).toJson()
); |
| 1365 } | 1368 } |
| 1366 if (path != null) { | 1369 if (path != null) { |
| 1367 _json["path"] = path; | 1370 _json["path"] = path; |
| 1368 } | 1371 } |
| 1369 if (request != null) { | 1372 if (request != null) { |
| 1370 _json["request"] = (request).toJson(); | 1373 _json["request"] = (request).toJson(); |
| 1371 } | 1374 } |
| 1372 if (response != null) { | 1375 if (response != null) { |
| 1373 _json["response"] = (response).toJson(); | 1376 _json["response"] = (response).toJson(); |
| 1374 } | 1377 } |
| 1375 if (scopes != null) { | 1378 if (scopes != null) { |
| 1376 _json["scopes"] = scopes; | 1379 _json["scopes"] = scopes; |
| 1377 } | 1380 } |
| 1378 if (supportsMediaDownload != null) { | 1381 if (supportsMediaDownload != null) { |
| 1379 _json["supportsMediaDownload"] = supportsMediaDownload; | 1382 _json["supportsMediaDownload"] = supportsMediaDownload; |
| 1380 } | 1383 } |
| 1381 if (supportsMediaUpload != null) { | 1384 if (supportsMediaUpload != null) { |
| 1382 _json["supportsMediaUpload"] = supportsMediaUpload; | 1385 _json["supportsMediaUpload"] = supportsMediaUpload; |
| 1383 } | 1386 } |
| 1384 if (supportsSubscription != null) { | 1387 if (supportsSubscription != null) { |
| 1385 _json["supportsSubscription"] = supportsSubscription; | 1388 _json["supportsSubscription"] = supportsSubscription; |
| 1386 } | 1389 } |
| 1390 if (useMediaDownloadService != null) { |
| 1391 _json["useMediaDownloadService"] = useMediaDownloadService; |
| 1392 } |
| 1387 return _json; | 1393 return _json; |
| 1388 } | 1394 } |
| 1389 } | 1395 } |
| 1390 | 1396 |
| 1391 | 1397 |
| 1392 /** Not documented yet. */ | |
| 1393 class RestResource { | 1398 class RestResource { |
| 1394 /** Methods on this resource. */ | 1399 /** Methods on this resource. */ |
| 1395 core.Map<core.String, RestMethod> methods; | 1400 core.Map<core.String, RestMethod> methods; |
| 1396 | 1401 |
| 1397 /** Sub-resources on this resource. */ | 1402 /** Sub-resources on this resource. */ |
| 1398 core.Map<core.String, RestResource> resources; | 1403 core.Map<core.String, RestResource> resources; |
| 1399 | 1404 |
| 1400 | 1405 |
| 1401 RestResource(); | 1406 RestResource(); |
| 1402 | 1407 |
| 1403 RestResource.fromJson(core.Map _json) { | 1408 RestResource.fromJson(core.Map _json) { |
| 1404 if (_json.containsKey("methods")) { | 1409 if (_json.containsKey("methods")) { |
| 1405 methods = common_internal.mapMap(_json["methods"], (item) => new RestMetho
d.fromJson(item)); | 1410 methods = commons.mapMap(_json["methods"], (item) => new RestMethod.fromJs
on(item)); |
| 1406 } | 1411 } |
| 1407 if (_json.containsKey("resources")) { | 1412 if (_json.containsKey("resources")) { |
| 1408 resources = common_internal.mapMap(_json["resources"], (item) => new RestR
esource.fromJson(item)); | 1413 resources = commons.mapMap(_json["resources"], (item) => new RestResource.
fromJson(item)); |
| 1409 } | 1414 } |
| 1410 } | 1415 } |
| 1411 | 1416 |
| 1412 core.Map toJson() { | 1417 core.Map toJson() { |
| 1413 var _json = new core.Map(); | 1418 var _json = new core.Map(); |
| 1414 if (methods != null) { | 1419 if (methods != null) { |
| 1415 _json["methods"] = common_internal.mapMap(methods, (item) => (item).toJson
()); | 1420 _json["methods"] = commons.mapMap(methods, (item) => (item).toJson()); |
| 1416 } | 1421 } |
| 1417 if (resources != null) { | 1422 if (resources != null) { |
| 1418 _json["resources"] = common_internal.mapMap(resources, (item) => (item).to
Json()); | 1423 _json["resources"] = commons.mapMap(resources, (item) => (item).toJson()); |
| 1419 } | 1424 } |
| 1420 return _json; | 1425 return _json; |
| 1421 } | 1426 } |
| 1422 } | 1427 } |
| 1423 | |
| 1424 | |
| OLD | NEW |