OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.serviceuser.v1; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http_1; |
| 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 13 ApiRequestError, DetailedApiRequestError; |
| 14 |
| 15 const core.String USER_AGENT = 'dart-api-client serviceuser/v1'; |
| 16 |
| 17 /** |
| 18 * The Service User API allows service consumers to enable services they want to |
| 19 * use on Google Cloud Platform or disable services they no longer use. |
| 20 * Consumers can also list the set of services they have already enabled. |
| 21 */ |
| 22 class ServiceuserApi { |
| 23 /** View and manage your data across Google Cloud Platform services */ |
| 24 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 25 |
| 26 /** View your data across Google Cloud Platform services */ |
| 27 static const CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/clo
ud-platform.read-only"; |
| 28 |
| 29 /** Manage your Google API service configuration */ |
| 30 static const ServiceManagementScope = "https://www.googleapis.com/auth/service
.management"; |
| 31 |
| 32 |
| 33 final commons.ApiRequester _requester; |
| 34 |
| 35 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 36 |
| 37 ServiceuserApi(http_1.Client client, {core.String rootUrl: "https://serviceuse
r.googleapis.com/", core.String servicePath: ""}) : |
| 38 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 39 } |
| 40 |
| 41 |
| 42 class ProjectsResourceApi { |
| 43 final commons.ApiRequester _requester; |
| 44 |
| 45 ProjectsServicesResourceApi get services => new ProjectsServicesResourceApi(_r
equester); |
| 46 |
| 47 ProjectsResourceApi(commons.ApiRequester client) : |
| 48 _requester = client; |
| 49 } |
| 50 |
| 51 |
| 52 class ProjectsServicesResourceApi { |
| 53 final commons.ApiRequester _requester; |
| 54 |
| 55 ProjectsServicesResourceApi(commons.ApiRequester client) : |
| 56 _requester = client; |
| 57 |
| 58 /** |
| 59 * Disable a managed service for a consumer. |
| 60 * |
| 61 * Operation<response: google.protobuf.Empty> |
| 62 * |
| 63 * [request] - The metadata request object. |
| 64 * |
| 65 * Request parameters: |
| 66 * |
| 67 * [name] - Name of the consumer and the service to disable for that consumer. |
| 68 * |
| 69 * The Service User implementation accepts the following forms for consumer: |
| 70 * - "project:<project_id>" |
| 71 * |
| 72 * A valid path would be: |
| 73 * - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable |
| 74 * Value must have pattern "^projects/[^/]+/services/[^/]+$". |
| 75 * |
| 76 * Completes with a [Operation]. |
| 77 * |
| 78 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 79 * error. |
| 80 * |
| 81 * If the used [http_1.Client] completes with an error when making a REST |
| 82 * call, this method will complete with the same error. |
| 83 */ |
| 84 async.Future<Operation> disable(DisableServiceRequest request, core.String nam
e) { |
| 85 var _url = null; |
| 86 var _queryParams = new core.Map(); |
| 87 var _uploadMedia = null; |
| 88 var _uploadOptions = null; |
| 89 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 90 var _body = null; |
| 91 |
| 92 if (request != null) { |
| 93 _body = convert.JSON.encode((request).toJson()); |
| 94 } |
| 95 if (name == null) { |
| 96 throw new core.ArgumentError("Parameter name is required."); |
| 97 } |
| 98 |
| 99 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':disable'; |
| 100 |
| 101 var _response = _requester.request(_url, |
| 102 "POST", |
| 103 body: _body, |
| 104 queryParams: _queryParams, |
| 105 uploadOptions: _uploadOptions, |
| 106 uploadMedia: _uploadMedia, |
| 107 downloadOptions: _downloadOptions); |
| 108 return _response.then((data) => new Operation.fromJson(data)); |
| 109 } |
| 110 |
| 111 /** |
| 112 * Enable a managed service for a consumer with the default settings. |
| 113 * |
| 114 * Operation<response: google.protobuf.Empty> |
| 115 * |
| 116 * google.rpc.Status errors may contain a |
| 117 * google.rpc.PreconditionFailure error detail. |
| 118 * |
| 119 * [request] - The metadata request object. |
| 120 * |
| 121 * Request parameters: |
| 122 * |
| 123 * [name] - Name of the consumer and the service to enable for that consumer. |
| 124 * |
| 125 * A valid path would be: |
| 126 * - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable |
| 127 * Value must have pattern "^projects/[^/]+/services/[^/]+$". |
| 128 * |
| 129 * Completes with a [Operation]. |
| 130 * |
| 131 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 132 * error. |
| 133 * |
| 134 * If the used [http_1.Client] completes with an error when making a REST |
| 135 * call, this method will complete with the same error. |
| 136 */ |
| 137 async.Future<Operation> enable(EnableServiceRequest request, core.String name)
{ |
| 138 var _url = null; |
| 139 var _queryParams = new core.Map(); |
| 140 var _uploadMedia = null; |
| 141 var _uploadOptions = null; |
| 142 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 143 var _body = null; |
| 144 |
| 145 if (request != null) { |
| 146 _body = convert.JSON.encode((request).toJson()); |
| 147 } |
| 148 if (name == null) { |
| 149 throw new core.ArgumentError("Parameter name is required."); |
| 150 } |
| 151 |
| 152 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':enable'; |
| 153 |
| 154 var _response = _requester.request(_url, |
| 155 "POST", |
| 156 body: _body, |
| 157 queryParams: _queryParams, |
| 158 uploadOptions: _uploadOptions, |
| 159 uploadMedia: _uploadMedia, |
| 160 downloadOptions: _downloadOptions); |
| 161 return _response.then((data) => new Operation.fromJson(data)); |
| 162 } |
| 163 |
| 164 /** |
| 165 * List enabled services for the specified consumer. |
| 166 * |
| 167 * Request parameters: |
| 168 * |
| 169 * [parent] - List enabled services for the specified parent. |
| 170 * |
| 171 * An example valid parent would be: |
| 172 * - projects/my-project |
| 173 * Value must have pattern "^projects/[^/]+$". |
| 174 * |
| 175 * [pageSize] - Requested size of the next page of data. |
| 176 * |
| 177 * [pageToken] - Token identifying which result to start with; returned by a |
| 178 * previous list |
| 179 * call. |
| 180 * |
| 181 * Completes with a [ListEnabledServicesResponse]. |
| 182 * |
| 183 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 184 * error. |
| 185 * |
| 186 * If the used [http_1.Client] completes with an error when making a REST |
| 187 * call, this method will complete with the same error. |
| 188 */ |
| 189 async.Future<ListEnabledServicesResponse> list(core.String parent, {core.int p
ageSize, core.String pageToken}) { |
| 190 var _url = null; |
| 191 var _queryParams = new core.Map(); |
| 192 var _uploadMedia = null; |
| 193 var _uploadOptions = null; |
| 194 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 195 var _body = null; |
| 196 |
| 197 if (parent == null) { |
| 198 throw new core.ArgumentError("Parameter parent is required."); |
| 199 } |
| 200 if (pageSize != null) { |
| 201 _queryParams["pageSize"] = ["${pageSize}"]; |
| 202 } |
| 203 if (pageToken != null) { |
| 204 _queryParams["pageToken"] = [pageToken]; |
| 205 } |
| 206 |
| 207 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/services
'; |
| 208 |
| 209 var _response = _requester.request(_url, |
| 210 "GET", |
| 211 body: _body, |
| 212 queryParams: _queryParams, |
| 213 uploadOptions: _uploadOptions, |
| 214 uploadMedia: _uploadMedia, |
| 215 downloadOptions: _downloadOptions); |
| 216 return _response.then((data) => new ListEnabledServicesResponse.fromJson(dat
a)); |
| 217 } |
| 218 |
| 219 } |
| 220 |
| 221 |
| 222 |
| 223 /** Api is a light-weight descriptor for a protocol buffer service. */ |
| 224 class Api { |
| 225 /** The methods of this api, in unspecified order. */ |
| 226 core.List<Method> methods; |
| 227 /** Included APIs. See Mixin. */ |
| 228 core.List<Mixin> mixins; |
| 229 /** |
| 230 * The fully qualified name of this api, including package name |
| 231 * followed by the api's simple name. |
| 232 */ |
| 233 core.String name; |
| 234 /** Any metadata attached to the API. */ |
| 235 core.List<Option> options; |
| 236 /** |
| 237 * Source context for the protocol buffer service represented by this |
| 238 * message. |
| 239 */ |
| 240 SourceContext sourceContext; |
| 241 /** |
| 242 * The source syntax of the service. |
| 243 * Possible string values are: |
| 244 * - "SYNTAX_PROTO2" : Syntax `proto2`. |
| 245 * - "SYNTAX_PROTO3" : Syntax `proto3`. |
| 246 */ |
| 247 core.String syntax; |
| 248 /** |
| 249 * A version string for this api. If specified, must have the form |
| 250 * `major-version.minor-version`, as in `1.10`. If the minor version |
| 251 * is omitted, it defaults to zero. If the entire version field is |
| 252 * empty, the major version is derived from the package name, as |
| 253 * outlined below. If the field is not empty, the version in the |
| 254 * package name will be verified to be consistent with what is |
| 255 * provided here. |
| 256 * |
| 257 * The versioning schema uses [semantic |
| 258 * versioning](http://semver.org) where the major version number |
| 259 * indicates a breaking change and the minor version an additive, |
| 260 * non-breaking change. Both version numbers are signals to users |
| 261 * what to expect from different versions, and should be carefully |
| 262 * chosen based on the product plan. |
| 263 * |
| 264 * The major version is also reflected in the package name of the |
| 265 * API, which must end in `v<major-version>`, as in |
| 266 * `google.feature.v1`. For major versions 0 and 1, the suffix can |
| 267 * be omitted. Zero major versions must only be used for |
| 268 * experimental, none-GA apis. |
| 269 */ |
| 270 core.String version; |
| 271 |
| 272 Api(); |
| 273 |
| 274 Api.fromJson(core.Map _json) { |
| 275 if (_json.containsKey("methods")) { |
| 276 methods = _json["methods"].map((value) => new Method.fromJson(value)).toLi
st(); |
| 277 } |
| 278 if (_json.containsKey("mixins")) { |
| 279 mixins = _json["mixins"].map((value) => new Mixin.fromJson(value)).toList(
); |
| 280 } |
| 281 if (_json.containsKey("name")) { |
| 282 name = _json["name"]; |
| 283 } |
| 284 if (_json.containsKey("options")) { |
| 285 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 286 } |
| 287 if (_json.containsKey("sourceContext")) { |
| 288 sourceContext = new SourceContext.fromJson(_json["sourceContext"]); |
| 289 } |
| 290 if (_json.containsKey("syntax")) { |
| 291 syntax = _json["syntax"]; |
| 292 } |
| 293 if (_json.containsKey("version")) { |
| 294 version = _json["version"]; |
| 295 } |
| 296 } |
| 297 |
| 298 core.Map toJson() { |
| 299 var _json = new core.Map(); |
| 300 if (methods != null) { |
| 301 _json["methods"] = methods.map((value) => (value).toJson()).toList(); |
| 302 } |
| 303 if (mixins != null) { |
| 304 _json["mixins"] = mixins.map((value) => (value).toJson()).toList(); |
| 305 } |
| 306 if (name != null) { |
| 307 _json["name"] = name; |
| 308 } |
| 309 if (options != null) { |
| 310 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 311 } |
| 312 if (sourceContext != null) { |
| 313 _json["sourceContext"] = (sourceContext).toJson(); |
| 314 } |
| 315 if (syntax != null) { |
| 316 _json["syntax"] = syntax; |
| 317 } |
| 318 if (version != null) { |
| 319 _json["version"] = version; |
| 320 } |
| 321 return _json; |
| 322 } |
| 323 } |
| 324 |
| 325 /** |
| 326 * Configuration for an anthentication provider, including support for |
| 327 * [JSON Web Token |
| 328 * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). |
| 329 */ |
| 330 class AuthProvider { |
| 331 /** |
| 332 * The list of JWT |
| 333 * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#
section-4.1.3). |
| 334 * that are allowed to access. A JWT containing any of these audiences will |
| 335 * be accepted. When this setting is absent, only JWTs with audience |
| 336 * "https://Service_name/API_name" |
| 337 * will be accepted. For example, if no audiences are in the setting, |
| 338 * LibraryService API will only accept JWTs with the following audience |
| 339 * "https://library-example.googleapis.com/google.example.library.v1.LibrarySe
rvice". |
| 340 * |
| 341 * Example: |
| 342 * |
| 343 * audiences: bookstore_android.apps.googleusercontent.com, |
| 344 * bookstore_web.apps.googleusercontent.com |
| 345 */ |
| 346 core.String audiences; |
| 347 /** |
| 348 * The unique identifier of the auth provider. It will be referred to by |
| 349 * `AuthRequirement.provider_id`. |
| 350 * |
| 351 * Example: "bookstore_auth". |
| 352 */ |
| 353 core.String id; |
| 354 /** |
| 355 * Identifies the principal that issued the JWT. See |
| 356 * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.
1 |
| 357 * Usually a URL or an email address. |
| 358 * |
| 359 * Example: https://securetoken.google.com |
| 360 * Example: 1234567-compute@developer.gserviceaccount.com |
| 361 */ |
| 362 core.String issuer; |
| 363 /** |
| 364 * URL of the provider's public key set to validate signature of the JWT. See |
| 365 * [OpenID |
| 366 * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#Provi
derMetadata). |
| 367 * Optional if the key set document: |
| 368 * - can be retrieved from |
| 369 * [OpenID |
| 370 * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html |
| 371 * of the issuer. |
| 372 * - can be inferred from the email domain of the issuer (e.g. a Google |
| 373 * service account). |
| 374 * |
| 375 * Example: https://www.googleapis.com/oauth2/v1/certs |
| 376 */ |
| 377 core.String jwksUri; |
| 378 |
| 379 AuthProvider(); |
| 380 |
| 381 AuthProvider.fromJson(core.Map _json) { |
| 382 if (_json.containsKey("audiences")) { |
| 383 audiences = _json["audiences"]; |
| 384 } |
| 385 if (_json.containsKey("id")) { |
| 386 id = _json["id"]; |
| 387 } |
| 388 if (_json.containsKey("issuer")) { |
| 389 issuer = _json["issuer"]; |
| 390 } |
| 391 if (_json.containsKey("jwksUri")) { |
| 392 jwksUri = _json["jwksUri"]; |
| 393 } |
| 394 } |
| 395 |
| 396 core.Map toJson() { |
| 397 var _json = new core.Map(); |
| 398 if (audiences != null) { |
| 399 _json["audiences"] = audiences; |
| 400 } |
| 401 if (id != null) { |
| 402 _json["id"] = id; |
| 403 } |
| 404 if (issuer != null) { |
| 405 _json["issuer"] = issuer; |
| 406 } |
| 407 if (jwksUri != null) { |
| 408 _json["jwksUri"] = jwksUri; |
| 409 } |
| 410 return _json; |
| 411 } |
| 412 } |
| 413 |
| 414 /** |
| 415 * User-defined authentication requirements, including support for |
| 416 * [JSON Web Token |
| 417 * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). |
| 418 */ |
| 419 class AuthRequirement { |
| 420 /** |
| 421 * NOTE: This will be deprecated soon, once AuthProvider.audiences is |
| 422 * implemented and accepted in all the runtime components. |
| 423 * |
| 424 * The list of JWT |
| 425 * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#
section-4.1.3). |
| 426 * that are allowed to access. A JWT containing any of these audiences will |
| 427 * be accepted. When this setting is absent, only JWTs with audience |
| 428 * "https://Service_name/API_name" |
| 429 * will be accepted. For example, if no audiences are in the setting, |
| 430 * LibraryService API will only accept JWTs with the following audience |
| 431 * "https://library-example.googleapis.com/google.example.library.v1.LibrarySe
rvice". |
| 432 * |
| 433 * Example: |
| 434 * |
| 435 * audiences: bookstore_android.apps.googleusercontent.com, |
| 436 * bookstore_web.apps.googleusercontent.com |
| 437 */ |
| 438 core.String audiences; |
| 439 /** |
| 440 * id from authentication provider. |
| 441 * |
| 442 * Example: |
| 443 * |
| 444 * provider_id: bookstore_auth |
| 445 */ |
| 446 core.String providerId; |
| 447 |
| 448 AuthRequirement(); |
| 449 |
| 450 AuthRequirement.fromJson(core.Map _json) { |
| 451 if (_json.containsKey("audiences")) { |
| 452 audiences = _json["audiences"]; |
| 453 } |
| 454 if (_json.containsKey("providerId")) { |
| 455 providerId = _json["providerId"]; |
| 456 } |
| 457 } |
| 458 |
| 459 core.Map toJson() { |
| 460 var _json = new core.Map(); |
| 461 if (audiences != null) { |
| 462 _json["audiences"] = audiences; |
| 463 } |
| 464 if (providerId != null) { |
| 465 _json["providerId"] = providerId; |
| 466 } |
| 467 return _json; |
| 468 } |
| 469 } |
| 470 |
| 471 /** |
| 472 * `Authentication` defines the authentication configuration for an API. |
| 473 * |
| 474 * Example for an API targeted for external use: |
| 475 * |
| 476 * name: calendar.googleapis.com |
| 477 * authentication: |
| 478 * providers: |
| 479 * - id: google_calendar_auth |
| 480 * jwks_uri: https://www.googleapis.com/oauth2/v1/certs |
| 481 * issuer: https://securetoken.google.com |
| 482 * rules: |
| 483 * - selector: "*" |
| 484 * requirements: |
| 485 * provider_id: google_calendar_auth |
| 486 */ |
| 487 class Authentication { |
| 488 /** Defines a set of authentication providers that a service supports. */ |
| 489 core.List<AuthProvider> providers; |
| 490 /** |
| 491 * A list of authentication rules that apply to individual API methods. |
| 492 * |
| 493 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 494 */ |
| 495 core.List<AuthenticationRule> rules; |
| 496 |
| 497 Authentication(); |
| 498 |
| 499 Authentication.fromJson(core.Map _json) { |
| 500 if (_json.containsKey("providers")) { |
| 501 providers = _json["providers"].map((value) => new AuthProvider.fromJson(va
lue)).toList(); |
| 502 } |
| 503 if (_json.containsKey("rules")) { |
| 504 rules = _json["rules"].map((value) => new AuthenticationRule.fromJson(valu
e)).toList(); |
| 505 } |
| 506 } |
| 507 |
| 508 core.Map toJson() { |
| 509 var _json = new core.Map(); |
| 510 if (providers != null) { |
| 511 _json["providers"] = providers.map((value) => (value).toJson()).toList(); |
| 512 } |
| 513 if (rules != null) { |
| 514 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 515 } |
| 516 return _json; |
| 517 } |
| 518 } |
| 519 |
| 520 /** |
| 521 * Authentication rules for the service. |
| 522 * |
| 523 * By default, if a method has any authentication requirements, every request |
| 524 * must include a valid credential matching one of the requirements. |
| 525 * It's an error to include more than one kind of credential in a single |
| 526 * request. |
| 527 * |
| 528 * If a method doesn't have any auth requirements, request credentials will be |
| 529 * ignored. |
| 530 */ |
| 531 class AuthenticationRule { |
| 532 /** |
| 533 * Whether to allow requests without a credential. The credential can be |
| 534 * an OAuth token, Google cookies (first-party auth) or EndUserCreds. |
| 535 * |
| 536 * For requests without credentials, if the service control environment is |
| 537 * specified, each incoming request **must** be associated with a service |
| 538 * consumer. This can be done by passing an API key that belongs to a consumer |
| 539 * project. |
| 540 */ |
| 541 core.bool allowWithoutCredential; |
| 542 /** The requirements for OAuth credentials. */ |
| 543 OAuthRequirements oauth; |
| 544 /** Requirements for additional authentication providers. */ |
| 545 core.List<AuthRequirement> requirements; |
| 546 /** |
| 547 * Selects the methods to which this rule applies. |
| 548 * |
| 549 * Refer to selector for syntax details. |
| 550 */ |
| 551 core.String selector; |
| 552 |
| 553 AuthenticationRule(); |
| 554 |
| 555 AuthenticationRule.fromJson(core.Map _json) { |
| 556 if (_json.containsKey("allowWithoutCredential")) { |
| 557 allowWithoutCredential = _json["allowWithoutCredential"]; |
| 558 } |
| 559 if (_json.containsKey("oauth")) { |
| 560 oauth = new OAuthRequirements.fromJson(_json["oauth"]); |
| 561 } |
| 562 if (_json.containsKey("requirements")) { |
| 563 requirements = _json["requirements"].map((value) => new AuthRequirement.fr
omJson(value)).toList(); |
| 564 } |
| 565 if (_json.containsKey("selector")) { |
| 566 selector = _json["selector"]; |
| 567 } |
| 568 } |
| 569 |
| 570 core.Map toJson() { |
| 571 var _json = new core.Map(); |
| 572 if (allowWithoutCredential != null) { |
| 573 _json["allowWithoutCredential"] = allowWithoutCredential; |
| 574 } |
| 575 if (oauth != null) { |
| 576 _json["oauth"] = (oauth).toJson(); |
| 577 } |
| 578 if (requirements != null) { |
| 579 _json["requirements"] = requirements.map((value) => (value).toJson()).toLi
st(); |
| 580 } |
| 581 if (selector != null) { |
| 582 _json["selector"] = selector; |
| 583 } |
| 584 return _json; |
| 585 } |
| 586 } |
| 587 |
| 588 /** `Backend` defines the backend configuration for a service. */ |
| 589 class Backend { |
| 590 /** |
| 591 * A list of API backend rules that apply to individual API methods. |
| 592 * |
| 593 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 594 */ |
| 595 core.List<BackendRule> rules; |
| 596 |
| 597 Backend(); |
| 598 |
| 599 Backend.fromJson(core.Map _json) { |
| 600 if (_json.containsKey("rules")) { |
| 601 rules = _json["rules"].map((value) => new BackendRule.fromJson(value)).toL
ist(); |
| 602 } |
| 603 } |
| 604 |
| 605 core.Map toJson() { |
| 606 var _json = new core.Map(); |
| 607 if (rules != null) { |
| 608 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 609 } |
| 610 return _json; |
| 611 } |
| 612 } |
| 613 |
| 614 /** A backend rule provides configuration for an individual API element. */ |
| 615 class BackendRule { |
| 616 /** The address of the API backend. */ |
| 617 core.String address; |
| 618 /** |
| 619 * The number of seconds to wait for a response from a request. The |
| 620 * default depends on the deployment context. |
| 621 */ |
| 622 core.double deadline; |
| 623 /** |
| 624 * Selects the methods to which this rule applies. |
| 625 * |
| 626 * Refer to selector for syntax details. |
| 627 */ |
| 628 core.String selector; |
| 629 |
| 630 BackendRule(); |
| 631 |
| 632 BackendRule.fromJson(core.Map _json) { |
| 633 if (_json.containsKey("address")) { |
| 634 address = _json["address"]; |
| 635 } |
| 636 if (_json.containsKey("deadline")) { |
| 637 deadline = _json["deadline"]; |
| 638 } |
| 639 if (_json.containsKey("selector")) { |
| 640 selector = _json["selector"]; |
| 641 } |
| 642 } |
| 643 |
| 644 core.Map toJson() { |
| 645 var _json = new core.Map(); |
| 646 if (address != null) { |
| 647 _json["address"] = address; |
| 648 } |
| 649 if (deadline != null) { |
| 650 _json["deadline"] = deadline; |
| 651 } |
| 652 if (selector != null) { |
| 653 _json["selector"] = selector; |
| 654 } |
| 655 return _json; |
| 656 } |
| 657 } |
| 658 |
| 659 /** |
| 660 * `Context` defines which contexts an API requests. |
| 661 * |
| 662 * Example: |
| 663 * |
| 664 * context: |
| 665 * rules: |
| 666 * - selector: "*" |
| 667 * requested: |
| 668 * - google.rpc.context.ProjectContext |
| 669 * - google.rpc.context.OriginContext |
| 670 * |
| 671 * The above specifies that all methods in the API request |
| 672 * `google.rpc.context.ProjectContext` and |
| 673 * `google.rpc.context.OriginContext`. |
| 674 * |
| 675 * Available context types are defined in package |
| 676 * `google.rpc.context`. |
| 677 */ |
| 678 class Context { |
| 679 /** |
| 680 * A list of RPC context rules that apply to individual API methods. |
| 681 * |
| 682 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 683 */ |
| 684 core.List<ContextRule> rules; |
| 685 |
| 686 Context(); |
| 687 |
| 688 Context.fromJson(core.Map _json) { |
| 689 if (_json.containsKey("rules")) { |
| 690 rules = _json["rules"].map((value) => new ContextRule.fromJson(value)).toL
ist(); |
| 691 } |
| 692 } |
| 693 |
| 694 core.Map toJson() { |
| 695 var _json = new core.Map(); |
| 696 if (rules != null) { |
| 697 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 698 } |
| 699 return _json; |
| 700 } |
| 701 } |
| 702 |
| 703 /** |
| 704 * A context rule provides information about the context for an individual API |
| 705 * element. |
| 706 */ |
| 707 class ContextRule { |
| 708 /** A list of full type names of provided contexts. */ |
| 709 core.List<core.String> provided; |
| 710 /** A list of full type names of requested contexts. */ |
| 711 core.List<core.String> requested; |
| 712 /** |
| 713 * Selects the methods to which this rule applies. |
| 714 * |
| 715 * Refer to selector for syntax details. |
| 716 */ |
| 717 core.String selector; |
| 718 |
| 719 ContextRule(); |
| 720 |
| 721 ContextRule.fromJson(core.Map _json) { |
| 722 if (_json.containsKey("provided")) { |
| 723 provided = _json["provided"]; |
| 724 } |
| 725 if (_json.containsKey("requested")) { |
| 726 requested = _json["requested"]; |
| 727 } |
| 728 if (_json.containsKey("selector")) { |
| 729 selector = _json["selector"]; |
| 730 } |
| 731 } |
| 732 |
| 733 core.Map toJson() { |
| 734 var _json = new core.Map(); |
| 735 if (provided != null) { |
| 736 _json["provided"] = provided; |
| 737 } |
| 738 if (requested != null) { |
| 739 _json["requested"] = requested; |
| 740 } |
| 741 if (selector != null) { |
| 742 _json["selector"] = selector; |
| 743 } |
| 744 return _json; |
| 745 } |
| 746 } |
| 747 |
| 748 /** |
| 749 * Selects and configures the service controller used by the service. The |
| 750 * service controller handles features like abuse, quota, billing, logging, |
| 751 * monitoring, etc. |
| 752 */ |
| 753 class Control { |
| 754 /** |
| 755 * The service control environment to use. If empty, no control plane |
| 756 * feature (like quota and billing) will be enabled. |
| 757 */ |
| 758 core.String environment; |
| 759 |
| 760 Control(); |
| 761 |
| 762 Control.fromJson(core.Map _json) { |
| 763 if (_json.containsKey("environment")) { |
| 764 environment = _json["environment"]; |
| 765 } |
| 766 } |
| 767 |
| 768 core.Map toJson() { |
| 769 var _json = new core.Map(); |
| 770 if (environment != null) { |
| 771 _json["environment"] = environment; |
| 772 } |
| 773 return _json; |
| 774 } |
| 775 } |
| 776 |
| 777 /** |
| 778 * Customize service error responses. For example, list any service |
| 779 * specific protobuf types that can appear in error detail lists of |
| 780 * error responses. |
| 781 * |
| 782 * Example: |
| 783 * |
| 784 * custom_error: |
| 785 * types: |
| 786 * - google.foo.v1.CustomError |
| 787 * - google.foo.v1.AnotherError |
| 788 */ |
| 789 class CustomError { |
| 790 /** |
| 791 * The list of custom error rules that apply to individual API messages. |
| 792 * |
| 793 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 794 */ |
| 795 core.List<CustomErrorRule> rules; |
| 796 /** |
| 797 * The list of custom error detail types, e.g. 'google.foo.v1.CustomError'. |
| 798 */ |
| 799 core.List<core.String> types; |
| 800 |
| 801 CustomError(); |
| 802 |
| 803 CustomError.fromJson(core.Map _json) { |
| 804 if (_json.containsKey("rules")) { |
| 805 rules = _json["rules"].map((value) => new CustomErrorRule.fromJson(value))
.toList(); |
| 806 } |
| 807 if (_json.containsKey("types")) { |
| 808 types = _json["types"]; |
| 809 } |
| 810 } |
| 811 |
| 812 core.Map toJson() { |
| 813 var _json = new core.Map(); |
| 814 if (rules != null) { |
| 815 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 816 } |
| 817 if (types != null) { |
| 818 _json["types"] = types; |
| 819 } |
| 820 return _json; |
| 821 } |
| 822 } |
| 823 |
| 824 /** A custom error rule. */ |
| 825 class CustomErrorRule { |
| 826 /** |
| 827 * Mark this message as possible payload in error response. Otherwise, |
| 828 * objects of this type will be filtered when they appear in error payload. |
| 829 */ |
| 830 core.bool isErrorType; |
| 831 /** |
| 832 * Selects messages to which this rule applies. |
| 833 * |
| 834 * Refer to selector for syntax details. |
| 835 */ |
| 836 core.String selector; |
| 837 |
| 838 CustomErrorRule(); |
| 839 |
| 840 CustomErrorRule.fromJson(core.Map _json) { |
| 841 if (_json.containsKey("isErrorType")) { |
| 842 isErrorType = _json["isErrorType"]; |
| 843 } |
| 844 if (_json.containsKey("selector")) { |
| 845 selector = _json["selector"]; |
| 846 } |
| 847 } |
| 848 |
| 849 core.Map toJson() { |
| 850 var _json = new core.Map(); |
| 851 if (isErrorType != null) { |
| 852 _json["isErrorType"] = isErrorType; |
| 853 } |
| 854 if (selector != null) { |
| 855 _json["selector"] = selector; |
| 856 } |
| 857 return _json; |
| 858 } |
| 859 } |
| 860 |
| 861 /** A custom pattern is used for defining custom HTTP verb. */ |
| 862 class CustomHttpPattern { |
| 863 /** The name of this custom HTTP verb. */ |
| 864 core.String kind; |
| 865 /** The path matched by this custom verb. */ |
| 866 core.String path; |
| 867 |
| 868 CustomHttpPattern(); |
| 869 |
| 870 CustomHttpPattern.fromJson(core.Map _json) { |
| 871 if (_json.containsKey("kind")) { |
| 872 kind = _json["kind"]; |
| 873 } |
| 874 if (_json.containsKey("path")) { |
| 875 path = _json["path"]; |
| 876 } |
| 877 } |
| 878 |
| 879 core.Map toJson() { |
| 880 var _json = new core.Map(); |
| 881 if (kind != null) { |
| 882 _json["kind"] = kind; |
| 883 } |
| 884 if (path != null) { |
| 885 _json["path"] = path; |
| 886 } |
| 887 return _json; |
| 888 } |
| 889 } |
| 890 |
| 891 /** Request message for DisableService method. */ |
| 892 class DisableServiceRequest { |
| 893 |
| 894 DisableServiceRequest(); |
| 895 |
| 896 DisableServiceRequest.fromJson(core.Map _json) { |
| 897 } |
| 898 |
| 899 core.Map toJson() { |
| 900 var _json = new core.Map(); |
| 901 return _json; |
| 902 } |
| 903 } |
| 904 |
| 905 /** |
| 906 * `Documentation` provides the information for describing a service. |
| 907 * |
| 908 * Example: |
| 909 * <pre><code>documentation: |
| 910 * summary: > |
| 911 * The Google Calendar API gives access |
| 912 * to most calendar features. |
| 913 * pages: |
| 914 * - name: Overview |
| 915 * content: (== include google/foo/overview.md ==) |
| 916 * - name: Tutorial |
| 917 * content: (== include google/foo/tutorial.md ==) |
| 918 * subpages; |
| 919 * - name: Java |
| 920 * content: (== include google/foo/tutorial_java.md ==) |
| 921 * rules: |
| 922 * - selector: google.calendar.Calendar.Get |
| 923 * description: > |
| 924 * ... |
| 925 * - selector: google.calendar.Calendar.Put |
| 926 * description: > |
| 927 * ... |
| 928 * </code></pre> |
| 929 * Documentation is provided in markdown syntax. In addition to |
| 930 * standard markdown features, definition lists, tables and fenced |
| 931 * code blocks are supported. Section headers can be provided and are |
| 932 * interpreted relative to the section nesting of the context where |
| 933 * a documentation fragment is embedded. |
| 934 * |
| 935 * Documentation from the IDL is merged with documentation defined |
| 936 * via the config at normalization time, where documentation provided |
| 937 * by config rules overrides IDL provided. |
| 938 * |
| 939 * A number of constructs specific to the API platform are supported |
| 940 * in documentation text. |
| 941 * |
| 942 * In order to reference a proto element, the following |
| 943 * notation can be used: |
| 944 * <pre><code>[fully.qualified.proto.name][]</code></pre> |
| 945 * To override the display text used for the link, this can be used: |
| 946 * <pre><code>[display text][fully.qualified.proto.name]</code></pre> |
| 947 * Text can be excluded from doc using the following notation: |
| 948 * <pre><code>(-- internal comment --)</code></pre> |
| 949 * Comments can be made conditional using a visibility label. The below |
| 950 * text will be only rendered if the `BETA` label is available: |
| 951 * <pre><code>(--BETA: comment for BETA users --)</code></pre> |
| 952 * A few directives are available in documentation. Note that |
| 953 * directives must appear on a single line to be properly |
| 954 * identified. The `include` directive includes a markdown file from |
| 955 * an external source: |
| 956 * <pre><code>(== include path/to/file ==)</code></pre> |
| 957 * The `resource_for` directive marks a message to be the resource of |
| 958 * a collection in REST view. If it is not specified, tools attempt |
| 959 * to infer the resource from the operations in a collection: |
| 960 * <pre><code>(== resource_for v1.shelves.books ==)</code></pre> |
| 961 * The directive `suppress_warning` does not directly affect documentation |
| 962 * and is documented together with service config validation. |
| 963 */ |
| 964 class Documentation { |
| 965 /** The URL to the root of documentation. */ |
| 966 core.String documentationRootUrl; |
| 967 /** |
| 968 * Declares a single overview page. For example: |
| 969 * <pre><code>documentation: |
| 970 * summary: ... |
| 971 * overview: (== include overview.md ==) |
| 972 * </code></pre> |
| 973 * This is a shortcut for the following declaration (using pages style): |
| 974 * <pre><code>documentation: |
| 975 * summary: ... |
| 976 * pages: |
| 977 * - name: Overview |
| 978 * content: (== include overview.md ==) |
| 979 * </code></pre> |
| 980 * Note: you cannot specify both `overview` field and `pages` field. |
| 981 */ |
| 982 core.String overview; |
| 983 /** The top level pages for the documentation set. */ |
| 984 core.List<Page> pages; |
| 985 /** |
| 986 * A list of documentation rules that apply to individual API elements. |
| 987 * |
| 988 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 989 */ |
| 990 core.List<DocumentationRule> rules; |
| 991 /** |
| 992 * A short summary of what the service does. Can only be provided by |
| 993 * plain text. |
| 994 */ |
| 995 core.String summary; |
| 996 |
| 997 Documentation(); |
| 998 |
| 999 Documentation.fromJson(core.Map _json) { |
| 1000 if (_json.containsKey("documentationRootUrl")) { |
| 1001 documentationRootUrl = _json["documentationRootUrl"]; |
| 1002 } |
| 1003 if (_json.containsKey("overview")) { |
| 1004 overview = _json["overview"]; |
| 1005 } |
| 1006 if (_json.containsKey("pages")) { |
| 1007 pages = _json["pages"].map((value) => new Page.fromJson(value)).toList(); |
| 1008 } |
| 1009 if (_json.containsKey("rules")) { |
| 1010 rules = _json["rules"].map((value) => new DocumentationRule.fromJson(value
)).toList(); |
| 1011 } |
| 1012 if (_json.containsKey("summary")) { |
| 1013 summary = _json["summary"]; |
| 1014 } |
| 1015 } |
| 1016 |
| 1017 core.Map toJson() { |
| 1018 var _json = new core.Map(); |
| 1019 if (documentationRootUrl != null) { |
| 1020 _json["documentationRootUrl"] = documentationRootUrl; |
| 1021 } |
| 1022 if (overview != null) { |
| 1023 _json["overview"] = overview; |
| 1024 } |
| 1025 if (pages != null) { |
| 1026 _json["pages"] = pages.map((value) => (value).toJson()).toList(); |
| 1027 } |
| 1028 if (rules != null) { |
| 1029 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 1030 } |
| 1031 if (summary != null) { |
| 1032 _json["summary"] = summary; |
| 1033 } |
| 1034 return _json; |
| 1035 } |
| 1036 } |
| 1037 |
| 1038 /** A documentation rule provides information about individual API elements. */ |
| 1039 class DocumentationRule { |
| 1040 /** |
| 1041 * Deprecation description of the selected element(s). It can be provided if |
| 1042 * an |
| 1043 * element is marked as `deprecated`. |
| 1044 */ |
| 1045 core.String deprecationDescription; |
| 1046 /** Description of the selected API(s). */ |
| 1047 core.String description; |
| 1048 /** |
| 1049 * The selector is a comma-separated list of patterns. Each pattern is a |
| 1050 * qualified name of the element which may end in "*", indicating a wildcard. |
| 1051 * Wildcards are only allowed at the end and for a whole component of the |
| 1052 * qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". To |
| 1053 * specify a default for all applicable elements, the whole pattern "*" |
| 1054 * is used. |
| 1055 */ |
| 1056 core.String selector; |
| 1057 |
| 1058 DocumentationRule(); |
| 1059 |
| 1060 DocumentationRule.fromJson(core.Map _json) { |
| 1061 if (_json.containsKey("deprecationDescription")) { |
| 1062 deprecationDescription = _json["deprecationDescription"]; |
| 1063 } |
| 1064 if (_json.containsKey("description")) { |
| 1065 description = _json["description"]; |
| 1066 } |
| 1067 if (_json.containsKey("selector")) { |
| 1068 selector = _json["selector"]; |
| 1069 } |
| 1070 } |
| 1071 |
| 1072 core.Map toJson() { |
| 1073 var _json = new core.Map(); |
| 1074 if (deprecationDescription != null) { |
| 1075 _json["deprecationDescription"] = deprecationDescription; |
| 1076 } |
| 1077 if (description != null) { |
| 1078 _json["description"] = description; |
| 1079 } |
| 1080 if (selector != null) { |
| 1081 _json["selector"] = selector; |
| 1082 } |
| 1083 return _json; |
| 1084 } |
| 1085 } |
| 1086 |
| 1087 /** Request message for EnableService method. */ |
| 1088 class EnableServiceRequest { |
| 1089 |
| 1090 EnableServiceRequest(); |
| 1091 |
| 1092 EnableServiceRequest.fromJson(core.Map _json) { |
| 1093 } |
| 1094 |
| 1095 core.Map toJson() { |
| 1096 var _json = new core.Map(); |
| 1097 return _json; |
| 1098 } |
| 1099 } |
| 1100 |
| 1101 /** |
| 1102 * An EnabledService message contains the details about a service that has been |
| 1103 * enabled for use. |
| 1104 */ |
| 1105 class EnabledService { |
| 1106 /** |
| 1107 * The Service definition for the enabled service |
| 1108 * Only the name and title fields will be populated. |
| 1109 */ |
| 1110 Service service; |
| 1111 |
| 1112 EnabledService(); |
| 1113 |
| 1114 EnabledService.fromJson(core.Map _json) { |
| 1115 if (_json.containsKey("service")) { |
| 1116 service = new Service.fromJson(_json["service"]); |
| 1117 } |
| 1118 } |
| 1119 |
| 1120 core.Map toJson() { |
| 1121 var _json = new core.Map(); |
| 1122 if (service != null) { |
| 1123 _json["service"] = (service).toJson(); |
| 1124 } |
| 1125 return _json; |
| 1126 } |
| 1127 } |
| 1128 |
| 1129 /** |
| 1130 * `Endpoint` describes a network endpoint that serves a set of APIs. |
| 1131 * A service may expose any number of endpoints, and all endpoints share the |
| 1132 * same service configuration, such as quota configuration and monitoring |
| 1133 * configuration. |
| 1134 * |
| 1135 * Example service configuration: |
| 1136 * |
| 1137 * name: library-example.googleapis.com |
| 1138 * endpoints: |
| 1139 * # Below entry makes 'google.example.library.v1.Library' |
| 1140 * # API be served from endpoint address library-example.googleapis.com. |
| 1141 * # It also allows HTTP OPTIONS calls to be passed to the backend, for |
| 1142 * # it to decide whether the subsequent cross-origin request is |
| 1143 * # allowed to proceed. |
| 1144 * - name: library-example.googleapis.com |
| 1145 * allow_cors: true |
| 1146 */ |
| 1147 class Endpoint { |
| 1148 /** |
| 1149 * DEPRECATED: This field is no longer supported. Instead of using aliases, |
| 1150 * please specify multiple google.api.Endpoint for each of the intented |
| 1151 * alias. |
| 1152 * |
| 1153 * Additional names that this endpoint will be hosted on. |
| 1154 */ |
| 1155 core.List<core.String> aliases; |
| 1156 /** |
| 1157 * Allowing |
| 1158 * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka |
| 1159 * cross-domain traffic, would allow the backends served from this endpoint to |
| 1160 * receive and respond to HTTP OPTIONS requests. The response will be used by |
| 1161 * the browser to determine whether the subsequent cross-origin request is |
| 1162 * allowed to proceed. |
| 1163 */ |
| 1164 core.bool allowCors; |
| 1165 /** The list of APIs served by this endpoint. */ |
| 1166 core.List<core.String> apis; |
| 1167 /** The list of features enabled on this endpoint. */ |
| 1168 core.List<core.String> features; |
| 1169 /** The canonical name of this endpoint. */ |
| 1170 core.String name; |
| 1171 |
| 1172 Endpoint(); |
| 1173 |
| 1174 Endpoint.fromJson(core.Map _json) { |
| 1175 if (_json.containsKey("aliases")) { |
| 1176 aliases = _json["aliases"]; |
| 1177 } |
| 1178 if (_json.containsKey("allowCors")) { |
| 1179 allowCors = _json["allowCors"]; |
| 1180 } |
| 1181 if (_json.containsKey("apis")) { |
| 1182 apis = _json["apis"]; |
| 1183 } |
| 1184 if (_json.containsKey("features")) { |
| 1185 features = _json["features"]; |
| 1186 } |
| 1187 if (_json.containsKey("name")) { |
| 1188 name = _json["name"]; |
| 1189 } |
| 1190 } |
| 1191 |
| 1192 core.Map toJson() { |
| 1193 var _json = new core.Map(); |
| 1194 if (aliases != null) { |
| 1195 _json["aliases"] = aliases; |
| 1196 } |
| 1197 if (allowCors != null) { |
| 1198 _json["allowCors"] = allowCors; |
| 1199 } |
| 1200 if (apis != null) { |
| 1201 _json["apis"] = apis; |
| 1202 } |
| 1203 if (features != null) { |
| 1204 _json["features"] = features; |
| 1205 } |
| 1206 if (name != null) { |
| 1207 _json["name"] = name; |
| 1208 } |
| 1209 return _json; |
| 1210 } |
| 1211 } |
| 1212 |
| 1213 /** Enum type definition. */ |
| 1214 class Enum { |
| 1215 /** Enum value definitions. */ |
| 1216 core.List<EnumValue> enumvalue; |
| 1217 /** Enum type name. */ |
| 1218 core.String name; |
| 1219 /** Protocol buffer options. */ |
| 1220 core.List<Option> options; |
| 1221 /** The source context. */ |
| 1222 SourceContext sourceContext; |
| 1223 /** |
| 1224 * The source syntax. |
| 1225 * Possible string values are: |
| 1226 * - "SYNTAX_PROTO2" : Syntax `proto2`. |
| 1227 * - "SYNTAX_PROTO3" : Syntax `proto3`. |
| 1228 */ |
| 1229 core.String syntax; |
| 1230 |
| 1231 Enum(); |
| 1232 |
| 1233 Enum.fromJson(core.Map _json) { |
| 1234 if (_json.containsKey("enumvalue")) { |
| 1235 enumvalue = _json["enumvalue"].map((value) => new EnumValue.fromJson(value
)).toList(); |
| 1236 } |
| 1237 if (_json.containsKey("name")) { |
| 1238 name = _json["name"]; |
| 1239 } |
| 1240 if (_json.containsKey("options")) { |
| 1241 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 1242 } |
| 1243 if (_json.containsKey("sourceContext")) { |
| 1244 sourceContext = new SourceContext.fromJson(_json["sourceContext"]); |
| 1245 } |
| 1246 if (_json.containsKey("syntax")) { |
| 1247 syntax = _json["syntax"]; |
| 1248 } |
| 1249 } |
| 1250 |
| 1251 core.Map toJson() { |
| 1252 var _json = new core.Map(); |
| 1253 if (enumvalue != null) { |
| 1254 _json["enumvalue"] = enumvalue.map((value) => (value).toJson()).toList(); |
| 1255 } |
| 1256 if (name != null) { |
| 1257 _json["name"] = name; |
| 1258 } |
| 1259 if (options != null) { |
| 1260 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 1261 } |
| 1262 if (sourceContext != null) { |
| 1263 _json["sourceContext"] = (sourceContext).toJson(); |
| 1264 } |
| 1265 if (syntax != null) { |
| 1266 _json["syntax"] = syntax; |
| 1267 } |
| 1268 return _json; |
| 1269 } |
| 1270 } |
| 1271 |
| 1272 /** Enum value definition. */ |
| 1273 class EnumValue { |
| 1274 /** Enum value name. */ |
| 1275 core.String name; |
| 1276 /** Enum value number. */ |
| 1277 core.int number; |
| 1278 /** Protocol buffer options. */ |
| 1279 core.List<Option> options; |
| 1280 |
| 1281 EnumValue(); |
| 1282 |
| 1283 EnumValue.fromJson(core.Map _json) { |
| 1284 if (_json.containsKey("name")) { |
| 1285 name = _json["name"]; |
| 1286 } |
| 1287 if (_json.containsKey("number")) { |
| 1288 number = _json["number"]; |
| 1289 } |
| 1290 if (_json.containsKey("options")) { |
| 1291 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 1292 } |
| 1293 } |
| 1294 |
| 1295 core.Map toJson() { |
| 1296 var _json = new core.Map(); |
| 1297 if (name != null) { |
| 1298 _json["name"] = name; |
| 1299 } |
| 1300 if (number != null) { |
| 1301 _json["number"] = number; |
| 1302 } |
| 1303 if (options != null) { |
| 1304 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 1305 } |
| 1306 return _json; |
| 1307 } |
| 1308 } |
| 1309 |
| 1310 /** A single field of a message type. */ |
| 1311 class Field { |
| 1312 /** |
| 1313 * The field cardinality. |
| 1314 * Possible string values are: |
| 1315 * - "CARDINALITY_UNKNOWN" : For fields with unknown cardinality. |
| 1316 * - "CARDINALITY_OPTIONAL" : For optional fields. |
| 1317 * - "CARDINALITY_REQUIRED" : For required fields. Proto2 syntax only. |
| 1318 * - "CARDINALITY_REPEATED" : For repeated fields. |
| 1319 */ |
| 1320 core.String cardinality; |
| 1321 /** |
| 1322 * The string value of the default value of this field. Proto2 syntax only. |
| 1323 */ |
| 1324 core.String defaultValue; |
| 1325 /** The field JSON name. */ |
| 1326 core.String jsonName; |
| 1327 /** |
| 1328 * The field type. |
| 1329 * Possible string values are: |
| 1330 * - "TYPE_UNKNOWN" : Field type unknown. |
| 1331 * - "TYPE_DOUBLE" : Field type double. |
| 1332 * - "TYPE_FLOAT" : Field type float. |
| 1333 * - "TYPE_INT64" : Field type int64. |
| 1334 * - "TYPE_UINT64" : Field type uint64. |
| 1335 * - "TYPE_INT32" : Field type int32. |
| 1336 * - "TYPE_FIXED64" : Field type fixed64. |
| 1337 * - "TYPE_FIXED32" : Field type fixed32. |
| 1338 * - "TYPE_BOOL" : Field type bool. |
| 1339 * - "TYPE_STRING" : Field type string. |
| 1340 * - "TYPE_GROUP" : Field type group. Proto2 syntax only, and deprecated. |
| 1341 * - "TYPE_MESSAGE" : Field type message. |
| 1342 * - "TYPE_BYTES" : Field type bytes. |
| 1343 * - "TYPE_UINT32" : Field type uint32. |
| 1344 * - "TYPE_ENUM" : Field type enum. |
| 1345 * - "TYPE_SFIXED32" : Field type sfixed32. |
| 1346 * - "TYPE_SFIXED64" : Field type sfixed64. |
| 1347 * - "TYPE_SINT32" : Field type sint32. |
| 1348 * - "TYPE_SINT64" : Field type sint64. |
| 1349 */ |
| 1350 core.String kind; |
| 1351 /** The field name. */ |
| 1352 core.String name; |
| 1353 /** The field number. */ |
| 1354 core.int number; |
| 1355 /** |
| 1356 * The index of the field type in `Type.oneofs`, for message or enumeration |
| 1357 * types. The first type has index 1; zero means the type is not in the list. |
| 1358 */ |
| 1359 core.int oneofIndex; |
| 1360 /** The protocol buffer options. */ |
| 1361 core.List<Option> options; |
| 1362 /** Whether to use alternative packed wire representation. */ |
| 1363 core.bool packed; |
| 1364 /** |
| 1365 * The field type URL, without the scheme, for message or enumeration |
| 1366 * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. |
| 1367 */ |
| 1368 core.String typeUrl; |
| 1369 |
| 1370 Field(); |
| 1371 |
| 1372 Field.fromJson(core.Map _json) { |
| 1373 if (_json.containsKey("cardinality")) { |
| 1374 cardinality = _json["cardinality"]; |
| 1375 } |
| 1376 if (_json.containsKey("defaultValue")) { |
| 1377 defaultValue = _json["defaultValue"]; |
| 1378 } |
| 1379 if (_json.containsKey("jsonName")) { |
| 1380 jsonName = _json["jsonName"]; |
| 1381 } |
| 1382 if (_json.containsKey("kind")) { |
| 1383 kind = _json["kind"]; |
| 1384 } |
| 1385 if (_json.containsKey("name")) { |
| 1386 name = _json["name"]; |
| 1387 } |
| 1388 if (_json.containsKey("number")) { |
| 1389 number = _json["number"]; |
| 1390 } |
| 1391 if (_json.containsKey("oneofIndex")) { |
| 1392 oneofIndex = _json["oneofIndex"]; |
| 1393 } |
| 1394 if (_json.containsKey("options")) { |
| 1395 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 1396 } |
| 1397 if (_json.containsKey("packed")) { |
| 1398 packed = _json["packed"]; |
| 1399 } |
| 1400 if (_json.containsKey("typeUrl")) { |
| 1401 typeUrl = _json["typeUrl"]; |
| 1402 } |
| 1403 } |
| 1404 |
| 1405 core.Map toJson() { |
| 1406 var _json = new core.Map(); |
| 1407 if (cardinality != null) { |
| 1408 _json["cardinality"] = cardinality; |
| 1409 } |
| 1410 if (defaultValue != null) { |
| 1411 _json["defaultValue"] = defaultValue; |
| 1412 } |
| 1413 if (jsonName != null) { |
| 1414 _json["jsonName"] = jsonName; |
| 1415 } |
| 1416 if (kind != null) { |
| 1417 _json["kind"] = kind; |
| 1418 } |
| 1419 if (name != null) { |
| 1420 _json["name"] = name; |
| 1421 } |
| 1422 if (number != null) { |
| 1423 _json["number"] = number; |
| 1424 } |
| 1425 if (oneofIndex != null) { |
| 1426 _json["oneofIndex"] = oneofIndex; |
| 1427 } |
| 1428 if (options != null) { |
| 1429 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 1430 } |
| 1431 if (packed != null) { |
| 1432 _json["packed"] = packed; |
| 1433 } |
| 1434 if (typeUrl != null) { |
| 1435 _json["typeUrl"] = typeUrl; |
| 1436 } |
| 1437 return _json; |
| 1438 } |
| 1439 } |
| 1440 |
| 1441 /** |
| 1442 * Defines the HTTP configuration for a service. It contains a list of |
| 1443 * HttpRule, each specifying the mapping of an RPC method |
| 1444 * to one or more HTTP REST API methods. |
| 1445 */ |
| 1446 class Http { |
| 1447 /** |
| 1448 * A list of HTTP configuration rules that apply to individual API methods. |
| 1449 * |
| 1450 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 1451 */ |
| 1452 core.List<HttpRule> rules; |
| 1453 |
| 1454 Http(); |
| 1455 |
| 1456 Http.fromJson(core.Map _json) { |
| 1457 if (_json.containsKey("rules")) { |
| 1458 rules = _json["rules"].map((value) => new HttpRule.fromJson(value)).toList
(); |
| 1459 } |
| 1460 } |
| 1461 |
| 1462 core.Map toJson() { |
| 1463 var _json = new core.Map(); |
| 1464 if (rules != null) { |
| 1465 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 1466 } |
| 1467 return _json; |
| 1468 } |
| 1469 } |
| 1470 |
| 1471 /** |
| 1472 * `HttpRule` defines the mapping of an RPC method to one or more HTTP |
| 1473 * REST APIs. The mapping determines what portions of the request |
| 1474 * message are populated from the path, query parameters, or body of |
| 1475 * the HTTP request. The mapping is typically specified as an |
| 1476 * `google.api.http` annotation, see "google/api/annotations.proto" |
| 1477 * for details. |
| 1478 * |
| 1479 * The mapping consists of a field specifying the path template and |
| 1480 * method kind. The path template can refer to fields in the request |
| 1481 * message, as in the example below which describes a REST GET |
| 1482 * operation on a resource collection of messages: |
| 1483 * |
| 1484 * |
| 1485 * service Messaging { |
| 1486 * rpc GetMessage(GetMessageRequest) returns (Message) { |
| 1487 * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; |
| 1488 * } |
| 1489 * } |
| 1490 * message GetMessageRequest { |
| 1491 * message SubMessage { |
| 1492 * string subfield = 1; |
| 1493 * } |
| 1494 * string message_id = 1; // mapped to the URL |
| 1495 * SubMessage sub = 2; // `sub.subfield` is url-mapped |
| 1496 * } |
| 1497 * message Message { |
| 1498 * string text = 1; // content of the resource |
| 1499 * } |
| 1500 * |
| 1501 * The same http annotation can alternatively be expressed inside the |
| 1502 * `GRPC API Configuration` YAML file. |
| 1503 * |
| 1504 * http: |
| 1505 * rules: |
| 1506 * - selector: <proto_package_name>.Messaging.GetMessage |
| 1507 * get: /v1/messages/{message_id}/{sub.subfield} |
| 1508 * |
| 1509 * This definition enables an automatic, bidrectional mapping of HTTP |
| 1510 * JSON to RPC. Example: |
| 1511 * |
| 1512 * HTTP | RPC |
| 1513 * -----|----- |
| 1514 * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: |
| 1515 * SubMessage(subfield: "foo"))` |
| 1516 * |
| 1517 * In general, not only fields but also field paths can be referenced |
| 1518 * from a path pattern. Fields mapped to the path pattern cannot be |
| 1519 * repeated and must have a primitive (non-message) type. |
| 1520 * |
| 1521 * Any fields in the request message which are not bound by the path |
| 1522 * pattern automatically become (optional) HTTP query |
| 1523 * parameters. Assume the following definition of the request message: |
| 1524 * |
| 1525 * |
| 1526 * message GetMessageRequest { |
| 1527 * message SubMessage { |
| 1528 * string subfield = 1; |
| 1529 * } |
| 1530 * string message_id = 1; // mapped to the URL |
| 1531 * int64 revision = 2; // becomes a parameter |
| 1532 * SubMessage sub = 3; // `sub.subfield` becomes a parameter |
| 1533 * } |
| 1534 * |
| 1535 * |
| 1536 * This enables a HTTP JSON to RPC mapping as below: |
| 1537 * |
| 1538 * HTTP | RPC |
| 1539 * -----|----- |
| 1540 * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | |
| 1541 * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: |
| 1542 * "foo"))` |
| 1543 * |
| 1544 * Note that fields which are mapped to HTTP parameters must have a |
| 1545 * primitive type or a repeated primitive type. Message types are not |
| 1546 * allowed. In the case of a repeated type, the parameter can be |
| 1547 * repeated in the URL, as in `...?param=A¶m=B`. |
| 1548 * |
| 1549 * For HTTP method kinds which allow a request body, the `body` field |
| 1550 * specifies the mapping. Consider a REST update method on the |
| 1551 * message resource collection: |
| 1552 * |
| 1553 * |
| 1554 * service Messaging { |
| 1555 * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { |
| 1556 * option (google.api.http) = { |
| 1557 * put: "/v1/messages/{message_id}" |
| 1558 * body: "message" |
| 1559 * }; |
| 1560 * } |
| 1561 * } |
| 1562 * message UpdateMessageRequest { |
| 1563 * string message_id = 1; // mapped to the URL |
| 1564 * Message message = 2; // mapped to the body |
| 1565 * } |
| 1566 * |
| 1567 * |
| 1568 * The following HTTP JSON to RPC mapping is enabled, where the |
| 1569 * representation of the JSON in the request body is determined by |
| 1570 * protos JSON encoding: |
| 1571 * |
| 1572 * HTTP | RPC |
| 1573 * -----|----- |
| 1574 * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: |
| 1575 * "123456" message { text: "Hi!" })` |
| 1576 * |
| 1577 * The special name `*` can be used in the body mapping to define that |
| 1578 * every field not bound by the path template should be mapped to the |
| 1579 * request body. This enables the following alternative definition of |
| 1580 * the update method: |
| 1581 * |
| 1582 * service Messaging { |
| 1583 * rpc UpdateMessage(Message) returns (Message) { |
| 1584 * option (google.api.http) = { |
| 1585 * put: "/v1/messages/{message_id}" |
| 1586 * body: "*" |
| 1587 * }; |
| 1588 * } |
| 1589 * } |
| 1590 * message Message { |
| 1591 * string message_id = 1; |
| 1592 * string text = 2; |
| 1593 * } |
| 1594 * |
| 1595 * |
| 1596 * The following HTTP JSON to RPC mapping is enabled: |
| 1597 * |
| 1598 * HTTP | RPC |
| 1599 * -----|----- |
| 1600 * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: |
| 1601 * "123456" text: "Hi!")` |
| 1602 * |
| 1603 * Note that when using `*` in the body mapping, it is not possible to |
| 1604 * have HTTP parameters, as all fields not bound by the path end in |
| 1605 * the body. This makes this option more rarely used in practice of |
| 1606 * defining REST APIs. The common usage of `*` is in custom methods |
| 1607 * which don't use the URL at all for transferring data. |
| 1608 * |
| 1609 * It is possible to define multiple HTTP methods for one RPC by using |
| 1610 * the `additional_bindings` option. Example: |
| 1611 * |
| 1612 * service Messaging { |
| 1613 * rpc GetMessage(GetMessageRequest) returns (Message) { |
| 1614 * option (google.api.http) = { |
| 1615 * get: "/v1/messages/{message_id}" |
| 1616 * additional_bindings { |
| 1617 * get: "/v1/users/{user_id}/messages/{message_id}" |
| 1618 * } |
| 1619 * }; |
| 1620 * } |
| 1621 * } |
| 1622 * message GetMessageRequest { |
| 1623 * string message_id = 1; |
| 1624 * string user_id = 2; |
| 1625 * } |
| 1626 * |
| 1627 * |
| 1628 * This enables the following two alternative HTTP JSON to RPC |
| 1629 * mappings: |
| 1630 * |
| 1631 * HTTP | RPC |
| 1632 * -----|----- |
| 1633 * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` |
| 1634 * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: |
| 1635 * "123456")` |
| 1636 * |
| 1637 * # Rules for HTTP mapping |
| 1638 * |
| 1639 * The rules for mapping HTTP path, query parameters, and body fields |
| 1640 * to the request message are as follows: |
| 1641 * |
| 1642 * 1. The `body` field specifies either `*` or a field path, or is |
| 1643 * omitted. If omitted, it assumes there is no HTTP body. |
| 1644 * 2. Leaf fields (recursive expansion of nested messages in the |
| 1645 * request) can be classified into three types: |
| 1646 * (a) Matched in the URL template. |
| 1647 * (b) Covered by body (if body is `*`, everything except (a) fields; |
| 1648 * else everything under the body field) |
| 1649 * (c) All other fields. |
| 1650 * 3. URL query parameters found in the HTTP request are mapped to (c) fields. |
| 1651 * 4. Any body sent with an HTTP request can contain only (b) fields. |
| 1652 * |
| 1653 * The syntax of the path template is as follows: |
| 1654 * |
| 1655 * Template = "/" Segments [ Verb ] ; |
| 1656 * Segments = Segment { "/" Segment } ; |
| 1657 * Segment = "*" | "**" | LITERAL | Variable ; |
| 1658 * Variable = "{" FieldPath [ "=" Segments ] "}" ; |
| 1659 * FieldPath = IDENT { "." IDENT } ; |
| 1660 * Verb = ":" LITERAL ; |
| 1661 * |
| 1662 * The syntax `*` matches a single path segment. It follows the semantics of |
| 1663 * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String |
| 1664 * Expansion. |
| 1665 * |
| 1666 * The syntax `**` matches zero or more path segments. It follows the semantics |
| 1667 * of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved |
| 1668 * Expansion. NOTE: it must be the last segment in the path except the Verb. |
| 1669 * |
| 1670 * The syntax `LITERAL` matches literal text in the URL path. |
| 1671 * |
| 1672 * The syntax `Variable` matches the entire path as specified by its template; |
| 1673 * this nested template must not contain further variables. If a variable |
| 1674 * matches a single path segment, its template may be omitted, e.g. `{var}` |
| 1675 * is equivalent to `{var=*}`. |
| 1676 * |
| 1677 * NOTE: the field paths in variables and in the `body` must not refer to |
| 1678 * repeated fields or map fields. |
| 1679 * |
| 1680 * Use CustomHttpPattern to specify any HTTP method that is not included in the |
| 1681 * `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified |
| 1682 * for |
| 1683 * a given URL path rule. The wild-card rule is useful for services that provide |
| 1684 * content to Web (HTML) clients. |
| 1685 */ |
| 1686 class HttpRule { |
| 1687 /** |
| 1688 * Additional HTTP bindings for the selector. Nested bindings must |
| 1689 * not contain an `additional_bindings` field themselves (that is, |
| 1690 * the nesting may only be one level deep). |
| 1691 */ |
| 1692 core.List<HttpRule> additionalBindings; |
| 1693 /** |
| 1694 * The name of the request field whose value is mapped to the HTTP body, or |
| 1695 * `*` for mapping all fields not captured by the path pattern to the HTTP |
| 1696 * body. NOTE: the referred field must not be a repeated field and must be |
| 1697 * present at the top-level of request message type. |
| 1698 */ |
| 1699 core.String body; |
| 1700 /** Custom pattern is used for defining custom verbs. */ |
| 1701 CustomHttpPattern custom; |
| 1702 /** Used for deleting a resource. */ |
| 1703 core.String delete; |
| 1704 /** Used for listing and getting information about resources. */ |
| 1705 core.String get; |
| 1706 /** |
| 1707 * Do not use this. For media support, add instead |
| 1708 * [][google.bytestream.RestByteStream] as an API to your |
| 1709 * configuration. |
| 1710 */ |
| 1711 MediaDownload mediaDownload; |
| 1712 /** |
| 1713 * Do not use this. For media support, add instead |
| 1714 * [][google.bytestream.RestByteStream] as an API to your |
| 1715 * configuration. |
| 1716 */ |
| 1717 MediaUpload mediaUpload; |
| 1718 /** Used for updating a resource. */ |
| 1719 core.String patch; |
| 1720 /** Used for creating a resource. */ |
| 1721 core.String post; |
| 1722 /** Used for updating a resource. */ |
| 1723 core.String put; |
| 1724 /** |
| 1725 * The name of the response field whose value is mapped to the HTTP body of |
| 1726 * response. Other response fields are ignored. This field is optional. When |
| 1727 * not set, the response message will be used as HTTP body of response. |
| 1728 * NOTE: the referred field must be not a repeated field and must be present |
| 1729 * at the top-level of response message type. |
| 1730 */ |
| 1731 core.String responseBody; |
| 1732 /** |
| 1733 * Selects methods to which this rule applies. |
| 1734 * |
| 1735 * Refer to selector for syntax details. |
| 1736 */ |
| 1737 core.String selector; |
| 1738 |
| 1739 HttpRule(); |
| 1740 |
| 1741 HttpRule.fromJson(core.Map _json) { |
| 1742 if (_json.containsKey("additionalBindings")) { |
| 1743 additionalBindings = _json["additionalBindings"].map((value) => new HttpRu
le.fromJson(value)).toList(); |
| 1744 } |
| 1745 if (_json.containsKey("body")) { |
| 1746 body = _json["body"]; |
| 1747 } |
| 1748 if (_json.containsKey("custom")) { |
| 1749 custom = new CustomHttpPattern.fromJson(_json["custom"]); |
| 1750 } |
| 1751 if (_json.containsKey("delete")) { |
| 1752 delete = _json["delete"]; |
| 1753 } |
| 1754 if (_json.containsKey("get")) { |
| 1755 get = _json["get"]; |
| 1756 } |
| 1757 if (_json.containsKey("mediaDownload")) { |
| 1758 mediaDownload = new MediaDownload.fromJson(_json["mediaDownload"]); |
| 1759 } |
| 1760 if (_json.containsKey("mediaUpload")) { |
| 1761 mediaUpload = new MediaUpload.fromJson(_json["mediaUpload"]); |
| 1762 } |
| 1763 if (_json.containsKey("patch")) { |
| 1764 patch = _json["patch"]; |
| 1765 } |
| 1766 if (_json.containsKey("post")) { |
| 1767 post = _json["post"]; |
| 1768 } |
| 1769 if (_json.containsKey("put")) { |
| 1770 put = _json["put"]; |
| 1771 } |
| 1772 if (_json.containsKey("responseBody")) { |
| 1773 responseBody = _json["responseBody"]; |
| 1774 } |
| 1775 if (_json.containsKey("selector")) { |
| 1776 selector = _json["selector"]; |
| 1777 } |
| 1778 } |
| 1779 |
| 1780 core.Map toJson() { |
| 1781 var _json = new core.Map(); |
| 1782 if (additionalBindings != null) { |
| 1783 _json["additionalBindings"] = additionalBindings.map((value) => (value).to
Json()).toList(); |
| 1784 } |
| 1785 if (body != null) { |
| 1786 _json["body"] = body; |
| 1787 } |
| 1788 if (custom != null) { |
| 1789 _json["custom"] = (custom).toJson(); |
| 1790 } |
| 1791 if (delete != null) { |
| 1792 _json["delete"] = delete; |
| 1793 } |
| 1794 if (get != null) { |
| 1795 _json["get"] = get; |
| 1796 } |
| 1797 if (mediaDownload != null) { |
| 1798 _json["mediaDownload"] = (mediaDownload).toJson(); |
| 1799 } |
| 1800 if (mediaUpload != null) { |
| 1801 _json["mediaUpload"] = (mediaUpload).toJson(); |
| 1802 } |
| 1803 if (patch != null) { |
| 1804 _json["patch"] = patch; |
| 1805 } |
| 1806 if (post != null) { |
| 1807 _json["post"] = post; |
| 1808 } |
| 1809 if (put != null) { |
| 1810 _json["put"] = put; |
| 1811 } |
| 1812 if (responseBody != null) { |
| 1813 _json["responseBody"] = responseBody; |
| 1814 } |
| 1815 if (selector != null) { |
| 1816 _json["selector"] = selector; |
| 1817 } |
| 1818 return _json; |
| 1819 } |
| 1820 } |
| 1821 |
| 1822 /** A description of a label. */ |
| 1823 class LabelDescriptor { |
| 1824 /** A human-readable description for the label. */ |
| 1825 core.String description; |
| 1826 /** The label key. */ |
| 1827 core.String key; |
| 1828 /** |
| 1829 * The type of data that can be assigned to the label. |
| 1830 * Possible string values are: |
| 1831 * - "STRING" : A variable-length string. This is the default. |
| 1832 * - "BOOL" : Boolean; true or false. |
| 1833 * - "INT64" : A 64-bit signed integer. |
| 1834 */ |
| 1835 core.String valueType; |
| 1836 |
| 1837 LabelDescriptor(); |
| 1838 |
| 1839 LabelDescriptor.fromJson(core.Map _json) { |
| 1840 if (_json.containsKey("description")) { |
| 1841 description = _json["description"]; |
| 1842 } |
| 1843 if (_json.containsKey("key")) { |
| 1844 key = _json["key"]; |
| 1845 } |
| 1846 if (_json.containsKey("valueType")) { |
| 1847 valueType = _json["valueType"]; |
| 1848 } |
| 1849 } |
| 1850 |
| 1851 core.Map toJson() { |
| 1852 var _json = new core.Map(); |
| 1853 if (description != null) { |
| 1854 _json["description"] = description; |
| 1855 } |
| 1856 if (key != null) { |
| 1857 _json["key"] = key; |
| 1858 } |
| 1859 if (valueType != null) { |
| 1860 _json["valueType"] = valueType; |
| 1861 } |
| 1862 return _json; |
| 1863 } |
| 1864 } |
| 1865 |
| 1866 /** Response message for `ListEnabledServices` method. */ |
| 1867 class ListEnabledServicesResponse { |
| 1868 /** |
| 1869 * Token that can be passed to `ListEnabledServices` to resume a paginated |
| 1870 * query. |
| 1871 */ |
| 1872 core.String nextPageToken; |
| 1873 /** Services enabled for the specified parent. */ |
| 1874 core.List<EnabledService> services; |
| 1875 |
| 1876 ListEnabledServicesResponse(); |
| 1877 |
| 1878 ListEnabledServicesResponse.fromJson(core.Map _json) { |
| 1879 if (_json.containsKey("nextPageToken")) { |
| 1880 nextPageToken = _json["nextPageToken"]; |
| 1881 } |
| 1882 if (_json.containsKey("services")) { |
| 1883 services = _json["services"].map((value) => new EnabledService.fromJson(va
lue)).toList(); |
| 1884 } |
| 1885 } |
| 1886 |
| 1887 core.Map toJson() { |
| 1888 var _json = new core.Map(); |
| 1889 if (nextPageToken != null) { |
| 1890 _json["nextPageToken"] = nextPageToken; |
| 1891 } |
| 1892 if (services != null) { |
| 1893 _json["services"] = services.map((value) => (value).toJson()).toList(); |
| 1894 } |
| 1895 return _json; |
| 1896 } |
| 1897 } |
| 1898 |
| 1899 /** |
| 1900 * A description of a log type. Example in YAML format: |
| 1901 * |
| 1902 * - name: library.googleapis.com/activity_history |
| 1903 * description: The history of borrowing and returning library items. |
| 1904 * display_name: Activity |
| 1905 * labels: |
| 1906 * - key: /customer_id |
| 1907 * description: Identifier of a library customer |
| 1908 */ |
| 1909 class LogDescriptor { |
| 1910 /** |
| 1911 * A human-readable description of this log. This information appears in |
| 1912 * the documentation and can contain details. |
| 1913 */ |
| 1914 core.String description; |
| 1915 /** |
| 1916 * The human-readable name for this log. This information appears on |
| 1917 * the user interface and should be concise. |
| 1918 */ |
| 1919 core.String displayName; |
| 1920 /** |
| 1921 * The set of labels that are available to describe a specific log entry. |
| 1922 * Runtime requests that contain labels not specified here are |
| 1923 * considered invalid. |
| 1924 */ |
| 1925 core.List<LabelDescriptor> labels; |
| 1926 /** |
| 1927 * The name of the log. It must be less than 512 characters long and can |
| 1928 * include the following characters: upper- and lower-case alphanumeric |
| 1929 * characters [A-Za-z0-9], and punctuation characters including |
| 1930 * slash, underscore, hyphen, period [/_-.]. |
| 1931 */ |
| 1932 core.String name; |
| 1933 |
| 1934 LogDescriptor(); |
| 1935 |
| 1936 LogDescriptor.fromJson(core.Map _json) { |
| 1937 if (_json.containsKey("description")) { |
| 1938 description = _json["description"]; |
| 1939 } |
| 1940 if (_json.containsKey("displayName")) { |
| 1941 displayName = _json["displayName"]; |
| 1942 } |
| 1943 if (_json.containsKey("labels")) { |
| 1944 labels = _json["labels"].map((value) => new LabelDescriptor.fromJson(value
)).toList(); |
| 1945 } |
| 1946 if (_json.containsKey("name")) { |
| 1947 name = _json["name"]; |
| 1948 } |
| 1949 } |
| 1950 |
| 1951 core.Map toJson() { |
| 1952 var _json = new core.Map(); |
| 1953 if (description != null) { |
| 1954 _json["description"] = description; |
| 1955 } |
| 1956 if (displayName != null) { |
| 1957 _json["displayName"] = displayName; |
| 1958 } |
| 1959 if (labels != null) { |
| 1960 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 1961 } |
| 1962 if (name != null) { |
| 1963 _json["name"] = name; |
| 1964 } |
| 1965 return _json; |
| 1966 } |
| 1967 } |
| 1968 |
| 1969 /** |
| 1970 * Logging configuration of the service. |
| 1971 * |
| 1972 * The following example shows how to configure logs to be sent to the |
| 1973 * producer and consumer projects. In the example, the `activity_history` |
| 1974 * log is sent to both the producer and consumer projects, whereas the |
| 1975 * `purchase_history` log is only sent to the producer project. |
| 1976 * |
| 1977 * monitored_resources: |
| 1978 * - type: library.googleapis.com/branch |
| 1979 * labels: |
| 1980 * - key: /city |
| 1981 * description: The city where the library branch is located in. |
| 1982 * - key: /name |
| 1983 * description: The name of the branch. |
| 1984 * logs: |
| 1985 * - name: activity_history |
| 1986 * labels: |
| 1987 * - key: /customer_id |
| 1988 * - name: purchase_history |
| 1989 * logging: |
| 1990 * producer_destinations: |
| 1991 * - monitored_resource: library.googleapis.com/branch |
| 1992 * logs: |
| 1993 * - activity_history |
| 1994 * - purchase_history |
| 1995 * consumer_destinations: |
| 1996 * - monitored_resource: library.googleapis.com/branch |
| 1997 * logs: |
| 1998 * - activity_history |
| 1999 */ |
| 2000 class Logging { |
| 2001 /** |
| 2002 * Logging configurations for sending logs to the consumer project. |
| 2003 * There can be multiple consumer destinations, each one must have a |
| 2004 * different monitored resource type. A log can be used in at most |
| 2005 * one consumer destination. |
| 2006 */ |
| 2007 core.List<LoggingDestination> consumerDestinations; |
| 2008 /** |
| 2009 * Logging configurations for sending logs to the producer project. |
| 2010 * There can be multiple producer destinations, each one must have a |
| 2011 * different monitored resource type. A log can be used in at most |
| 2012 * one producer destination. |
| 2013 */ |
| 2014 core.List<LoggingDestination> producerDestinations; |
| 2015 |
| 2016 Logging(); |
| 2017 |
| 2018 Logging.fromJson(core.Map _json) { |
| 2019 if (_json.containsKey("consumerDestinations")) { |
| 2020 consumerDestinations = _json["consumerDestinations"].map((value) => new Lo
ggingDestination.fromJson(value)).toList(); |
| 2021 } |
| 2022 if (_json.containsKey("producerDestinations")) { |
| 2023 producerDestinations = _json["producerDestinations"].map((value) => new Lo
ggingDestination.fromJson(value)).toList(); |
| 2024 } |
| 2025 } |
| 2026 |
| 2027 core.Map toJson() { |
| 2028 var _json = new core.Map(); |
| 2029 if (consumerDestinations != null) { |
| 2030 _json["consumerDestinations"] = consumerDestinations.map((value) => (value
).toJson()).toList(); |
| 2031 } |
| 2032 if (producerDestinations != null) { |
| 2033 _json["producerDestinations"] = producerDestinations.map((value) => (value
).toJson()).toList(); |
| 2034 } |
| 2035 return _json; |
| 2036 } |
| 2037 } |
| 2038 |
| 2039 /** |
| 2040 * Configuration of a specific logging destination (the producer project |
| 2041 * or the consumer project). |
| 2042 */ |
| 2043 class LoggingDestination { |
| 2044 /** |
| 2045 * Names of the logs to be sent to this destination. Each name must |
| 2046 * be defined in the Service.logs section. If the log name is |
| 2047 * not a domain scoped name, it will be automatically prefixed with |
| 2048 * the service name followed by "/". |
| 2049 */ |
| 2050 core.List<core.String> logs; |
| 2051 /** |
| 2052 * The monitored resource type. The type must be defined in the |
| 2053 * Service.monitored_resources section. |
| 2054 */ |
| 2055 core.String monitoredResource; |
| 2056 |
| 2057 LoggingDestination(); |
| 2058 |
| 2059 LoggingDestination.fromJson(core.Map _json) { |
| 2060 if (_json.containsKey("logs")) { |
| 2061 logs = _json["logs"]; |
| 2062 } |
| 2063 if (_json.containsKey("monitoredResource")) { |
| 2064 monitoredResource = _json["monitoredResource"]; |
| 2065 } |
| 2066 } |
| 2067 |
| 2068 core.Map toJson() { |
| 2069 var _json = new core.Map(); |
| 2070 if (logs != null) { |
| 2071 _json["logs"] = logs; |
| 2072 } |
| 2073 if (monitoredResource != null) { |
| 2074 _json["monitoredResource"] = monitoredResource; |
| 2075 } |
| 2076 return _json; |
| 2077 } |
| 2078 } |
| 2079 |
| 2080 /** |
| 2081 * Do not use this. For media support, add instead |
| 2082 * [][google.bytestream.RestByteStream] as an API to your |
| 2083 * configuration. |
| 2084 */ |
| 2085 class MediaDownload { |
| 2086 /** Whether download is enabled. */ |
| 2087 core.bool enabled; |
| 2088 |
| 2089 MediaDownload(); |
| 2090 |
| 2091 MediaDownload.fromJson(core.Map _json) { |
| 2092 if (_json.containsKey("enabled")) { |
| 2093 enabled = _json["enabled"]; |
| 2094 } |
| 2095 } |
| 2096 |
| 2097 core.Map toJson() { |
| 2098 var _json = new core.Map(); |
| 2099 if (enabled != null) { |
| 2100 _json["enabled"] = enabled; |
| 2101 } |
| 2102 return _json; |
| 2103 } |
| 2104 } |
| 2105 |
| 2106 /** |
| 2107 * Do not use this. For media support, add instead |
| 2108 * [][google.bytestream.RestByteStream] as an API to your |
| 2109 * configuration. |
| 2110 */ |
| 2111 class MediaUpload { |
| 2112 /** Whether upload is enabled. */ |
| 2113 core.bool enabled; |
| 2114 |
| 2115 MediaUpload(); |
| 2116 |
| 2117 MediaUpload.fromJson(core.Map _json) { |
| 2118 if (_json.containsKey("enabled")) { |
| 2119 enabled = _json["enabled"]; |
| 2120 } |
| 2121 } |
| 2122 |
| 2123 core.Map toJson() { |
| 2124 var _json = new core.Map(); |
| 2125 if (enabled != null) { |
| 2126 _json["enabled"] = enabled; |
| 2127 } |
| 2128 return _json; |
| 2129 } |
| 2130 } |
| 2131 |
| 2132 /** Method represents a method of an api. */ |
| 2133 class Method { |
| 2134 /** The simple name of this method. */ |
| 2135 core.String name; |
| 2136 /** Any metadata attached to the method. */ |
| 2137 core.List<Option> options; |
| 2138 /** If true, the request is streamed. */ |
| 2139 core.bool requestStreaming; |
| 2140 /** A URL of the input message type. */ |
| 2141 core.String requestTypeUrl; |
| 2142 /** If true, the response is streamed. */ |
| 2143 core.bool responseStreaming; |
| 2144 /** The URL of the output message type. */ |
| 2145 core.String responseTypeUrl; |
| 2146 /** |
| 2147 * The source syntax of this method. |
| 2148 * Possible string values are: |
| 2149 * - "SYNTAX_PROTO2" : Syntax `proto2`. |
| 2150 * - "SYNTAX_PROTO3" : Syntax `proto3`. |
| 2151 */ |
| 2152 core.String syntax; |
| 2153 |
| 2154 Method(); |
| 2155 |
| 2156 Method.fromJson(core.Map _json) { |
| 2157 if (_json.containsKey("name")) { |
| 2158 name = _json["name"]; |
| 2159 } |
| 2160 if (_json.containsKey("options")) { |
| 2161 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 2162 } |
| 2163 if (_json.containsKey("requestStreaming")) { |
| 2164 requestStreaming = _json["requestStreaming"]; |
| 2165 } |
| 2166 if (_json.containsKey("requestTypeUrl")) { |
| 2167 requestTypeUrl = _json["requestTypeUrl"]; |
| 2168 } |
| 2169 if (_json.containsKey("responseStreaming")) { |
| 2170 responseStreaming = _json["responseStreaming"]; |
| 2171 } |
| 2172 if (_json.containsKey("responseTypeUrl")) { |
| 2173 responseTypeUrl = _json["responseTypeUrl"]; |
| 2174 } |
| 2175 if (_json.containsKey("syntax")) { |
| 2176 syntax = _json["syntax"]; |
| 2177 } |
| 2178 } |
| 2179 |
| 2180 core.Map toJson() { |
| 2181 var _json = new core.Map(); |
| 2182 if (name != null) { |
| 2183 _json["name"] = name; |
| 2184 } |
| 2185 if (options != null) { |
| 2186 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 2187 } |
| 2188 if (requestStreaming != null) { |
| 2189 _json["requestStreaming"] = requestStreaming; |
| 2190 } |
| 2191 if (requestTypeUrl != null) { |
| 2192 _json["requestTypeUrl"] = requestTypeUrl; |
| 2193 } |
| 2194 if (responseStreaming != null) { |
| 2195 _json["responseStreaming"] = responseStreaming; |
| 2196 } |
| 2197 if (responseTypeUrl != null) { |
| 2198 _json["responseTypeUrl"] = responseTypeUrl; |
| 2199 } |
| 2200 if (syntax != null) { |
| 2201 _json["syntax"] = syntax; |
| 2202 } |
| 2203 return _json; |
| 2204 } |
| 2205 } |
| 2206 |
| 2207 /** |
| 2208 * Defines a metric type and its schema. Once a metric descriptor is created, |
| 2209 * deleting or altering it stops data collection and makes the metric type's |
| 2210 * existing data unusable. |
| 2211 */ |
| 2212 class MetricDescriptor { |
| 2213 /** |
| 2214 * A detailed description of the metric, which can be used in documentation. |
| 2215 */ |
| 2216 core.String description; |
| 2217 /** |
| 2218 * A concise name for the metric, which can be displayed in user interfaces. |
| 2219 * Use sentence case without an ending period, for example "Request count". |
| 2220 */ |
| 2221 core.String displayName; |
| 2222 /** |
| 2223 * The set of labels that can be used to describe a specific |
| 2224 * instance of this metric type. For example, the |
| 2225 * `appengine.googleapis.com/http/server/response_latencies` metric |
| 2226 * type has a label for the HTTP response code, `response_code`, so |
| 2227 * you can look at latencies for successful responses or just |
| 2228 * for responses that failed. |
| 2229 */ |
| 2230 core.List<LabelDescriptor> labels; |
| 2231 /** |
| 2232 * Whether the metric records instantaneous values, changes to a value, etc. |
| 2233 * Some combinations of `metric_kind` and `value_type` might not be supported. |
| 2234 * Possible string values are: |
| 2235 * - "METRIC_KIND_UNSPECIFIED" : Do not use this default value. |
| 2236 * - "GAUGE" : An instantaneous measurement of a value. |
| 2237 * - "DELTA" : The change in a value during a time interval. |
| 2238 * - "CUMULATIVE" : A value accumulated over a time interval. Cumulative |
| 2239 * measurements in a time series should have the same start time |
| 2240 * and increasing end times, until an event resets the cumulative |
| 2241 * value to zero and sets a new start time for the following |
| 2242 * points. |
| 2243 */ |
| 2244 core.String metricKind; |
| 2245 /** |
| 2246 * The resource name of the metric descriptor. Depending on the |
| 2247 * implementation, the name typically includes: (1) the parent resource name |
| 2248 * that defines the scope of the metric type or of its data; and (2) the |
| 2249 * metric's URL-encoded type, which also appears in the `type` field of this |
| 2250 * descriptor. For example, following is the resource name of a custom |
| 2251 * metric within the GCP project `my-project-id`: |
| 2252 * |
| 2253 * "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2
Fpaid%2Famount" |
| 2254 */ |
| 2255 core.String name; |
| 2256 /** |
| 2257 * The metric type, including its DNS name prefix. The type is not |
| 2258 * URL-encoded. All user-defined custom metric types have the DNS name |
| 2259 * `custom.googleapis.com`. Metric types should use a natural hierarchical |
| 2260 * grouping. For example: |
| 2261 * |
| 2262 * "custom.googleapis.com/invoice/paid/amount" |
| 2263 * "appengine.googleapis.com/http/server/response_latencies" |
| 2264 */ |
| 2265 core.String type; |
| 2266 /** |
| 2267 * The unit in which the metric value is reported. It is only applicable |
| 2268 * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The |
| 2269 * supported units are a subset of [The Unified Code for Units of |
| 2270 * Measure](http://unitsofmeasure.org/ucum.html) standard: |
| 2271 * |
| 2272 * **Basic units (UNIT)** |
| 2273 * |
| 2274 * * `bit` bit |
| 2275 * * `By` byte |
| 2276 * * `s` second |
| 2277 * * `min` minute |
| 2278 * * `h` hour |
| 2279 * * `d` day |
| 2280 * |
| 2281 * **Prefixes (PREFIX)** |
| 2282 * |
| 2283 * * `k` kilo (10**3) |
| 2284 * * `M` mega (10**6) |
| 2285 * * `G` giga (10**9) |
| 2286 * * `T` tera (10**12) |
| 2287 * * `P` peta (10**15) |
| 2288 * * `E` exa (10**18) |
| 2289 * * `Z` zetta (10**21) |
| 2290 * * `Y` yotta (10**24) |
| 2291 * * `m` milli (10**-3) |
| 2292 * * `u` micro (10**-6) |
| 2293 * * `n` nano (10**-9) |
| 2294 * * `p` pico (10**-12) |
| 2295 * * `f` femto (10**-15) |
| 2296 * * `a` atto (10**-18) |
| 2297 * * `z` zepto (10**-21) |
| 2298 * * `y` yocto (10**-24) |
| 2299 * * `Ki` kibi (2**10) |
| 2300 * * `Mi` mebi (2**20) |
| 2301 * * `Gi` gibi (2**30) |
| 2302 * * `Ti` tebi (2**40) |
| 2303 * |
| 2304 * **Grammar** |
| 2305 * |
| 2306 * The grammar includes the dimensionless unit `1`, such as `1/s`. |
| 2307 * |
| 2308 * The grammar also includes these connectors: |
| 2309 * |
| 2310 * * `/` division (as an infix operator, e.g. `1/s`). |
| 2311 * * `.` multiplication (as an infix operator, e.g. `GBy.d`) |
| 2312 * |
| 2313 * The grammar for a unit is as follows: |
| 2314 * |
| 2315 * Expression = Component { "." Component } { "/" Component } ; |
| 2316 * |
| 2317 * Component = [ PREFIX ] UNIT [ Annotation ] |
| 2318 * | Annotation |
| 2319 * | "1" |
| 2320 * ; |
| 2321 * |
| 2322 * Annotation = "{" NAME "}" ; |
| 2323 * |
| 2324 * Notes: |
| 2325 * |
| 2326 * * `Annotation` is just a comment if it follows a `UNIT` and is |
| 2327 * equivalent to `1` if it is used alone. For examples, |
| 2328 * `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. |
| 2329 * * `NAME` is a sequence of non-blank printable ASCII characters not |
| 2330 * containing '{' or '}'. |
| 2331 */ |
| 2332 core.String unit; |
| 2333 /** |
| 2334 * Whether the measurement is an integer, a floating-point number, etc. |
| 2335 * Some combinations of `metric_kind` and `value_type` might not be supported. |
| 2336 * Possible string values are: |
| 2337 * - "VALUE_TYPE_UNSPECIFIED" : Do not use this default value. |
| 2338 * - "BOOL" : The value is a boolean. |
| 2339 * This value type can be used only if the metric kind is `GAUGE`. |
| 2340 * - "INT64" : The value is a signed 64-bit integer. |
| 2341 * - "DOUBLE" : The value is a double precision floating point number. |
| 2342 * - "STRING" : The value is a text string. |
| 2343 * This value type can be used only if the metric kind is `GAUGE`. |
| 2344 * - "DISTRIBUTION" : The value is a `Distribution`. |
| 2345 * - "MONEY" : The value is money. |
| 2346 */ |
| 2347 core.String valueType; |
| 2348 |
| 2349 MetricDescriptor(); |
| 2350 |
| 2351 MetricDescriptor.fromJson(core.Map _json) { |
| 2352 if (_json.containsKey("description")) { |
| 2353 description = _json["description"]; |
| 2354 } |
| 2355 if (_json.containsKey("displayName")) { |
| 2356 displayName = _json["displayName"]; |
| 2357 } |
| 2358 if (_json.containsKey("labels")) { |
| 2359 labels = _json["labels"].map((value) => new LabelDescriptor.fromJson(value
)).toList(); |
| 2360 } |
| 2361 if (_json.containsKey("metricKind")) { |
| 2362 metricKind = _json["metricKind"]; |
| 2363 } |
| 2364 if (_json.containsKey("name")) { |
| 2365 name = _json["name"]; |
| 2366 } |
| 2367 if (_json.containsKey("type")) { |
| 2368 type = _json["type"]; |
| 2369 } |
| 2370 if (_json.containsKey("unit")) { |
| 2371 unit = _json["unit"]; |
| 2372 } |
| 2373 if (_json.containsKey("valueType")) { |
| 2374 valueType = _json["valueType"]; |
| 2375 } |
| 2376 } |
| 2377 |
| 2378 core.Map toJson() { |
| 2379 var _json = new core.Map(); |
| 2380 if (description != null) { |
| 2381 _json["description"] = description; |
| 2382 } |
| 2383 if (displayName != null) { |
| 2384 _json["displayName"] = displayName; |
| 2385 } |
| 2386 if (labels != null) { |
| 2387 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 2388 } |
| 2389 if (metricKind != null) { |
| 2390 _json["metricKind"] = metricKind; |
| 2391 } |
| 2392 if (name != null) { |
| 2393 _json["name"] = name; |
| 2394 } |
| 2395 if (type != null) { |
| 2396 _json["type"] = type; |
| 2397 } |
| 2398 if (unit != null) { |
| 2399 _json["unit"] = unit; |
| 2400 } |
| 2401 if (valueType != null) { |
| 2402 _json["valueType"] = valueType; |
| 2403 } |
| 2404 return _json; |
| 2405 } |
| 2406 } |
| 2407 |
| 2408 /** |
| 2409 * Declares an API to be included in this API. The including API must |
| 2410 * redeclare all the methods from the included API, but documentation |
| 2411 * and options are inherited as follows: |
| 2412 * |
| 2413 * - If after comment and whitespace stripping, the documentation |
| 2414 * string of the redeclared method is empty, it will be inherited |
| 2415 * from the original method. |
| 2416 * |
| 2417 * - Each annotation belonging to the service config (http, |
| 2418 * visibility) which is not set in the redeclared method will be |
| 2419 * inherited. |
| 2420 * |
| 2421 * - If an http annotation is inherited, the path pattern will be |
| 2422 * modified as follows. Any version prefix will be replaced by the |
| 2423 * version of the including API plus the root path if specified. |
| 2424 * |
| 2425 * Example of a simple mixin: |
| 2426 * |
| 2427 * package google.acl.v1; |
| 2428 * service AccessControl { |
| 2429 * // Get the underlying ACL object. |
| 2430 * rpc GetAcl(GetAclRequest) returns (Acl) { |
| 2431 * option (google.api.http).get = "/v1/{resource=**}:getAcl"; |
| 2432 * } |
| 2433 * } |
| 2434 * |
| 2435 * package google.storage.v2; |
| 2436 * service Storage { |
| 2437 * // rpc GetAcl(GetAclRequest) returns (Acl); |
| 2438 * |
| 2439 * // Get a data record. |
| 2440 * rpc GetData(GetDataRequest) returns (Data) { |
| 2441 * option (google.api.http).get = "/v2/{resource=**}"; |
| 2442 * } |
| 2443 * } |
| 2444 * |
| 2445 * Example of a mixin configuration: |
| 2446 * |
| 2447 * apis: |
| 2448 * - name: google.storage.v2.Storage |
| 2449 * mixins: |
| 2450 * - name: google.acl.v1.AccessControl |
| 2451 * |
| 2452 * The mixin construct implies that all methods in `AccessControl` are |
| 2453 * also declared with same name and request/response types in |
| 2454 * `Storage`. A documentation generator or annotation processor will |
| 2455 * see the effective `Storage.GetAcl` method after inherting |
| 2456 * documentation and annotations as follows: |
| 2457 * |
| 2458 * service Storage { |
| 2459 * // Get the underlying ACL object. |
| 2460 * rpc GetAcl(GetAclRequest) returns (Acl) { |
| 2461 * option (google.api.http).get = "/v2/{resource=**}:getAcl"; |
| 2462 * } |
| 2463 * ... |
| 2464 * } |
| 2465 * |
| 2466 * Note how the version in the path pattern changed from `v1` to `v2`. |
| 2467 * |
| 2468 * If the `root` field in the mixin is specified, it should be a |
| 2469 * relative path under which inherited HTTP paths are placed. Example: |
| 2470 * |
| 2471 * apis: |
| 2472 * - name: google.storage.v2.Storage |
| 2473 * mixins: |
| 2474 * - name: google.acl.v1.AccessControl |
| 2475 * root: acls |
| 2476 * |
| 2477 * This implies the following inherited HTTP annotation: |
| 2478 * |
| 2479 * service Storage { |
| 2480 * // Get the underlying ACL object. |
| 2481 * rpc GetAcl(GetAclRequest) returns (Acl) { |
| 2482 * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; |
| 2483 * } |
| 2484 * ... |
| 2485 * } |
| 2486 */ |
| 2487 class Mixin { |
| 2488 /** The fully qualified name of the API which is included. */ |
| 2489 core.String name; |
| 2490 /** |
| 2491 * If non-empty specifies a path under which inherited HTTP paths |
| 2492 * are rooted. |
| 2493 */ |
| 2494 core.String root; |
| 2495 |
| 2496 Mixin(); |
| 2497 |
| 2498 Mixin.fromJson(core.Map _json) { |
| 2499 if (_json.containsKey("name")) { |
| 2500 name = _json["name"]; |
| 2501 } |
| 2502 if (_json.containsKey("root")) { |
| 2503 root = _json["root"]; |
| 2504 } |
| 2505 } |
| 2506 |
| 2507 core.Map toJson() { |
| 2508 var _json = new core.Map(); |
| 2509 if (name != null) { |
| 2510 _json["name"] = name; |
| 2511 } |
| 2512 if (root != null) { |
| 2513 _json["root"] = root; |
| 2514 } |
| 2515 return _json; |
| 2516 } |
| 2517 } |
| 2518 |
| 2519 /** |
| 2520 * An object that describes the schema of a MonitoredResource object using a |
| 2521 * type name and a set of labels. For example, the monitored resource |
| 2522 * descriptor for Google Compute Engine VM instances has a type of |
| 2523 * `"gce_instance"` and specifies the use of the labels `"instance_id"` and |
| 2524 * `"zone"` to identify particular VM instances. |
| 2525 * |
| 2526 * Different APIs can support different monitored resource types. APIs generally |
| 2527 * provide a `list` method that returns the monitored resource descriptors used |
| 2528 * by the API. |
| 2529 */ |
| 2530 class MonitoredResourceDescriptor { |
| 2531 /** |
| 2532 * Optional. A detailed description of the monitored resource type that might |
| 2533 * be used in documentation. |
| 2534 */ |
| 2535 core.String description; |
| 2536 /** |
| 2537 * Optional. A concise name for the monitored resource type that might be |
| 2538 * displayed in user interfaces. It should be a Title Cased Noun Phrase, |
| 2539 * without any article or other determiners. For example, |
| 2540 * `"Google Cloud SQL Database"`. |
| 2541 */ |
| 2542 core.String displayName; |
| 2543 /** |
| 2544 * Required. A set of labels used to describe instances of this monitored |
| 2545 * resource type. For example, an individual Google Cloud SQL database is |
| 2546 * identified by values for the labels `"database_id"` and `"zone"`. |
| 2547 */ |
| 2548 core.List<LabelDescriptor> labels; |
| 2549 /** |
| 2550 * Optional. The resource name of the monitored resource descriptor: |
| 2551 * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where |
| 2552 * {type} is the value of the `type` field in this object and |
| 2553 * {project_id} is a project ID that provides API-specific context for |
| 2554 * accessing the type. APIs that do not use project information can use the |
| 2555 * resource name format `"monitoredResourceDescriptors/{type}"`. |
| 2556 */ |
| 2557 core.String name; |
| 2558 /** |
| 2559 * Required. The monitored resource type. For example, the type |
| 2560 * `"cloudsql_database"` represents databases in Google Cloud SQL. |
| 2561 * The maximum length of this value is 256 characters. |
| 2562 */ |
| 2563 core.String type; |
| 2564 |
| 2565 MonitoredResourceDescriptor(); |
| 2566 |
| 2567 MonitoredResourceDescriptor.fromJson(core.Map _json) { |
| 2568 if (_json.containsKey("description")) { |
| 2569 description = _json["description"]; |
| 2570 } |
| 2571 if (_json.containsKey("displayName")) { |
| 2572 displayName = _json["displayName"]; |
| 2573 } |
| 2574 if (_json.containsKey("labels")) { |
| 2575 labels = _json["labels"].map((value) => new LabelDescriptor.fromJson(value
)).toList(); |
| 2576 } |
| 2577 if (_json.containsKey("name")) { |
| 2578 name = _json["name"]; |
| 2579 } |
| 2580 if (_json.containsKey("type")) { |
| 2581 type = _json["type"]; |
| 2582 } |
| 2583 } |
| 2584 |
| 2585 core.Map toJson() { |
| 2586 var _json = new core.Map(); |
| 2587 if (description != null) { |
| 2588 _json["description"] = description; |
| 2589 } |
| 2590 if (displayName != null) { |
| 2591 _json["displayName"] = displayName; |
| 2592 } |
| 2593 if (labels != null) { |
| 2594 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 2595 } |
| 2596 if (name != null) { |
| 2597 _json["name"] = name; |
| 2598 } |
| 2599 if (type != null) { |
| 2600 _json["type"] = type; |
| 2601 } |
| 2602 return _json; |
| 2603 } |
| 2604 } |
| 2605 |
| 2606 /** |
| 2607 * Monitoring configuration of the service. |
| 2608 * |
| 2609 * The example below shows how to configure monitored resources and metrics |
| 2610 * for monitoring. In the example, a monitored resource and two metrics are |
| 2611 * defined. The `library.googleapis.com/book/returned_count` metric is sent |
| 2612 * to both producer and consumer projects, whereas the |
| 2613 * `library.googleapis.com/book/overdue_count` metric is only sent to the |
| 2614 * consumer project. |
| 2615 * |
| 2616 * monitored_resources: |
| 2617 * - type: library.googleapis.com/branch |
| 2618 * labels: |
| 2619 * - key: /city |
| 2620 * description: The city where the library branch is located in. |
| 2621 * - key: /name |
| 2622 * description: The name of the branch. |
| 2623 * metrics: |
| 2624 * - name: library.googleapis.com/book/returned_count |
| 2625 * metric_kind: DELTA |
| 2626 * value_type: INT64 |
| 2627 * labels: |
| 2628 * - key: /customer_id |
| 2629 * - name: library.googleapis.com/book/overdue_count |
| 2630 * metric_kind: GAUGE |
| 2631 * value_type: INT64 |
| 2632 * labels: |
| 2633 * - key: /customer_id |
| 2634 * monitoring: |
| 2635 * producer_destinations: |
| 2636 * - monitored_resource: library.googleapis.com/branch |
| 2637 * metrics: |
| 2638 * - library.googleapis.com/book/returned_count |
| 2639 * consumer_destinations: |
| 2640 * - monitored_resource: library.googleapis.com/branch |
| 2641 * metrics: |
| 2642 * - library.googleapis.com/book/returned_count |
| 2643 * - library.googleapis.com/book/overdue_count |
| 2644 */ |
| 2645 class Monitoring { |
| 2646 /** |
| 2647 * Monitoring configurations for sending metrics to the consumer project. |
| 2648 * There can be multiple consumer destinations, each one must have a |
| 2649 * different monitored resource type. A metric can be used in at most |
| 2650 * one consumer destination. |
| 2651 */ |
| 2652 core.List<MonitoringDestination> consumerDestinations; |
| 2653 /** |
| 2654 * Monitoring configurations for sending metrics to the producer project. |
| 2655 * There can be multiple producer destinations, each one must have a |
| 2656 * different monitored resource type. A metric can be used in at most |
| 2657 * one producer destination. |
| 2658 */ |
| 2659 core.List<MonitoringDestination> producerDestinations; |
| 2660 |
| 2661 Monitoring(); |
| 2662 |
| 2663 Monitoring.fromJson(core.Map _json) { |
| 2664 if (_json.containsKey("consumerDestinations")) { |
| 2665 consumerDestinations = _json["consumerDestinations"].map((value) => new Mo
nitoringDestination.fromJson(value)).toList(); |
| 2666 } |
| 2667 if (_json.containsKey("producerDestinations")) { |
| 2668 producerDestinations = _json["producerDestinations"].map((value) => new Mo
nitoringDestination.fromJson(value)).toList(); |
| 2669 } |
| 2670 } |
| 2671 |
| 2672 core.Map toJson() { |
| 2673 var _json = new core.Map(); |
| 2674 if (consumerDestinations != null) { |
| 2675 _json["consumerDestinations"] = consumerDestinations.map((value) => (value
).toJson()).toList(); |
| 2676 } |
| 2677 if (producerDestinations != null) { |
| 2678 _json["producerDestinations"] = producerDestinations.map((value) => (value
).toJson()).toList(); |
| 2679 } |
| 2680 return _json; |
| 2681 } |
| 2682 } |
| 2683 |
| 2684 /** |
| 2685 * Configuration of a specific monitoring destination (the producer project |
| 2686 * or the consumer project). |
| 2687 */ |
| 2688 class MonitoringDestination { |
| 2689 /** |
| 2690 * Names of the metrics to report to this monitoring destination. |
| 2691 * Each name must be defined in Service.metrics section. |
| 2692 */ |
| 2693 core.List<core.String> metrics; |
| 2694 /** |
| 2695 * The monitored resource type. The type must be defined in |
| 2696 * Service.monitored_resources section. |
| 2697 */ |
| 2698 core.String monitoredResource; |
| 2699 |
| 2700 MonitoringDestination(); |
| 2701 |
| 2702 MonitoringDestination.fromJson(core.Map _json) { |
| 2703 if (_json.containsKey("metrics")) { |
| 2704 metrics = _json["metrics"]; |
| 2705 } |
| 2706 if (_json.containsKey("monitoredResource")) { |
| 2707 monitoredResource = _json["monitoredResource"]; |
| 2708 } |
| 2709 } |
| 2710 |
| 2711 core.Map toJson() { |
| 2712 var _json = new core.Map(); |
| 2713 if (metrics != null) { |
| 2714 _json["metrics"] = metrics; |
| 2715 } |
| 2716 if (monitoredResource != null) { |
| 2717 _json["monitoredResource"] = monitoredResource; |
| 2718 } |
| 2719 return _json; |
| 2720 } |
| 2721 } |
| 2722 |
| 2723 /** |
| 2724 * OAuth scopes are a way to define data and permissions on data. For example, |
| 2725 * there are scopes defined for "Read-only access to Google Calendar" and |
| 2726 * "Access to Cloud Platform". Users can consent to a scope for an application, |
| 2727 * giving it permission to access that data on their behalf. |
| 2728 * |
| 2729 * OAuth scope specifications should be fairly coarse grained; a user will need |
| 2730 * to see and understand the text description of what your scope means. |
| 2731 * |
| 2732 * In most cases: use one or at most two OAuth scopes for an entire family of |
| 2733 * products. If your product has multiple APIs, you should probably be sharing |
| 2734 * the OAuth scope across all of those APIs. |
| 2735 * |
| 2736 * When you need finer grained OAuth consent screens: talk with your product |
| 2737 * management about how developers will use them in practice. |
| 2738 * |
| 2739 * Please note that even though each of the canonical scopes is enough for a |
| 2740 * request to be accepted and passed to the backend, a request can still fail |
| 2741 * due to the backend requiring additional scopes or permissions. |
| 2742 */ |
| 2743 class OAuthRequirements { |
| 2744 /** |
| 2745 * The list of publicly documented OAuth scopes that are allowed access. An |
| 2746 * OAuth token containing any of these scopes will be accepted. |
| 2747 * |
| 2748 * Example: |
| 2749 * |
| 2750 * canonical_scopes: https://www.googleapis.com/auth/calendar, |
| 2751 * https://www.googleapis.com/auth/calendar.read |
| 2752 */ |
| 2753 core.String canonicalScopes; |
| 2754 |
| 2755 OAuthRequirements(); |
| 2756 |
| 2757 OAuthRequirements.fromJson(core.Map _json) { |
| 2758 if (_json.containsKey("canonicalScopes")) { |
| 2759 canonicalScopes = _json["canonicalScopes"]; |
| 2760 } |
| 2761 } |
| 2762 |
| 2763 core.Map toJson() { |
| 2764 var _json = new core.Map(); |
| 2765 if (canonicalScopes != null) { |
| 2766 _json["canonicalScopes"] = canonicalScopes; |
| 2767 } |
| 2768 return _json; |
| 2769 } |
| 2770 } |
| 2771 |
| 2772 /** |
| 2773 * This resource represents a long-running operation that is the result of a |
| 2774 * network API call. |
| 2775 */ |
| 2776 class Operation { |
| 2777 /** |
| 2778 * If the value is `false`, it means the operation is still in progress. |
| 2779 * If true, the operation is completed, and either `error` or `response` is |
| 2780 * available. |
| 2781 */ |
| 2782 core.bool done; |
| 2783 /** The error result of the operation in case of failure or cancellation. */ |
| 2784 Status error; |
| 2785 /** |
| 2786 * Service-specific metadata associated with the operation. It typically |
| 2787 * contains progress information and common metadata such as create time. |
| 2788 * Some services might not provide such metadata. Any method that returns a |
| 2789 * long-running operation should document the metadata type, if any. |
| 2790 * |
| 2791 * The values for Object must be JSON objects. It can consist of `num`, |
| 2792 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 2793 */ |
| 2794 core.Map<core.String, core.Object> metadata; |
| 2795 /** |
| 2796 * The server-assigned name, which is only unique within the same service that |
| 2797 * originally returns it. If you use the default HTTP mapping, the |
| 2798 * `name` should have the format of `operations/some/unique/name`. |
| 2799 */ |
| 2800 core.String name; |
| 2801 /** |
| 2802 * The normal response of the operation in case of success. If the original |
| 2803 * method returns no data on success, such as `Delete`, the response is |
| 2804 * `google.protobuf.Empty`. If the original method is standard |
| 2805 * `Get`/`Create`/`Update`, the response should be the resource. For other |
| 2806 * methods, the response should have the type `XxxResponse`, where `Xxx` |
| 2807 * is the original method name. For example, if the original method name |
| 2808 * is `TakeSnapshot()`, the inferred response type is |
| 2809 * `TakeSnapshotResponse`. |
| 2810 * |
| 2811 * The values for Object must be JSON objects. It can consist of `num`, |
| 2812 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 2813 */ |
| 2814 core.Map<core.String, core.Object> response; |
| 2815 |
| 2816 Operation(); |
| 2817 |
| 2818 Operation.fromJson(core.Map _json) { |
| 2819 if (_json.containsKey("done")) { |
| 2820 done = _json["done"]; |
| 2821 } |
| 2822 if (_json.containsKey("error")) { |
| 2823 error = new Status.fromJson(_json["error"]); |
| 2824 } |
| 2825 if (_json.containsKey("metadata")) { |
| 2826 metadata = _json["metadata"]; |
| 2827 } |
| 2828 if (_json.containsKey("name")) { |
| 2829 name = _json["name"]; |
| 2830 } |
| 2831 if (_json.containsKey("response")) { |
| 2832 response = _json["response"]; |
| 2833 } |
| 2834 } |
| 2835 |
| 2836 core.Map toJson() { |
| 2837 var _json = new core.Map(); |
| 2838 if (done != null) { |
| 2839 _json["done"] = done; |
| 2840 } |
| 2841 if (error != null) { |
| 2842 _json["error"] = (error).toJson(); |
| 2843 } |
| 2844 if (metadata != null) { |
| 2845 _json["metadata"] = metadata; |
| 2846 } |
| 2847 if (name != null) { |
| 2848 _json["name"] = name; |
| 2849 } |
| 2850 if (response != null) { |
| 2851 _json["response"] = response; |
| 2852 } |
| 2853 return _json; |
| 2854 } |
| 2855 } |
| 2856 |
| 2857 /** |
| 2858 * A protocol buffer option, which can be attached to a message, field, |
| 2859 * enumeration, etc. |
| 2860 */ |
| 2861 class Option { |
| 2862 /** |
| 2863 * The option's name. For protobuf built-in options (options defined in |
| 2864 * descriptor.proto), this is the short name. For example, `"map_entry"`. |
| 2865 * For custom options, it should be the fully-qualified name. For example, |
| 2866 * `"google.api.http"`. |
| 2867 */ |
| 2868 core.String name; |
| 2869 /** |
| 2870 * The option's value packed in an Any message. If the value is a primitive, |
| 2871 * the corresponding wrapper type defined in google/protobuf/wrappers.proto |
| 2872 * should be used. If the value is an enum, it should be stored as an int32 |
| 2873 * value using the google.protobuf.Int32Value type. |
| 2874 * |
| 2875 * The values for Object must be JSON objects. It can consist of `num`, |
| 2876 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 2877 */ |
| 2878 core.Map<core.String, core.Object> value; |
| 2879 |
| 2880 Option(); |
| 2881 |
| 2882 Option.fromJson(core.Map _json) { |
| 2883 if (_json.containsKey("name")) { |
| 2884 name = _json["name"]; |
| 2885 } |
| 2886 if (_json.containsKey("value")) { |
| 2887 value = _json["value"]; |
| 2888 } |
| 2889 } |
| 2890 |
| 2891 core.Map toJson() { |
| 2892 var _json = new core.Map(); |
| 2893 if (name != null) { |
| 2894 _json["name"] = name; |
| 2895 } |
| 2896 if (value != null) { |
| 2897 _json["value"] = value; |
| 2898 } |
| 2899 return _json; |
| 2900 } |
| 2901 } |
| 2902 |
| 2903 /** |
| 2904 * Represents a documentation page. A page can contain subpages to represent |
| 2905 * nested documentation set structure. |
| 2906 */ |
| 2907 class Page { |
| 2908 /** |
| 2909 * The Markdown content of the page. You can use <code>(== include {path} |
| 2910 * ==)</code> |
| 2911 * to include content from a Markdown file. |
| 2912 */ |
| 2913 core.String content; |
| 2914 /** |
| 2915 * The name of the page. It will be used as an identity of the page to |
| 2916 * generate URI of the page, text of the link to this page in navigation, |
| 2917 * etc. The full page name (start from the root page name to this page |
| 2918 * concatenated with `.`) can be used as reference to the page in your |
| 2919 * documentation. For example: |
| 2920 * <pre><code>pages: |
| 2921 * - name: Tutorial |
| 2922 * content: (== include tutorial.md ==) |
| 2923 * subpages: |
| 2924 * - name: Java |
| 2925 * content: (== include tutorial_java.md ==) |
| 2926 * </code></pre> |
| 2927 * You can reference `Java` page using Markdown reference link syntax: |
| 2928 * `Java`. |
| 2929 */ |
| 2930 core.String name; |
| 2931 /** |
| 2932 * Subpages of this page. The order of subpages specified here will be |
| 2933 * honored in the generated docset. |
| 2934 */ |
| 2935 core.List<Page> subpages; |
| 2936 |
| 2937 Page(); |
| 2938 |
| 2939 Page.fromJson(core.Map _json) { |
| 2940 if (_json.containsKey("content")) { |
| 2941 content = _json["content"]; |
| 2942 } |
| 2943 if (_json.containsKey("name")) { |
| 2944 name = _json["name"]; |
| 2945 } |
| 2946 if (_json.containsKey("subpages")) { |
| 2947 subpages = _json["subpages"].map((value) => new Page.fromJson(value)).toLi
st(); |
| 2948 } |
| 2949 } |
| 2950 |
| 2951 core.Map toJson() { |
| 2952 var _json = new core.Map(); |
| 2953 if (content != null) { |
| 2954 _json["content"] = content; |
| 2955 } |
| 2956 if (name != null) { |
| 2957 _json["name"] = name; |
| 2958 } |
| 2959 if (subpages != null) { |
| 2960 _json["subpages"] = subpages.map((value) => (value).toJson()).toList(); |
| 2961 } |
| 2962 return _json; |
| 2963 } |
| 2964 } |
| 2965 |
| 2966 /** |
| 2967 * `Service` is the root object of Google service configuration schema. It |
| 2968 * describes basic information about a service, such as the name and the |
| 2969 * title, and delegates other aspects to sub-sections. Each sub-section is |
| 2970 * either a proto message or a repeated proto message that configures a |
| 2971 * specific aspect, such as auth. See each proto message definition for details. |
| 2972 * |
| 2973 * Example: |
| 2974 * |
| 2975 * type: google.api.Service |
| 2976 * config_version: 3 |
| 2977 * name: calendar.googleapis.com |
| 2978 * title: Google Calendar API |
| 2979 * apis: |
| 2980 * - name: google.calendar.v3.Calendar |
| 2981 * authentication: |
| 2982 * providers: |
| 2983 * - id: google_calendar_auth |
| 2984 * jwks_uri: https://www.googleapis.com/oauth2/v1/certs |
| 2985 * issuer: https://securetoken.google.com |
| 2986 * rules: |
| 2987 * - selector: "*" |
| 2988 * requirements: |
| 2989 * provider_id: google_calendar_auth |
| 2990 */ |
| 2991 class Service { |
| 2992 /** |
| 2993 * A list of API interfaces exported by this service. Only the `name` field |
| 2994 * of the google.protobuf.Api needs to be provided by the configuration |
| 2995 * author, as the remaining fields will be derived from the IDL during the |
| 2996 * normalization process. It is an error to specify an API interface here |
| 2997 * which cannot be resolved against the associated IDL files. |
| 2998 */ |
| 2999 core.List<Api> apis; |
| 3000 /** Auth configuration. */ |
| 3001 Authentication authentication; |
| 3002 /** API backend configuration. */ |
| 3003 Backend backend; |
| 3004 /** |
| 3005 * The version of the service configuration. The config version may |
| 3006 * influence interpretation of the configuration, for example, to |
| 3007 * determine defaults. This is documented together with applicable |
| 3008 * options. The current default for the config version itself is `3`. |
| 3009 */ |
| 3010 core.int configVersion; |
| 3011 /** Context configuration. */ |
| 3012 Context context; |
| 3013 /** Configuration for the service control plane. */ |
| 3014 Control control; |
| 3015 /** Custom error configuration. */ |
| 3016 CustomError customError; |
| 3017 /** Additional API documentation. */ |
| 3018 Documentation documentation; |
| 3019 /** |
| 3020 * Configuration for network endpoints. If this is empty, then an endpoint |
| 3021 * with the same name as the service is automatically generated to service all |
| 3022 * defined APIs. |
| 3023 */ |
| 3024 core.List<Endpoint> endpoints; |
| 3025 /** |
| 3026 * A list of all enum types included in this API service. Enums |
| 3027 * referenced directly or indirectly by the `apis` are automatically |
| 3028 * included. Enums which are not referenced but shall be included |
| 3029 * should be listed here by name. Example: |
| 3030 * |
| 3031 * enums: |
| 3032 * - name: google.someapi.v1.SomeEnum |
| 3033 */ |
| 3034 core.List<Enum> enums; |
| 3035 /** HTTP configuration. */ |
| 3036 Http http; |
| 3037 /** |
| 3038 * A unique ID for a specific instance of this message, typically assigned |
| 3039 * by the client for tracking purpose. If empty, the server may choose to |
| 3040 * generate one instead. |
| 3041 */ |
| 3042 core.String id; |
| 3043 /** Logging configuration. */ |
| 3044 Logging logging; |
| 3045 /** Defines the logs used by this service. */ |
| 3046 core.List<LogDescriptor> logs; |
| 3047 /** Defines the metrics used by this service. */ |
| 3048 core.List<MetricDescriptor> metrics; |
| 3049 /** |
| 3050 * Defines the monitored resources used by this service. This is required |
| 3051 * by the Service.monitoring and Service.logging configurations. |
| 3052 */ |
| 3053 core.List<MonitoredResourceDescriptor> monitoredResources; |
| 3054 /** Monitoring configuration. */ |
| 3055 Monitoring monitoring; |
| 3056 /** |
| 3057 * The DNS address at which this service is available, |
| 3058 * e.g. `calendar.googleapis.com`. |
| 3059 */ |
| 3060 core.String name; |
| 3061 /** |
| 3062 * The id of the Google developer project that owns the service. |
| 3063 * Members of this project can manage the service configuration, |
| 3064 * manage consumption of the service, etc. |
| 3065 */ |
| 3066 core.String producerProjectId; |
| 3067 /** System parameter configuration. */ |
| 3068 SystemParameters systemParameters; |
| 3069 /** |
| 3070 * A list of all proto message types included in this API service. |
| 3071 * It serves similar purpose as [google.api.Service.types], except that |
| 3072 * these types are not needed by user-defined APIs. Therefore, they will not |
| 3073 * show up in the generated discovery doc. This field should only be used |
| 3074 * to define system APIs in ESF. |
| 3075 */ |
| 3076 core.List<Type> systemTypes; |
| 3077 /** The product title associated with this service. */ |
| 3078 core.String title; |
| 3079 /** |
| 3080 * A list of all proto message types included in this API service. |
| 3081 * Types referenced directly or indirectly by the `apis` are |
| 3082 * automatically included. Messages which are not referenced but |
| 3083 * shall be included, such as types used by the `google.protobuf.Any` type, |
| 3084 * should be listed here by name. Example: |
| 3085 * |
| 3086 * types: |
| 3087 * - name: google.protobuf.Int32 |
| 3088 */ |
| 3089 core.List<Type> types; |
| 3090 /** Configuration controlling usage of this service. */ |
| 3091 Usage usage; |
| 3092 /** API visibility configuration. */ |
| 3093 Visibility visibility; |
| 3094 |
| 3095 Service(); |
| 3096 |
| 3097 Service.fromJson(core.Map _json) { |
| 3098 if (_json.containsKey("apis")) { |
| 3099 apis = _json["apis"].map((value) => new Api.fromJson(value)).toList(); |
| 3100 } |
| 3101 if (_json.containsKey("authentication")) { |
| 3102 authentication = new Authentication.fromJson(_json["authentication"]); |
| 3103 } |
| 3104 if (_json.containsKey("backend")) { |
| 3105 backend = new Backend.fromJson(_json["backend"]); |
| 3106 } |
| 3107 if (_json.containsKey("configVersion")) { |
| 3108 configVersion = _json["configVersion"]; |
| 3109 } |
| 3110 if (_json.containsKey("context")) { |
| 3111 context = new Context.fromJson(_json["context"]); |
| 3112 } |
| 3113 if (_json.containsKey("control")) { |
| 3114 control = new Control.fromJson(_json["control"]); |
| 3115 } |
| 3116 if (_json.containsKey("customError")) { |
| 3117 customError = new CustomError.fromJson(_json["customError"]); |
| 3118 } |
| 3119 if (_json.containsKey("documentation")) { |
| 3120 documentation = new Documentation.fromJson(_json["documentation"]); |
| 3121 } |
| 3122 if (_json.containsKey("endpoints")) { |
| 3123 endpoints = _json["endpoints"].map((value) => new Endpoint.fromJson(value)
).toList(); |
| 3124 } |
| 3125 if (_json.containsKey("enums")) { |
| 3126 enums = _json["enums"].map((value) => new Enum.fromJson(value)).toList(); |
| 3127 } |
| 3128 if (_json.containsKey("http")) { |
| 3129 http = new Http.fromJson(_json["http"]); |
| 3130 } |
| 3131 if (_json.containsKey("id")) { |
| 3132 id = _json["id"]; |
| 3133 } |
| 3134 if (_json.containsKey("logging")) { |
| 3135 logging = new Logging.fromJson(_json["logging"]); |
| 3136 } |
| 3137 if (_json.containsKey("logs")) { |
| 3138 logs = _json["logs"].map((value) => new LogDescriptor.fromJson(value)).toL
ist(); |
| 3139 } |
| 3140 if (_json.containsKey("metrics")) { |
| 3141 metrics = _json["metrics"].map((value) => new MetricDescriptor.fromJson(va
lue)).toList(); |
| 3142 } |
| 3143 if (_json.containsKey("monitoredResources")) { |
| 3144 monitoredResources = _json["monitoredResources"].map((value) => new Monito
redResourceDescriptor.fromJson(value)).toList(); |
| 3145 } |
| 3146 if (_json.containsKey("monitoring")) { |
| 3147 monitoring = new Monitoring.fromJson(_json["monitoring"]); |
| 3148 } |
| 3149 if (_json.containsKey("name")) { |
| 3150 name = _json["name"]; |
| 3151 } |
| 3152 if (_json.containsKey("producerProjectId")) { |
| 3153 producerProjectId = _json["producerProjectId"]; |
| 3154 } |
| 3155 if (_json.containsKey("systemParameters")) { |
| 3156 systemParameters = new SystemParameters.fromJson(_json["systemParameters"]
); |
| 3157 } |
| 3158 if (_json.containsKey("systemTypes")) { |
| 3159 systemTypes = _json["systemTypes"].map((value) => new Type.fromJson(value)
).toList(); |
| 3160 } |
| 3161 if (_json.containsKey("title")) { |
| 3162 title = _json["title"]; |
| 3163 } |
| 3164 if (_json.containsKey("types")) { |
| 3165 types = _json["types"].map((value) => new Type.fromJson(value)).toList(); |
| 3166 } |
| 3167 if (_json.containsKey("usage")) { |
| 3168 usage = new Usage.fromJson(_json["usage"]); |
| 3169 } |
| 3170 if (_json.containsKey("visibility")) { |
| 3171 visibility = new Visibility.fromJson(_json["visibility"]); |
| 3172 } |
| 3173 } |
| 3174 |
| 3175 core.Map toJson() { |
| 3176 var _json = new core.Map(); |
| 3177 if (apis != null) { |
| 3178 _json["apis"] = apis.map((value) => (value).toJson()).toList(); |
| 3179 } |
| 3180 if (authentication != null) { |
| 3181 _json["authentication"] = (authentication).toJson(); |
| 3182 } |
| 3183 if (backend != null) { |
| 3184 _json["backend"] = (backend).toJson(); |
| 3185 } |
| 3186 if (configVersion != null) { |
| 3187 _json["configVersion"] = configVersion; |
| 3188 } |
| 3189 if (context != null) { |
| 3190 _json["context"] = (context).toJson(); |
| 3191 } |
| 3192 if (control != null) { |
| 3193 _json["control"] = (control).toJson(); |
| 3194 } |
| 3195 if (customError != null) { |
| 3196 _json["customError"] = (customError).toJson(); |
| 3197 } |
| 3198 if (documentation != null) { |
| 3199 _json["documentation"] = (documentation).toJson(); |
| 3200 } |
| 3201 if (endpoints != null) { |
| 3202 _json["endpoints"] = endpoints.map((value) => (value).toJson()).toList(); |
| 3203 } |
| 3204 if (enums != null) { |
| 3205 _json["enums"] = enums.map((value) => (value).toJson()).toList(); |
| 3206 } |
| 3207 if (http != null) { |
| 3208 _json["http"] = (http).toJson(); |
| 3209 } |
| 3210 if (id != null) { |
| 3211 _json["id"] = id; |
| 3212 } |
| 3213 if (logging != null) { |
| 3214 _json["logging"] = (logging).toJson(); |
| 3215 } |
| 3216 if (logs != null) { |
| 3217 _json["logs"] = logs.map((value) => (value).toJson()).toList(); |
| 3218 } |
| 3219 if (metrics != null) { |
| 3220 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
| 3221 } |
| 3222 if (monitoredResources != null) { |
| 3223 _json["monitoredResources"] = monitoredResources.map((value) => (value).to
Json()).toList(); |
| 3224 } |
| 3225 if (monitoring != null) { |
| 3226 _json["monitoring"] = (monitoring).toJson(); |
| 3227 } |
| 3228 if (name != null) { |
| 3229 _json["name"] = name; |
| 3230 } |
| 3231 if (producerProjectId != null) { |
| 3232 _json["producerProjectId"] = producerProjectId; |
| 3233 } |
| 3234 if (systemParameters != null) { |
| 3235 _json["systemParameters"] = (systemParameters).toJson(); |
| 3236 } |
| 3237 if (systemTypes != null) { |
| 3238 _json["systemTypes"] = systemTypes.map((value) => (value).toJson()).toList
(); |
| 3239 } |
| 3240 if (title != null) { |
| 3241 _json["title"] = title; |
| 3242 } |
| 3243 if (types != null) { |
| 3244 _json["types"] = types.map((value) => (value).toJson()).toList(); |
| 3245 } |
| 3246 if (usage != null) { |
| 3247 _json["usage"] = (usage).toJson(); |
| 3248 } |
| 3249 if (visibility != null) { |
| 3250 _json["visibility"] = (visibility).toJson(); |
| 3251 } |
| 3252 return _json; |
| 3253 } |
| 3254 } |
| 3255 |
| 3256 /** |
| 3257 * `SourceContext` represents information about the source of a |
| 3258 * protobuf element, like the file in which it is defined. |
| 3259 */ |
| 3260 class SourceContext { |
| 3261 /** |
| 3262 * The path-qualified name of the .proto file that contained the associated |
| 3263 * protobuf element. For example: `"google/protobuf/source_context.proto"`. |
| 3264 */ |
| 3265 core.String fileName; |
| 3266 |
| 3267 SourceContext(); |
| 3268 |
| 3269 SourceContext.fromJson(core.Map _json) { |
| 3270 if (_json.containsKey("fileName")) { |
| 3271 fileName = _json["fileName"]; |
| 3272 } |
| 3273 } |
| 3274 |
| 3275 core.Map toJson() { |
| 3276 var _json = new core.Map(); |
| 3277 if (fileName != null) { |
| 3278 _json["fileName"] = fileName; |
| 3279 } |
| 3280 return _json; |
| 3281 } |
| 3282 } |
| 3283 |
| 3284 /** |
| 3285 * The `Status` type defines a logical error model that is suitable for |
| 3286 * different |
| 3287 * programming environments, including REST APIs and RPC APIs. It is used by |
| 3288 * [gRPC](https://github.com/grpc). The error model is designed to be: |
| 3289 * |
| 3290 * - Simple to use and understand for most users |
| 3291 * - Flexible enough to meet unexpected needs |
| 3292 * |
| 3293 * # Overview |
| 3294 * |
| 3295 * The `Status` message contains three pieces of data: error code, error |
| 3296 * message, |
| 3297 * and error details. The error code should be an enum value of |
| 3298 * google.rpc.Code, but it may accept additional error codes if needed. The |
| 3299 * error message should be a developer-facing English message that helps |
| 3300 * developers *understand* and *resolve* the error. If a localized user-facing |
| 3301 * error message is needed, put the localized message in the error details or |
| 3302 * localize it in the client. The optional error details may contain arbitrary |
| 3303 * information about the error. There is a predefined set of error detail types |
| 3304 * in the package `google.rpc` which can be used for common error conditions. |
| 3305 * |
| 3306 * # Language mapping |
| 3307 * |
| 3308 * The `Status` message is the logical representation of the error model, but it |
| 3309 * is not necessarily the actual wire format. When the `Status` message is |
| 3310 * exposed in different client libraries and different wire protocols, it can be |
| 3311 * mapped differently. For example, it will likely be mapped to some exceptions |
| 3312 * in Java, but more likely mapped to some error codes in C. |
| 3313 * |
| 3314 * # Other uses |
| 3315 * |
| 3316 * The error model and the `Status` message can be used in a variety of |
| 3317 * environments, either with or without APIs, to provide a |
| 3318 * consistent developer experience across different environments. |
| 3319 * |
| 3320 * Example uses of this error model include: |
| 3321 * |
| 3322 * - Partial errors. If a service needs to return partial errors to the client, |
| 3323 * it may embed the `Status` in the normal response to indicate the partial |
| 3324 * errors. |
| 3325 * |
| 3326 * - Workflow errors. A typical workflow has multiple steps. Each step may |
| 3327 * have a `Status` message for error reporting purpose. |
| 3328 * |
| 3329 * - Batch operations. If a client uses batch request and batch response, the |
| 3330 * `Status` message should be used directly inside batch response, one for |
| 3331 * each error sub-response. |
| 3332 * |
| 3333 * - Asynchronous operations. If an API call embeds asynchronous operation |
| 3334 * results in its response, the status of those operations should be |
| 3335 * represented directly using the `Status` message. |
| 3336 * |
| 3337 * - Logging. If some API errors are stored in logs, the message `Status` could |
| 3338 * be used directly after any stripping needed for security/privacy reasons. |
| 3339 */ |
| 3340 class Status { |
| 3341 /** The status code, which should be an enum value of google.rpc.Code. */ |
| 3342 core.int code; |
| 3343 /** |
| 3344 * A list of messages that carry the error details. There will be a |
| 3345 * common set of message types for APIs to use. |
| 3346 * |
| 3347 * The values for Object must be JSON objects. It can consist of `num`, |
| 3348 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 3349 */ |
| 3350 core.List<core.Map<core.String, core.Object>> details; |
| 3351 /** |
| 3352 * A developer-facing error message, which should be in English. Any |
| 3353 * user-facing error message should be localized and sent in the |
| 3354 * google.rpc.Status.details field, or localized by the client. |
| 3355 */ |
| 3356 core.String message; |
| 3357 |
| 3358 Status(); |
| 3359 |
| 3360 Status.fromJson(core.Map _json) { |
| 3361 if (_json.containsKey("code")) { |
| 3362 code = _json["code"]; |
| 3363 } |
| 3364 if (_json.containsKey("details")) { |
| 3365 details = _json["details"]; |
| 3366 } |
| 3367 if (_json.containsKey("message")) { |
| 3368 message = _json["message"]; |
| 3369 } |
| 3370 } |
| 3371 |
| 3372 core.Map toJson() { |
| 3373 var _json = new core.Map(); |
| 3374 if (code != null) { |
| 3375 _json["code"] = code; |
| 3376 } |
| 3377 if (details != null) { |
| 3378 _json["details"] = details; |
| 3379 } |
| 3380 if (message != null) { |
| 3381 _json["message"] = message; |
| 3382 } |
| 3383 return _json; |
| 3384 } |
| 3385 } |
| 3386 |
| 3387 /** |
| 3388 * Define a parameter's name and location. The parameter may be passed as either |
| 3389 * an HTTP header or a URL query parameter, and if both are passed the behavior |
| 3390 * is implementation-dependent. |
| 3391 */ |
| 3392 class SystemParameter { |
| 3393 /** |
| 3394 * Define the HTTP header name to use for the parameter. It is case |
| 3395 * insensitive. |
| 3396 */ |
| 3397 core.String httpHeader; |
| 3398 /** |
| 3399 * Define the name of the parameter, such as "api_key" . It is case sensitive. |
| 3400 */ |
| 3401 core.String name; |
| 3402 /** |
| 3403 * Define the URL query parameter name to use for the parameter. It is case |
| 3404 * sensitive. |
| 3405 */ |
| 3406 core.String urlQueryParameter; |
| 3407 |
| 3408 SystemParameter(); |
| 3409 |
| 3410 SystemParameter.fromJson(core.Map _json) { |
| 3411 if (_json.containsKey("httpHeader")) { |
| 3412 httpHeader = _json["httpHeader"]; |
| 3413 } |
| 3414 if (_json.containsKey("name")) { |
| 3415 name = _json["name"]; |
| 3416 } |
| 3417 if (_json.containsKey("urlQueryParameter")) { |
| 3418 urlQueryParameter = _json["urlQueryParameter"]; |
| 3419 } |
| 3420 } |
| 3421 |
| 3422 core.Map toJson() { |
| 3423 var _json = new core.Map(); |
| 3424 if (httpHeader != null) { |
| 3425 _json["httpHeader"] = httpHeader; |
| 3426 } |
| 3427 if (name != null) { |
| 3428 _json["name"] = name; |
| 3429 } |
| 3430 if (urlQueryParameter != null) { |
| 3431 _json["urlQueryParameter"] = urlQueryParameter; |
| 3432 } |
| 3433 return _json; |
| 3434 } |
| 3435 } |
| 3436 |
| 3437 /** |
| 3438 * Define a system parameter rule mapping system parameter definitions to |
| 3439 * methods. |
| 3440 */ |
| 3441 class SystemParameterRule { |
| 3442 /** |
| 3443 * Define parameters. Multiple names may be defined for a parameter. |
| 3444 * For a given method call, only one of them should be used. If multiple |
| 3445 * names are used the behavior is implementation-dependent. |
| 3446 * If none of the specified names are present the behavior is |
| 3447 * parameter-dependent. |
| 3448 */ |
| 3449 core.List<SystemParameter> parameters; |
| 3450 /** |
| 3451 * Selects the methods to which this rule applies. Use '*' to indicate all |
| 3452 * methods in all APIs. |
| 3453 * |
| 3454 * Refer to selector for syntax details. |
| 3455 */ |
| 3456 core.String selector; |
| 3457 |
| 3458 SystemParameterRule(); |
| 3459 |
| 3460 SystemParameterRule.fromJson(core.Map _json) { |
| 3461 if (_json.containsKey("parameters")) { |
| 3462 parameters = _json["parameters"].map((value) => new SystemParameter.fromJs
on(value)).toList(); |
| 3463 } |
| 3464 if (_json.containsKey("selector")) { |
| 3465 selector = _json["selector"]; |
| 3466 } |
| 3467 } |
| 3468 |
| 3469 core.Map toJson() { |
| 3470 var _json = new core.Map(); |
| 3471 if (parameters != null) { |
| 3472 _json["parameters"] = parameters.map((value) => (value).toJson()).toList()
; |
| 3473 } |
| 3474 if (selector != null) { |
| 3475 _json["selector"] = selector; |
| 3476 } |
| 3477 return _json; |
| 3478 } |
| 3479 } |
| 3480 |
| 3481 /** |
| 3482 * ### System parameter configuration |
| 3483 * |
| 3484 * A system parameter is a special kind of parameter defined by the API |
| 3485 * system, not by an individual API. It is typically mapped to an HTTP header |
| 3486 * and/or a URL query parameter. This configuration specifies which methods |
| 3487 * change the names of the system parameters. |
| 3488 */ |
| 3489 class SystemParameters { |
| 3490 /** |
| 3491 * Define system parameters. |
| 3492 * |
| 3493 * The parameters defined here will override the default parameters |
| 3494 * implemented by the system. If this field is missing from the service |
| 3495 * config, default system parameters will be used. Default system parameters |
| 3496 * and names is implementation-dependent. |
| 3497 * |
| 3498 * Example: define api key for all methods |
| 3499 * |
| 3500 * system_parameters |
| 3501 * rules: |
| 3502 * - selector: "*" |
| 3503 * parameters: |
| 3504 * - name: api_key |
| 3505 * url_query_parameter: api_key |
| 3506 * |
| 3507 * |
| 3508 * Example: define 2 api key names for a specific method. |
| 3509 * |
| 3510 * system_parameters |
| 3511 * rules: |
| 3512 * - selector: "/ListShelves" |
| 3513 * parameters: |
| 3514 * - name: api_key |
| 3515 * http_header: Api-Key1 |
| 3516 * - name: api_key |
| 3517 * http_header: Api-Key2 |
| 3518 * |
| 3519 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 3520 */ |
| 3521 core.List<SystemParameterRule> rules; |
| 3522 |
| 3523 SystemParameters(); |
| 3524 |
| 3525 SystemParameters.fromJson(core.Map _json) { |
| 3526 if (_json.containsKey("rules")) { |
| 3527 rules = _json["rules"].map((value) => new SystemParameterRule.fromJson(val
ue)).toList(); |
| 3528 } |
| 3529 } |
| 3530 |
| 3531 core.Map toJson() { |
| 3532 var _json = new core.Map(); |
| 3533 if (rules != null) { |
| 3534 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 3535 } |
| 3536 return _json; |
| 3537 } |
| 3538 } |
| 3539 |
| 3540 /** A protocol buffer message type. */ |
| 3541 class Type { |
| 3542 /** The list of fields. */ |
| 3543 core.List<Field> fields; |
| 3544 /** The fully qualified message name. */ |
| 3545 core.String name; |
| 3546 /** The list of types appearing in `oneof` definitions in this type. */ |
| 3547 core.List<core.String> oneofs; |
| 3548 /** The protocol buffer options. */ |
| 3549 core.List<Option> options; |
| 3550 /** The source context. */ |
| 3551 SourceContext sourceContext; |
| 3552 /** |
| 3553 * The source syntax. |
| 3554 * Possible string values are: |
| 3555 * - "SYNTAX_PROTO2" : Syntax `proto2`. |
| 3556 * - "SYNTAX_PROTO3" : Syntax `proto3`. |
| 3557 */ |
| 3558 core.String syntax; |
| 3559 |
| 3560 Type(); |
| 3561 |
| 3562 Type.fromJson(core.Map _json) { |
| 3563 if (_json.containsKey("fields")) { |
| 3564 fields = _json["fields"].map((value) => new Field.fromJson(value)).toList(
); |
| 3565 } |
| 3566 if (_json.containsKey("name")) { |
| 3567 name = _json["name"]; |
| 3568 } |
| 3569 if (_json.containsKey("oneofs")) { |
| 3570 oneofs = _json["oneofs"]; |
| 3571 } |
| 3572 if (_json.containsKey("options")) { |
| 3573 options = _json["options"].map((value) => new Option.fromJson(value)).toLi
st(); |
| 3574 } |
| 3575 if (_json.containsKey("sourceContext")) { |
| 3576 sourceContext = new SourceContext.fromJson(_json["sourceContext"]); |
| 3577 } |
| 3578 if (_json.containsKey("syntax")) { |
| 3579 syntax = _json["syntax"]; |
| 3580 } |
| 3581 } |
| 3582 |
| 3583 core.Map toJson() { |
| 3584 var _json = new core.Map(); |
| 3585 if (fields != null) { |
| 3586 _json["fields"] = fields.map((value) => (value).toJson()).toList(); |
| 3587 } |
| 3588 if (name != null) { |
| 3589 _json["name"] = name; |
| 3590 } |
| 3591 if (oneofs != null) { |
| 3592 _json["oneofs"] = oneofs; |
| 3593 } |
| 3594 if (options != null) { |
| 3595 _json["options"] = options.map((value) => (value).toJson()).toList(); |
| 3596 } |
| 3597 if (sourceContext != null) { |
| 3598 _json["sourceContext"] = (sourceContext).toJson(); |
| 3599 } |
| 3600 if (syntax != null) { |
| 3601 _json["syntax"] = syntax; |
| 3602 } |
| 3603 return _json; |
| 3604 } |
| 3605 } |
| 3606 |
| 3607 /** Configuration controlling usage of a service. */ |
| 3608 class Usage { |
| 3609 /** |
| 3610 * The full resource name of a channel used for sending notifications to the |
| 3611 * service producer. |
| 3612 * |
| 3613 * Google Service Management currently only supports |
| 3614 * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification |
| 3615 * channel. To use Google Cloud Pub/Sub as the channel, this must be the name |
| 3616 * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format |
| 3617 * documented in https://cloud.google.com/pubsub/docs/overview. |
| 3618 */ |
| 3619 core.String producerNotificationChannel; |
| 3620 /** |
| 3621 * Requirements that must be satisfied before a consumer project can use the |
| 3622 * service. Each requirement is of the form <service.name>/<requirement-id>; |
| 3623 * for example 'serviceusage.googleapis.com/billing-enabled'. |
| 3624 */ |
| 3625 core.List<core.String> requirements; |
| 3626 /** |
| 3627 * A list of usage rules that apply to individual API methods. |
| 3628 * |
| 3629 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 3630 */ |
| 3631 core.List<UsageRule> rules; |
| 3632 |
| 3633 Usage(); |
| 3634 |
| 3635 Usage.fromJson(core.Map _json) { |
| 3636 if (_json.containsKey("producerNotificationChannel")) { |
| 3637 producerNotificationChannel = _json["producerNotificationChannel"]; |
| 3638 } |
| 3639 if (_json.containsKey("requirements")) { |
| 3640 requirements = _json["requirements"]; |
| 3641 } |
| 3642 if (_json.containsKey("rules")) { |
| 3643 rules = _json["rules"].map((value) => new UsageRule.fromJson(value)).toLis
t(); |
| 3644 } |
| 3645 } |
| 3646 |
| 3647 core.Map toJson() { |
| 3648 var _json = new core.Map(); |
| 3649 if (producerNotificationChannel != null) { |
| 3650 _json["producerNotificationChannel"] = producerNotificationChannel; |
| 3651 } |
| 3652 if (requirements != null) { |
| 3653 _json["requirements"] = requirements; |
| 3654 } |
| 3655 if (rules != null) { |
| 3656 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 3657 } |
| 3658 return _json; |
| 3659 } |
| 3660 } |
| 3661 |
| 3662 /** |
| 3663 * Usage configuration rules for the service. |
| 3664 * |
| 3665 * NOTE: Under development. |
| 3666 * |
| 3667 * |
| 3668 * Use this rule to configure unregistered calls for the service. Unregistered |
| 3669 * calls are calls that do not contain consumer project identity. |
| 3670 * (Example: calls that do not contain an API key). |
| 3671 * By default, API methods do not allow unregistered calls, and each method call |
| 3672 * must be identified by a consumer project identity. Use this rule to |
| 3673 * allow/disallow unregistered calls. |
| 3674 * |
| 3675 * Example of an API that wants to allow unregistered calls for entire service. |
| 3676 * |
| 3677 * usage: |
| 3678 * rules: |
| 3679 * - selector: "*" |
| 3680 * allow_unregistered_calls: true |
| 3681 * |
| 3682 * Example of a method that wants to allow unregistered calls. |
| 3683 * |
| 3684 * usage: |
| 3685 * rules: |
| 3686 * - selector: "google.example.library.v1.LibraryService.CreateBook" |
| 3687 * allow_unregistered_calls: true |
| 3688 */ |
| 3689 class UsageRule { |
| 3690 /** True, if the method allows unregistered calls; false otherwise. */ |
| 3691 core.bool allowUnregisteredCalls; |
| 3692 /** |
| 3693 * Selects the methods to which this rule applies. Use '*' to indicate all |
| 3694 * methods in all APIs. |
| 3695 * |
| 3696 * Refer to selector for syntax details. |
| 3697 */ |
| 3698 core.String selector; |
| 3699 |
| 3700 UsageRule(); |
| 3701 |
| 3702 UsageRule.fromJson(core.Map _json) { |
| 3703 if (_json.containsKey("allowUnregisteredCalls")) { |
| 3704 allowUnregisteredCalls = _json["allowUnregisteredCalls"]; |
| 3705 } |
| 3706 if (_json.containsKey("selector")) { |
| 3707 selector = _json["selector"]; |
| 3708 } |
| 3709 } |
| 3710 |
| 3711 core.Map toJson() { |
| 3712 var _json = new core.Map(); |
| 3713 if (allowUnregisteredCalls != null) { |
| 3714 _json["allowUnregisteredCalls"] = allowUnregisteredCalls; |
| 3715 } |
| 3716 if (selector != null) { |
| 3717 _json["selector"] = selector; |
| 3718 } |
| 3719 return _json; |
| 3720 } |
| 3721 } |
| 3722 |
| 3723 /** |
| 3724 * `Visibility` defines restrictions for the visibility of service |
| 3725 * elements. Restrictions are specified using visibility labels |
| 3726 * (e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects. |
| 3727 * |
| 3728 * Users and projects can have access to more than one visibility label. The |
| 3729 * effective visibility for multiple labels is the union of each label's |
| 3730 * elements, plus any unrestricted elements. |
| 3731 * |
| 3732 * If an element and its parents have no restrictions, visibility is |
| 3733 * unconditionally granted. |
| 3734 * |
| 3735 * Example: |
| 3736 * |
| 3737 * visibility: |
| 3738 * rules: |
| 3739 * - selector: google.calendar.Calendar.EnhancedSearch |
| 3740 * restriction: TRUSTED_TESTER |
| 3741 * - selector: google.calendar.Calendar.Delegate |
| 3742 * restriction: GOOGLE_INTERNAL |
| 3743 * |
| 3744 * Here, all methods are publicly visible except for the restricted methods |
| 3745 * EnhancedSearch and Delegate. |
| 3746 */ |
| 3747 class Visibility { |
| 3748 /** |
| 3749 * A list of visibility rules that apply to individual API elements. |
| 3750 * |
| 3751 * **NOTE:** All service configuration rules follow "last one wins" order. |
| 3752 */ |
| 3753 core.List<VisibilityRule> rules; |
| 3754 |
| 3755 Visibility(); |
| 3756 |
| 3757 Visibility.fromJson(core.Map _json) { |
| 3758 if (_json.containsKey("rules")) { |
| 3759 rules = _json["rules"].map((value) => new VisibilityRule.fromJson(value)).
toList(); |
| 3760 } |
| 3761 } |
| 3762 |
| 3763 core.Map toJson() { |
| 3764 var _json = new core.Map(); |
| 3765 if (rules != null) { |
| 3766 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 3767 } |
| 3768 return _json; |
| 3769 } |
| 3770 } |
| 3771 |
| 3772 /** |
| 3773 * A visibility rule provides visibility configuration for an individual API |
| 3774 * element. |
| 3775 */ |
| 3776 class VisibilityRule { |
| 3777 /** |
| 3778 * A comma-separated list of visibility labels that apply to the `selector`. |
| 3779 * Any of the listed labels can be used to grant the visibility. |
| 3780 * |
| 3781 * If a rule has multiple labels, removing one of the labels but not all of |
| 3782 * them can break clients. |
| 3783 * |
| 3784 * Example: |
| 3785 * |
| 3786 * visibility: |
| 3787 * rules: |
| 3788 * - selector: google.calendar.Calendar.EnhancedSearch |
| 3789 * restriction: GOOGLE_INTERNAL, TRUSTED_TESTER |
| 3790 * |
| 3791 * Removing GOOGLE_INTERNAL from this restriction will break clients that |
| 3792 * rely on this method and only had access to it through GOOGLE_INTERNAL. |
| 3793 */ |
| 3794 core.String restriction; |
| 3795 /** |
| 3796 * Selects methods, messages, fields, enums, etc. to which this rule applies. |
| 3797 * |
| 3798 * Refer to selector for syntax details. |
| 3799 */ |
| 3800 core.String selector; |
| 3801 |
| 3802 VisibilityRule(); |
| 3803 |
| 3804 VisibilityRule.fromJson(core.Map _json) { |
| 3805 if (_json.containsKey("restriction")) { |
| 3806 restriction = _json["restriction"]; |
| 3807 } |
| 3808 if (_json.containsKey("selector")) { |
| 3809 selector = _json["selector"]; |
| 3810 } |
| 3811 } |
| 3812 |
| 3813 core.Map toJson() { |
| 3814 var _json = new core.Map(); |
| 3815 if (restriction != null) { |
| 3816 _json["restriction"] = restriction; |
| 3817 } |
| 3818 if (selector != null) { |
| 3819 _json["selector"] = selector; |
| 3820 } |
| 3821 return _json; |
| 3822 } |
| 3823 } |
OLD | NEW |