OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.cloudbilling.v1; | 3 library googleapis.cloudbilling.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
13 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client cloudbilling/v1'; | 15 const core.String USER_AGENT = 'dart-api-client cloudbilling/v1'; |
16 | 16 |
17 /** | 17 /** |
18 * Allows developers to manage billing for their Google Cloud Platform projects | 18 * Allows developers to manage billing for their Google Cloud Platform projects |
19 * programmatically. | 19 * programmatically. |
20 */ | 20 */ |
21 class CloudbillingApi { | 21 class CloudbillingApi { |
22 /** View and manage your data across Google Cloud Platform services */ | 22 /** View and manage your data across Google Cloud Platform services */ |
23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
24 | 24 |
25 | 25 |
26 final commons.ApiRequester _requester; | 26 final commons.ApiRequester _requester; |
27 | 27 |
28 BillingAccountsResourceApi get billingAccounts => new BillingAccountsResourceA
pi(_requester); | 28 BillingAccountsResourceApi get billingAccounts => new BillingAccountsResourceA
pi(_requester); |
29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | 29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 30 ServicesResourceApi get services => new ServicesResourceApi(_requester); |
30 | 31 |
31 CloudbillingApi(http.Client client, {core.String rootUrl: "https://cloudbillin
g.googleapis.com/", core.String servicePath: ""}) : | 32 CloudbillingApi(http.Client client, {core.String rootUrl: "https://cloudbillin
g.googleapis.com/", core.String servicePath: ""}) : |
32 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 33 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
33 } | 34 } |
34 | 35 |
35 | 36 |
36 class BillingAccountsResourceApi { | 37 class BillingAccountsResourceApi { |
37 final commons.ApiRequester _requester; | 38 final commons.ApiRequester _requester; |
38 | 39 |
39 BillingAccountsProjectsResourceApi get projects => new BillingAccountsProjects
ResourceApi(_requester); | 40 BillingAccountsProjectsResourceApi get projects => new BillingAccountsProjects
ResourceApi(_requester); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 queryParams: _queryParams, | 329 queryParams: _queryParams, |
329 uploadOptions: _uploadOptions, | 330 uploadOptions: _uploadOptions, |
330 uploadMedia: _uploadMedia, | 331 uploadMedia: _uploadMedia, |
331 downloadOptions: _downloadOptions); | 332 downloadOptions: _downloadOptions); |
332 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); | 333 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); |
333 } | 334 } |
334 | 335 |
335 } | 336 } |
336 | 337 |
337 | 338 |
| 339 class ServicesResourceApi { |
| 340 final commons.ApiRequester _requester; |
| 341 |
| 342 ServicesSkusResourceApi get skus => new ServicesSkusResourceApi(_requester); |
| 343 |
| 344 ServicesResourceApi(commons.ApiRequester client) : |
| 345 _requester = client; |
| 346 |
| 347 /** |
| 348 * Lists all public cloud services. |
| 349 * |
| 350 * Request parameters: |
| 351 * |
| 352 * [pageSize] - Requested page size. Defaults to 5000. |
| 353 * |
| 354 * [pageToken] - A token identifying a page of results to return. This should |
| 355 * be a |
| 356 * `next_page_token` value returned from a previous `ListServices` |
| 357 * call. If unspecified, the first page of results is returned. |
| 358 * |
| 359 * Completes with a [ListServicesResponse]. |
| 360 * |
| 361 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 362 * error. |
| 363 * |
| 364 * If the used [http.Client] completes with an error when making a REST call, |
| 365 * this method will complete with the same error. |
| 366 */ |
| 367 async.Future<ListServicesResponse> list({core.int pageSize, core.String pageTo
ken}) { |
| 368 var _url = null; |
| 369 var _queryParams = new core.Map(); |
| 370 var _uploadMedia = null; |
| 371 var _uploadOptions = null; |
| 372 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 373 var _body = null; |
| 374 |
| 375 if (pageSize != null) { |
| 376 _queryParams["pageSize"] = ["${pageSize}"]; |
| 377 } |
| 378 if (pageToken != null) { |
| 379 _queryParams["pageToken"] = [pageToken]; |
| 380 } |
| 381 |
| 382 _url = 'v1/services'; |
| 383 |
| 384 var _response = _requester.request(_url, |
| 385 "GET", |
| 386 body: _body, |
| 387 queryParams: _queryParams, |
| 388 uploadOptions: _uploadOptions, |
| 389 uploadMedia: _uploadMedia, |
| 390 downloadOptions: _downloadOptions); |
| 391 return _response.then((data) => new ListServicesResponse.fromJson(data)); |
| 392 } |
| 393 |
| 394 } |
| 395 |
| 396 |
| 397 class ServicesSkusResourceApi { |
| 398 final commons.ApiRequester _requester; |
| 399 |
| 400 ServicesSkusResourceApi(commons.ApiRequester client) : |
| 401 _requester = client; |
| 402 |
| 403 /** |
| 404 * Lists all publicly available SKUs for a given cloud service. |
| 405 * |
| 406 * Request parameters: |
| 407 * |
| 408 * [parent] - The name of the service. |
| 409 * Example: "services/DA34-426B-A397" |
| 410 * Value must have pattern "^services/[^/]+$". |
| 411 * |
| 412 * [currencyCode] - The ISO 4217 currency code for the pricing info in the |
| 413 * response proto. |
| 414 * Will use the conversion rate as of start_time. |
| 415 * Optional. If not specified USD will be used. |
| 416 * |
| 417 * [endTime] - Optional exclusive end time of the time range for which the |
| 418 * pricing |
| 419 * versions will be returned. Timestamps in the future are not allowed. |
| 420 * Maximum allowable time range is 1 month (31 days). Time range as a whole |
| 421 * is optional. If not specified, the latest pricing will be returned (up to |
| 422 * 12 hours old at most). |
| 423 * |
| 424 * [pageSize] - Requested page size. Defaults to 5000. |
| 425 * |
| 426 * [startTime] - Optional inclusive start time of the time range for which the |
| 427 * pricing |
| 428 * versions will be returned. Timestamps in the future are not allowed. |
| 429 * Maximum allowable time range is 1 month (31 days). Time range as a whole |
| 430 * is optional. If not specified, the latest pricing will be returned (up to |
| 431 * 12 hours old at most). |
| 432 * |
| 433 * [pageToken] - A token identifying a page of results to return. This should |
| 434 * be a |
| 435 * `next_page_token` value returned from a previous `ListSkus` |
| 436 * call. If unspecified, the first page of results is returned. |
| 437 * |
| 438 * Completes with a [ListSkusResponse]. |
| 439 * |
| 440 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 441 * error. |
| 442 * |
| 443 * If the used [http.Client] completes with an error when making a REST call, |
| 444 * this method will complete with the same error. |
| 445 */ |
| 446 async.Future<ListSkusResponse> list(core.String parent, {core.String currencyC
ode, core.String endTime, core.int pageSize, core.String startTime, core.String
pageToken}) { |
| 447 var _url = null; |
| 448 var _queryParams = new core.Map(); |
| 449 var _uploadMedia = null; |
| 450 var _uploadOptions = null; |
| 451 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 452 var _body = null; |
| 453 |
| 454 if (parent == null) { |
| 455 throw new core.ArgumentError("Parameter parent is required."); |
| 456 } |
| 457 if (currencyCode != null) { |
| 458 _queryParams["currencyCode"] = [currencyCode]; |
| 459 } |
| 460 if (endTime != null) { |
| 461 _queryParams["endTime"] = [endTime]; |
| 462 } |
| 463 if (pageSize != null) { |
| 464 _queryParams["pageSize"] = ["${pageSize}"]; |
| 465 } |
| 466 if (startTime != null) { |
| 467 _queryParams["startTime"] = [startTime]; |
| 468 } |
| 469 if (pageToken != null) { |
| 470 _queryParams["pageToken"] = [pageToken]; |
| 471 } |
| 472 |
| 473 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/skus'; |
| 474 |
| 475 var _response = _requester.request(_url, |
| 476 "GET", |
| 477 body: _body, |
| 478 queryParams: _queryParams, |
| 479 uploadOptions: _uploadOptions, |
| 480 uploadMedia: _uploadMedia, |
| 481 downloadOptions: _downloadOptions); |
| 482 return _response.then((data) => new ListSkusResponse.fromJson(data)); |
| 483 } |
| 484 |
| 485 } |
| 486 |
| 487 |
| 488 |
| 489 /** |
| 490 * Represents the aggregation level and interval for pricing of a single SKU. |
| 491 */ |
| 492 class AggregationInfo { |
| 493 /** |
| 494 * The number of intervals to aggregate over. |
| 495 * Example: If aggregation_level is "DAILY" and aggregation_count is 14, |
| 496 * aggregation will be over 14 days. |
| 497 */ |
| 498 core.int aggregationCount; |
| 499 /** |
| 500 * |
| 501 * Possible string values are: |
| 502 * - "AGGREGATION_INTERVAL_UNSPECIFIED" |
| 503 * - "DAILY" |
| 504 * - "MONTHLY" |
| 505 */ |
| 506 core.String aggregationInterval; |
| 507 /** |
| 508 * |
| 509 * Possible string values are: |
| 510 * - "AGGREGATION_LEVEL_UNSPECIFIED" |
| 511 * - "ACCOUNT" |
| 512 * - "PROJECT" |
| 513 */ |
| 514 core.String aggregationLevel; |
| 515 |
| 516 AggregationInfo(); |
| 517 |
| 518 AggregationInfo.fromJson(core.Map _json) { |
| 519 if (_json.containsKey("aggregationCount")) { |
| 520 aggregationCount = _json["aggregationCount"]; |
| 521 } |
| 522 if (_json.containsKey("aggregationInterval")) { |
| 523 aggregationInterval = _json["aggregationInterval"]; |
| 524 } |
| 525 if (_json.containsKey("aggregationLevel")) { |
| 526 aggregationLevel = _json["aggregationLevel"]; |
| 527 } |
| 528 } |
| 529 |
| 530 core.Map<core.String, core.Object> toJson() { |
| 531 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 532 if (aggregationCount != null) { |
| 533 _json["aggregationCount"] = aggregationCount; |
| 534 } |
| 535 if (aggregationInterval != null) { |
| 536 _json["aggregationInterval"] = aggregationInterval; |
| 537 } |
| 538 if (aggregationLevel != null) { |
| 539 _json["aggregationLevel"] = aggregationLevel; |
| 540 } |
| 541 return _json; |
| 542 } |
| 543 } |
338 | 544 |
339 /** | 545 /** |
340 * A billing account in [Google Cloud | 546 * A billing account in [Google Cloud |
341 * Console](https://console.cloud.google.com/). You can assign a billing account | 547 * Console](https://console.cloud.google.com/). You can assign a billing account |
342 * to one or more projects. | 548 * to one or more projects. |
343 */ | 549 */ |
344 class BillingAccount { | 550 class BillingAccount { |
345 /** | 551 /** |
346 * The display name given to the billing account, such as `My Billing | 552 * The display name given to the billing account, such as `My Billing |
347 * Account`. This name is displayed in the Google Cloud Console. | 553 * Account`. This name is displayed in the Google Cloud Console. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 if (name != null) { | 589 if (name != null) { |
384 _json["name"] = name; | 590 _json["name"] = name; |
385 } | 591 } |
386 if (open != null) { | 592 if (open != null) { |
387 _json["open"] = open; | 593 _json["open"] = open; |
388 } | 594 } |
389 return _json; | 595 return _json; |
390 } | 596 } |
391 } | 597 } |
392 | 598 |
| 599 /** Represents the category hierarchy of a SKU. */ |
| 600 class Category { |
| 601 /** |
| 602 * The type of product the SKU refers to. |
| 603 * Example: "Compute", "Storage", "Network", "ApplicationServices" etc. |
| 604 */ |
| 605 core.String resourceFamily; |
| 606 /** |
| 607 * A group classification for related SKUs. |
| 608 * Example: "RAM", "GPU", "Prediction", "Ops", "GoogleEgress" etc. |
| 609 */ |
| 610 core.String resourceGroup; |
| 611 /** The display name of the service this SKU belongs to. */ |
| 612 core.String serviceDisplayName; |
| 613 /** |
| 614 * Represents how the SKU is consumed. |
| 615 * Example: "OnDemand", "Preemptible", "Commit1Mo", "Commit1Yr" etc. |
| 616 */ |
| 617 core.String usageType; |
| 618 |
| 619 Category(); |
| 620 |
| 621 Category.fromJson(core.Map _json) { |
| 622 if (_json.containsKey("resourceFamily")) { |
| 623 resourceFamily = _json["resourceFamily"]; |
| 624 } |
| 625 if (_json.containsKey("resourceGroup")) { |
| 626 resourceGroup = _json["resourceGroup"]; |
| 627 } |
| 628 if (_json.containsKey("serviceDisplayName")) { |
| 629 serviceDisplayName = _json["serviceDisplayName"]; |
| 630 } |
| 631 if (_json.containsKey("usageType")) { |
| 632 usageType = _json["usageType"]; |
| 633 } |
| 634 } |
| 635 |
| 636 core.Map<core.String, core.Object> toJson() { |
| 637 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 638 if (resourceFamily != null) { |
| 639 _json["resourceFamily"] = resourceFamily; |
| 640 } |
| 641 if (resourceGroup != null) { |
| 642 _json["resourceGroup"] = resourceGroup; |
| 643 } |
| 644 if (serviceDisplayName != null) { |
| 645 _json["serviceDisplayName"] = serviceDisplayName; |
| 646 } |
| 647 if (usageType != null) { |
| 648 _json["usageType"] = usageType; |
| 649 } |
| 650 return _json; |
| 651 } |
| 652 } |
| 653 |
393 /** Response message for `ListBillingAccounts`. */ | 654 /** Response message for `ListBillingAccounts`. */ |
394 class ListBillingAccountsResponse { | 655 class ListBillingAccountsResponse { |
395 /** A list of billing accounts. */ | 656 /** A list of billing accounts. */ |
396 core.List<BillingAccount> billingAccounts; | 657 core.List<BillingAccount> billingAccounts; |
397 /** | 658 /** |
398 * A token to retrieve the next page of results. To retrieve the next page, | 659 * A token to retrieve the next page of results. To retrieve the next page, |
399 * call `ListBillingAccounts` again with the `page_token` field set to this | 660 * call `ListBillingAccounts` again with the `page_token` field set to this |
400 * value. This field is empty if there are no more results to retrieve. | 661 * value. This field is empty if there are no more results to retrieve. |
401 */ | 662 */ |
402 core.String nextPageToken; | 663 core.String nextPageToken; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 if (nextPageToken != null) { | 715 if (nextPageToken != null) { |
455 _json["nextPageToken"] = nextPageToken; | 716 _json["nextPageToken"] = nextPageToken; |
456 } | 717 } |
457 if (projectBillingInfo != null) { | 718 if (projectBillingInfo != null) { |
458 _json["projectBillingInfo"] = projectBillingInfo.map((value) => (value).to
Json()).toList(); | 719 _json["projectBillingInfo"] = projectBillingInfo.map((value) => (value).to
Json()).toList(); |
459 } | 720 } |
460 return _json; | 721 return _json; |
461 } | 722 } |
462 } | 723 } |
463 | 724 |
| 725 /** Response message for `ListServices`. */ |
| 726 class ListServicesResponse { |
| 727 /** |
| 728 * A token to retrieve the next page of results. To retrieve the next page, |
| 729 * call `ListServices` again with the `page_token` field set to this |
| 730 * value. This field is empty if there are no more results to retrieve. |
| 731 */ |
| 732 core.String nextPageToken; |
| 733 /** A list of services. */ |
| 734 core.List<Service> services; |
| 735 |
| 736 ListServicesResponse(); |
| 737 |
| 738 ListServicesResponse.fromJson(core.Map _json) { |
| 739 if (_json.containsKey("nextPageToken")) { |
| 740 nextPageToken = _json["nextPageToken"]; |
| 741 } |
| 742 if (_json.containsKey("services")) { |
| 743 services = _json["services"].map((value) => new Service.fromJson(value)).t
oList(); |
| 744 } |
| 745 } |
| 746 |
| 747 core.Map<core.String, core.Object> toJson() { |
| 748 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 749 if (nextPageToken != null) { |
| 750 _json["nextPageToken"] = nextPageToken; |
| 751 } |
| 752 if (services != null) { |
| 753 _json["services"] = services.map((value) => (value).toJson()).toList(); |
| 754 } |
| 755 return _json; |
| 756 } |
| 757 } |
| 758 |
| 759 /** Response message for `ListSkus`. */ |
| 760 class ListSkusResponse { |
| 761 /** |
| 762 * A token to retrieve the next page of results. To retrieve the next page, |
| 763 * call `ListSkus` again with the `page_token` field set to this |
| 764 * value. This field is empty if there are no more results to retrieve. |
| 765 */ |
| 766 core.String nextPageToken; |
| 767 /** The list of public SKUs of the given service. */ |
| 768 core.List<Sku> skus; |
| 769 |
| 770 ListSkusResponse(); |
| 771 |
| 772 ListSkusResponse.fromJson(core.Map _json) { |
| 773 if (_json.containsKey("nextPageToken")) { |
| 774 nextPageToken = _json["nextPageToken"]; |
| 775 } |
| 776 if (_json.containsKey("skus")) { |
| 777 skus = _json["skus"].map((value) => new Sku.fromJson(value)).toList(); |
| 778 } |
| 779 } |
| 780 |
| 781 core.Map<core.String, core.Object> toJson() { |
| 782 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 783 if (nextPageToken != null) { |
| 784 _json["nextPageToken"] = nextPageToken; |
| 785 } |
| 786 if (skus != null) { |
| 787 _json["skus"] = skus.map((value) => (value).toJson()).toList(); |
| 788 } |
| 789 return _json; |
| 790 } |
| 791 } |
| 792 |
| 793 /** Represents an amount of money with its currency type. */ |
| 794 class Money { |
| 795 /** The 3-letter currency code defined in ISO 4217. */ |
| 796 core.String currencyCode; |
| 797 /** |
| 798 * Number of nano (10^-9) units of the amount. |
| 799 * The value must be between -999,999,999 and +999,999,999 inclusive. |
| 800 * If `units` is positive, `nanos` must be positive or zero. |
| 801 * If `units` is zero, `nanos` can be positive, zero, or negative. |
| 802 * If `units` is negative, `nanos` must be negative or zero. |
| 803 * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 804 */ |
| 805 core.int nanos; |
| 806 /** |
| 807 * The whole units of the amount. |
| 808 * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| 809 */ |
| 810 core.String units; |
| 811 |
| 812 Money(); |
| 813 |
| 814 Money.fromJson(core.Map _json) { |
| 815 if (_json.containsKey("currencyCode")) { |
| 816 currencyCode = _json["currencyCode"]; |
| 817 } |
| 818 if (_json.containsKey("nanos")) { |
| 819 nanos = _json["nanos"]; |
| 820 } |
| 821 if (_json.containsKey("units")) { |
| 822 units = _json["units"]; |
| 823 } |
| 824 } |
| 825 |
| 826 core.Map<core.String, core.Object> toJson() { |
| 827 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 828 if (currencyCode != null) { |
| 829 _json["currencyCode"] = currencyCode; |
| 830 } |
| 831 if (nanos != null) { |
| 832 _json["nanos"] = nanos; |
| 833 } |
| 834 if (units != null) { |
| 835 _json["units"] = units; |
| 836 } |
| 837 return _json; |
| 838 } |
| 839 } |
| 840 |
| 841 /** |
| 842 * Expresses a mathematical pricing formula. For Example:- |
| 843 * |
| 844 * `usage_unit: GBy` |
| 845 * `tiered_rates:` |
| 846 * `[start_usage_amount: 20, unit_price: $10]` |
| 847 * `[start_usage_amount: 100, unit_price: $5]` |
| 848 * |
| 849 * The above expresses a pricing formula where the first 20GB is free, the |
| 850 * next 80GB is priced at $10 per GB followed by $5 per GB for additional |
| 851 * usage. |
| 852 */ |
| 853 class PricingExpression { |
| 854 /** |
| 855 * The base unit for the SKU which is the unit used in usage exports. |
| 856 * Example: "By" |
| 857 */ |
| 858 core.String baseUnit; |
| 859 /** |
| 860 * Conversion factor for converting from price per usage_unit to price per |
| 861 * base_unit, and start_usage_amount to start_usage_amount in base_unit. |
| 862 * unit_price / base_unit_conversion_factor = price per base_unit. |
| 863 * start_usage_amount * base_unit_conversion_factor = start_usage_amount in |
| 864 * base_unit. |
| 865 */ |
| 866 core.double baseUnitConversionFactor; |
| 867 /** |
| 868 * The base unit in human readable form. |
| 869 * Example: "byte". |
| 870 */ |
| 871 core.String baseUnitDescription; |
| 872 /** |
| 873 * The recommended quantity of units for displaying pricing info. When |
| 874 * displaying pricing info it is recommended to display: |
| 875 * (unit_price * display_quantity) per display_quantity usage_unit. |
| 876 * This field does not affect the pricing formula and is for display purposes |
| 877 * only. |
| 878 * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and |
| 879 * the display_quantity is "1000" then the recommended way of displaying the |
| 880 * pricing info is "0.10 USD per 1000 GB" |
| 881 */ |
| 882 core.double displayQuantity; |
| 883 /** |
| 884 * The list of tiered rates for this pricing. The total cost is computed by |
| 885 * applying each of the tiered rates on usage. This repeated list is sorted |
| 886 * by ascending order of start_usage_amount. |
| 887 */ |
| 888 core.List<TierRate> tieredRates; |
| 889 /** |
| 890 * The short hand for unit of usage this pricing is specified in. |
| 891 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". |
| 892 */ |
| 893 core.String usageUnit; |
| 894 /** |
| 895 * The unit of usage in human readable form. |
| 896 * Example: "gibi byte". |
| 897 */ |
| 898 core.String usageUnitDescription; |
| 899 |
| 900 PricingExpression(); |
| 901 |
| 902 PricingExpression.fromJson(core.Map _json) { |
| 903 if (_json.containsKey("baseUnit")) { |
| 904 baseUnit = _json["baseUnit"]; |
| 905 } |
| 906 if (_json.containsKey("baseUnitConversionFactor")) { |
| 907 baseUnitConversionFactor = _json["baseUnitConversionFactor"]; |
| 908 } |
| 909 if (_json.containsKey("baseUnitDescription")) { |
| 910 baseUnitDescription = _json["baseUnitDescription"]; |
| 911 } |
| 912 if (_json.containsKey("displayQuantity")) { |
| 913 displayQuantity = _json["displayQuantity"]; |
| 914 } |
| 915 if (_json.containsKey("tieredRates")) { |
| 916 tieredRates = _json["tieredRates"].map((value) => new TierRate.fromJson(va
lue)).toList(); |
| 917 } |
| 918 if (_json.containsKey("usageUnit")) { |
| 919 usageUnit = _json["usageUnit"]; |
| 920 } |
| 921 if (_json.containsKey("usageUnitDescription")) { |
| 922 usageUnitDescription = _json["usageUnitDescription"]; |
| 923 } |
| 924 } |
| 925 |
| 926 core.Map<core.String, core.Object> toJson() { |
| 927 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 928 if (baseUnit != null) { |
| 929 _json["baseUnit"] = baseUnit; |
| 930 } |
| 931 if (baseUnitConversionFactor != null) { |
| 932 _json["baseUnitConversionFactor"] = baseUnitConversionFactor; |
| 933 } |
| 934 if (baseUnitDescription != null) { |
| 935 _json["baseUnitDescription"] = baseUnitDescription; |
| 936 } |
| 937 if (displayQuantity != null) { |
| 938 _json["displayQuantity"] = displayQuantity; |
| 939 } |
| 940 if (tieredRates != null) { |
| 941 _json["tieredRates"] = tieredRates.map((value) => (value).toJson()).toList
(); |
| 942 } |
| 943 if (usageUnit != null) { |
| 944 _json["usageUnit"] = usageUnit; |
| 945 } |
| 946 if (usageUnitDescription != null) { |
| 947 _json["usageUnitDescription"] = usageUnitDescription; |
| 948 } |
| 949 return _json; |
| 950 } |
| 951 } |
| 952 |
| 953 /** Represents the pricing information for a SKU at a single point of time. */ |
| 954 class PricingInfo { |
| 955 /** |
| 956 * Aggregation Info. This can be left unspecified if the pricing expression |
| 957 * doesn't require aggregation. |
| 958 */ |
| 959 AggregationInfo aggregationInfo; |
| 960 /** |
| 961 * Conversion rate for currency conversion, from USD to the currency specified |
| 962 * in the request. If the currency is not specified this defaults to 1.0. |
| 963 * Example: USD * currency_conversion_rate = JPY |
| 964 */ |
| 965 core.double currencyConversionRate; |
| 966 /** The timestamp from which this pricing was effective. */ |
| 967 core.String effectiveTime; |
| 968 /** Expresses the pricing formula. See `PricingExpression` for an example. */ |
| 969 PricingExpression pricingExpression; |
| 970 /** |
| 971 * An optional human readable summary of the pricing information, has a |
| 972 * maximum length of 256 characters. |
| 973 */ |
| 974 core.String summary; |
| 975 |
| 976 PricingInfo(); |
| 977 |
| 978 PricingInfo.fromJson(core.Map _json) { |
| 979 if (_json.containsKey("aggregationInfo")) { |
| 980 aggregationInfo = new AggregationInfo.fromJson(_json["aggregationInfo"]); |
| 981 } |
| 982 if (_json.containsKey("currencyConversionRate")) { |
| 983 currencyConversionRate = _json["currencyConversionRate"]; |
| 984 } |
| 985 if (_json.containsKey("effectiveTime")) { |
| 986 effectiveTime = _json["effectiveTime"]; |
| 987 } |
| 988 if (_json.containsKey("pricingExpression")) { |
| 989 pricingExpression = new PricingExpression.fromJson(_json["pricingExpressio
n"]); |
| 990 } |
| 991 if (_json.containsKey("summary")) { |
| 992 summary = _json["summary"]; |
| 993 } |
| 994 } |
| 995 |
| 996 core.Map<core.String, core.Object> toJson() { |
| 997 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 998 if (aggregationInfo != null) { |
| 999 _json["aggregationInfo"] = (aggregationInfo).toJson(); |
| 1000 } |
| 1001 if (currencyConversionRate != null) { |
| 1002 _json["currencyConversionRate"] = currencyConversionRate; |
| 1003 } |
| 1004 if (effectiveTime != null) { |
| 1005 _json["effectiveTime"] = effectiveTime; |
| 1006 } |
| 1007 if (pricingExpression != null) { |
| 1008 _json["pricingExpression"] = (pricingExpression).toJson(); |
| 1009 } |
| 1010 if (summary != null) { |
| 1011 _json["summary"] = summary; |
| 1012 } |
| 1013 return _json; |
| 1014 } |
| 1015 } |
| 1016 |
464 /** | 1017 /** |
465 * Encapsulation of billing information for a Cloud Console project. A project | 1018 * Encapsulation of billing information for a Cloud Console project. A project |
466 * has at most one associated billing account at a time (but a billing account | 1019 * has at most one associated billing account at a time (but a billing account |
467 * can be assigned to multiple projects). | 1020 * can be assigned to multiple projects). |
468 */ | 1021 */ |
469 class ProjectBillingInfo { | 1022 class ProjectBillingInfo { |
470 /** | 1023 /** |
471 * The resource name of the billing account associated with the project, if | 1024 * The resource name of the billing account associated with the project, if |
472 * any. For example, `billingAccounts/012345-567890-ABCDEF`. | 1025 * any. For example, `billingAccounts/012345-567890-ABCDEF`. |
473 */ | 1026 */ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 1073 } |
521 if (name != null) { | 1074 if (name != null) { |
522 _json["name"] = name; | 1075 _json["name"] = name; |
523 } | 1076 } |
524 if (projectId != null) { | 1077 if (projectId != null) { |
525 _json["projectId"] = projectId; | 1078 _json["projectId"] = projectId; |
526 } | 1079 } |
527 return _json; | 1080 return _json; |
528 } | 1081 } |
529 } | 1082 } |
| 1083 |
| 1084 /** Encapsulates a single service in Google Cloud Platform. */ |
| 1085 class Service { |
| 1086 /** A human readable display name for this service. */ |
| 1087 core.String displayName; |
| 1088 /** |
| 1089 * The resource name for the service. |
| 1090 * Example: "services/DA34-426B-A397" |
| 1091 */ |
| 1092 core.String name; |
| 1093 /** |
| 1094 * The identifier for the service. |
| 1095 * Example: "DA34-426B-A397" |
| 1096 */ |
| 1097 core.String serviceId; |
| 1098 |
| 1099 Service(); |
| 1100 |
| 1101 Service.fromJson(core.Map _json) { |
| 1102 if (_json.containsKey("displayName")) { |
| 1103 displayName = _json["displayName"]; |
| 1104 } |
| 1105 if (_json.containsKey("name")) { |
| 1106 name = _json["name"]; |
| 1107 } |
| 1108 if (_json.containsKey("serviceId")) { |
| 1109 serviceId = _json["serviceId"]; |
| 1110 } |
| 1111 } |
| 1112 |
| 1113 core.Map<core.String, core.Object> toJson() { |
| 1114 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1115 if (displayName != null) { |
| 1116 _json["displayName"] = displayName; |
| 1117 } |
| 1118 if (name != null) { |
| 1119 _json["name"] = name; |
| 1120 } |
| 1121 if (serviceId != null) { |
| 1122 _json["serviceId"] = serviceId; |
| 1123 } |
| 1124 return _json; |
| 1125 } |
| 1126 } |
| 1127 |
| 1128 /** Encapsulates a single SKU in Google Cloud Platform */ |
| 1129 class Sku { |
| 1130 /** The category hierarchy of this SKU, purely for organizational purpose. */ |
| 1131 Category category; |
| 1132 /** |
| 1133 * A human readable description of the SKU, has a maximum length of 256 |
| 1134 * characters. |
| 1135 */ |
| 1136 core.String description; |
| 1137 /** |
| 1138 * The resource name for the SKU. |
| 1139 * Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE" |
| 1140 */ |
| 1141 core.String name; |
| 1142 /** A timeline of pricing info for this SKU in chronological order. */ |
| 1143 core.List<PricingInfo> pricingInfo; |
| 1144 /** |
| 1145 * Identifies the service provider. |
| 1146 * This is 'Google' for first party services in Google Cloud Platform. |
| 1147 */ |
| 1148 core.String serviceProviderName; |
| 1149 /** |
| 1150 * List of service regions this SKU is offered at. |
| 1151 * Example: "asia-east1" |
| 1152 * Service regions can be found at https://cloud.google.com/about/locations/ |
| 1153 */ |
| 1154 core.List<core.String> serviceRegions; |
| 1155 /** |
| 1156 * The identifier for the SKU. |
| 1157 * Example: "AA95-CD31-42FE" |
| 1158 */ |
| 1159 core.String skuId; |
| 1160 |
| 1161 Sku(); |
| 1162 |
| 1163 Sku.fromJson(core.Map _json) { |
| 1164 if (_json.containsKey("category")) { |
| 1165 category = new Category.fromJson(_json["category"]); |
| 1166 } |
| 1167 if (_json.containsKey("description")) { |
| 1168 description = _json["description"]; |
| 1169 } |
| 1170 if (_json.containsKey("name")) { |
| 1171 name = _json["name"]; |
| 1172 } |
| 1173 if (_json.containsKey("pricingInfo")) { |
| 1174 pricingInfo = _json["pricingInfo"].map((value) => new PricingInfo.fromJson
(value)).toList(); |
| 1175 } |
| 1176 if (_json.containsKey("serviceProviderName")) { |
| 1177 serviceProviderName = _json["serviceProviderName"]; |
| 1178 } |
| 1179 if (_json.containsKey("serviceRegions")) { |
| 1180 serviceRegions = _json["serviceRegions"]; |
| 1181 } |
| 1182 if (_json.containsKey("skuId")) { |
| 1183 skuId = _json["skuId"]; |
| 1184 } |
| 1185 } |
| 1186 |
| 1187 core.Map<core.String, core.Object> toJson() { |
| 1188 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1189 if (category != null) { |
| 1190 _json["category"] = (category).toJson(); |
| 1191 } |
| 1192 if (description != null) { |
| 1193 _json["description"] = description; |
| 1194 } |
| 1195 if (name != null) { |
| 1196 _json["name"] = name; |
| 1197 } |
| 1198 if (pricingInfo != null) { |
| 1199 _json["pricingInfo"] = pricingInfo.map((value) => (value).toJson()).toList
(); |
| 1200 } |
| 1201 if (serviceProviderName != null) { |
| 1202 _json["serviceProviderName"] = serviceProviderName; |
| 1203 } |
| 1204 if (serviceRegions != null) { |
| 1205 _json["serviceRegions"] = serviceRegions; |
| 1206 } |
| 1207 if (skuId != null) { |
| 1208 _json["skuId"] = skuId; |
| 1209 } |
| 1210 return _json; |
| 1211 } |
| 1212 } |
| 1213 |
| 1214 /** The price rate indicating starting usage and its corresponding price. */ |
| 1215 class TierRate { |
| 1216 /** |
| 1217 * Usage is priced at this rate only after this amount. |
| 1218 * Example: start_usage_amount of 10 indicates that the usage will be priced |
| 1219 * at the unit_price after the first 10 usage_units. |
| 1220 */ |
| 1221 core.double startUsageAmount; |
| 1222 /** |
| 1223 * The price per unit of usage. |
| 1224 * Example: unit_price of amount $10 indicates that each unit will cost $10. |
| 1225 */ |
| 1226 Money unitPrice; |
| 1227 |
| 1228 TierRate(); |
| 1229 |
| 1230 TierRate.fromJson(core.Map _json) { |
| 1231 if (_json.containsKey("startUsageAmount")) { |
| 1232 startUsageAmount = _json["startUsageAmount"]; |
| 1233 } |
| 1234 if (_json.containsKey("unitPrice")) { |
| 1235 unitPrice = new Money.fromJson(_json["unitPrice"]); |
| 1236 } |
| 1237 } |
| 1238 |
| 1239 core.Map<core.String, core.Object> toJson() { |
| 1240 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1241 if (startUsageAmount != null) { |
| 1242 _json["startUsageAmount"] = startUsageAmount; |
| 1243 } |
| 1244 if (unitPrice != null) { |
| 1245 _json["unitPrice"] = (unitPrice).toJson(); |
| 1246 } |
| 1247 return _json; |
| 1248 } |
| 1249 } |
OLD | NEW |