Generate APIs
diff --git a/generated/googleapis_beta/lib/adexchangebuyer2/v2beta1.dart b/generated/googleapis_beta/lib/adexchangebuyer2/v2beta1.dart index 58c7269..683ce08 100644 --- a/generated/googleapis_beta/lib/adexchangebuyer2/v2beta1.dart +++ b/generated/googleapis_beta/lib/adexchangebuyer2/v2beta1.dart
@@ -1773,6 +1773,8 @@ /// If the number does not match the server's revision number an `ABORTED` /// error message will be returned. This call updates the proposal_state from /// `PROPOSED` to `BUYER_ACCEPTED`, or from `SELLER_ACCEPTED` to `FINALIZED`. + /// Upon calling this endpoint, the buyer implicitly agrees to the terms and + /// conditions optionally set within the proposal by the publisher. /// /// [request] - The metadata request object. /// @@ -6573,30 +6575,30 @@ } } -/// Represents a whole or partial calendar date, e.g. a birthday. +/// Represents a whole or partial calendar date, such as a birthday. /// -/// The time of day and time zone are either specified elsewhere or are not -/// significant. The date is relative to the Proleptic Gregorian Calendar. This -/// can represent: * A full date, with non-zero year, month and day values * A -/// month and day value, with a zero year, e.g. an anniversary * A year on its -/// own, with zero month and day values * A year and month value, with a zero -/// day, e.g. a credit card expiration date Related types are -/// google.type.TimeOfDay and `google.protobuf.Timestamp`. +/// The time of day and time zone are either specified elsewhere or are +/// insignificant. The date is relative to the Gregorian Calendar. This can +/// represent one of the following: * A full date, with non-zero year, month, +/// and day values * A month and day value, with a zero year, such as an +/// anniversary * A year on its own, with zero month and day values * A year and +/// month value, with a zero day, such as a credit card expiration date Related +/// types are google.type.TimeOfDay and `google.protobuf.Timestamp`. class Date { - /// Day of month. + /// Day of a month. /// - /// Must be from 1 to 31 and valid for the year and month, or 0 if specifying - /// a year by itself or a year and month where the day is not significant. + /// Must be from 1 to 31 and valid for the year and month, or 0 to specify a + /// year by itself or a year and month where the day isn't significant. core.int day; - /// Month of year. + /// Month of a year. /// - /// Must be from 1 to 12, or 0 if specifying a year without a month and day. + /// Must be from 1 to 12, or 0 to specify a year without a month and day. core.int month; - /// Year of date. + /// Year of the date. /// - /// Must be from 1 to 9999, or 0 if specifying a date without a year. + /// Must be from 1 to 9999, or 0 to specify a date without a year. core.int year; Date(); @@ -6739,12 +6741,14 @@ /// required for Private Auction deals or Preferred Deals. core.String availableEndTime; - /// Optional proposed flight start time of the deal. + /// Proposed flight start time of the deal. /// /// This will generally be stored in the granularity of one second since deal /// serving starts at seconds boundary. Any time specified with more /// granularity (e.g., in milliseconds) will be truncated towards the start of /// time in seconds. + /// + /// Optional. core.String availableStartTime; /// Buyer private data (hidden from seller). @@ -6756,12 +6760,14 @@ /// this field while updating the resource will result in an error. core.String createProductId; - /// Optional revision number of the product that the deal was created from. + /// Revision number of the product that the deal was created from. /// - /// If present on create, and the server `product_revision` has advanced - /// sinced the passed-in `create_product_revision`, an `ABORTED` error will be + /// If present on create, and the server `product_revision` has advanced since + /// the passed-in `create_product_revision`, an `ABORTED` error will be /// returned. Note: This field may be set only when creating the resource. /// Modifying this field while updating the resource will result in an error. + /// + /// Optional. core.String createProductRevision; /// The time of the deal creation. @@ -8523,6 +8529,7 @@ /// \[publisher-excludable-creative-attributes\](https://developers.google.com/authorized-buyers/rtb/downloads/publisher-excludable-creative-attributes). /// - "VENDOR" : Indicates that the detail ID refers to a vendor; see /// [vendors](https://developers.google.com/authorized-buyers/rtb/downloads/vendors). + /// This namespace is different from that of the `ATP_VENDOR` detail type. /// - "SENSITIVE_CATEGORY" : Indicates that the detail ID refers to a /// sensitive category; see /// \[ad-sensitive-categories\](https://developers.google.com/authorized-buyers/rtb/downloads/ad-sensitive-categories). @@ -8533,6 +8540,14 @@ /// disapproval reason; see DisapprovalReason enum in /// \[snippet-status-report-proto\](https://developers.google.com/authorized-buyers/rtb/downloads/snippet-status-report-proto). /// - "POLICY_TOPIC" : Indicates that the detail ID refers to a policy topic. + /// - "ATP_VENDOR" : Indicates that the detail ID refers to an ad technology + /// provider (ATP); see + /// [providers](https://storage.googleapis.com/adx-rtb-dictionaries/providers.csv). + /// This namespace is different from the `VENDOR` detail type; see + /// [ad technology providers](https://support.google.com/admanager/answer/9012903) + /// for more information. + /// - "VENDOR_DOMAIN" : Indicates that the detail string refers the domain of + /// an unknown vendor. core.String detailType; /// List of rows, with counts of bids with a given creative status aggregated @@ -9167,7 +9182,7 @@ /// Represents an amount of money with its currency type. class Money { - /// The 3-letter currency code defined in ISO 4217. + /// The three-letter currency code defined in ISO 4217. core.String currencyCode; /// Number of nano (10^-9) units of the amount. @@ -10100,6 +10115,11 @@ /// Output only. core.List<ContactInformation> sellerContacts; + /// The terms and conditions set by the publisher for this proposal. + /// + /// Output only. + core.String termsAndConditions; + /// The time when the proposal was last revised. /// /// Output only. @@ -10176,6 +10196,9 @@ value as core.Map<core.String, core.dynamic>)) .toList(); } + if (_json.containsKey('termsAndConditions')) { + termsAndConditions = _json['termsAndConditions'] as core.String; + } if (_json.containsKey('updateTime')) { updateTime = _json['updateTime'] as core.String; } @@ -10236,6 +10259,9 @@ _json['sellerContacts'] = sellerContacts.map((value) => value.toJson()).toList(); } + if (termsAndConditions != null) { + _json['termsAndConditions'] = termsAndConditions; + } if (updateTime != null) { _json['updateTime'] = updateTime; } @@ -10296,6 +10322,11 @@ /// URL to additional marketing and sales materials. core.String mediaKitUrl; + /// The list of apps represented in this publisher profile. + /// + /// Empty if this is a parent profile. + core.List<PublisherProfileMobileApplication> mobileApps; + /// Overview of the publisher. core.String overview; @@ -10355,6 +10386,13 @@ if (_json.containsKey('mediaKitUrl')) { mediaKitUrl = _json['mediaKitUrl'] as core.String; } + if (_json.containsKey('mobileApps')) { + mobileApps = (_json['mobileApps'] as core.List) + .map<PublisherProfileMobileApplication>((value) => + PublisherProfileMobileApplication.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } if (_json.containsKey('overview')) { overview = _json['overview'] as core.String; } @@ -10411,6 +10449,9 @@ if (mediaKitUrl != null) { _json['mediaKitUrl'] = mediaKitUrl; } + if (mobileApps != null) { + _json['mobileApps'] = mobileApps.map((value) => value.toJson()).toList(); + } if (overview != null) { _json['overview'] = overview; } @@ -10436,6 +10477,60 @@ } } +/// A mobile application that contains a external app ID, name, and app store. +class PublisherProfileMobileApplication { + /// The app store the app belongs to. + /// Possible string values are: + /// - "APP_STORE_TYPE_UNSPECIFIED" : A placeholder for an unknown app store. + /// - "APPLE_ITUNES" : Apple iTunes + /// - "GOOGLE_PLAY" : Google Play + /// - "ROKU" : Roku + /// - "AMAZON_FIRETV" : Amazon Fire TV + /// - "PLAYSTATION" : Playstation + /// - "XBOX" : Xbox + /// - "SAMSUNG_TV" : Samsung TV + /// - "AMAZON" : Amazon Appstore + /// - "OPPO" : OPPO App Market + /// - "SAMSUNG" : Samsung Galaxy Store + /// - "VIVO" : VIVO App Store + /// - "XIAOMI" : Xiaomi GetApps + core.String appStore; + + /// The external ID for the app from its app store. + core.String externalAppId; + + /// The name of the app. + core.String name; + + PublisherProfileMobileApplication(); + + PublisherProfileMobileApplication.fromJson(core.Map _json) { + if (_json.containsKey('appStore')) { + appStore = _json['appStore'] as core.String; + } + if (_json.containsKey('externalAppId')) { + externalAppId = _json['externalAppId'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (appStore != null) { + _json['appStore'] = appStore; + } + if (externalAppId != null) { + _json['externalAppId'] = externalAppId; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + /// An open-ended realtime time range specified by the start timestamp. /// /// For filter sets that specify a realtime time range RTB metrics continue to
diff --git a/generated/googleapis_beta/lib/alertcenter/v1beta1.dart b/generated/googleapis_beta/lib/alertcenter/v1beta1.dart index 6658469..00ab0cb 100644 --- a/generated/googleapis_beta/lib/alertcenter/v1beta1.dart +++ b/generated/googleapis_beta/lib/alertcenter/v1beta1.dart
@@ -15,7 +15,7 @@ // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unnecessary_string_interpolations -/// G Suite Alert Center API - v1beta1 +/// Google Workspace Alert Center API - v1beta1 /// /// Manages alerts on issues affecting your domain. /// @@ -178,9 +178,9 @@ /// /// [alertId] - Required. The identifier of the alert to delete. /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert is associated with. Inferred from the - /// caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert is associated with. + /// Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -238,9 +238,9 @@ /// /// [alertId] - Required. The identifier of the alert to retrieve. /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert is associated with. Inferred from the - /// caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert is associated with. + /// Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -300,9 +300,9 @@ /// [alertId] - Required. The identifier of the alert this metadata belongs /// to. /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert metadata is associated with. Inferred - /// from the caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert metadata is associated + /// with. Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -359,9 +359,9 @@ /// /// Request parameters: /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alerts are associated with. Inferred from the - /// caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alerts are associated with. + /// Inferred from the caller identity if not provided. /// /// [filter] - Optional. A query string for filtering alert results. For more /// details, see \[Query @@ -527,9 +527,9 @@ /// [alertId] - Required. The identifier of the alert this feedback belongs /// to. /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert is associated with. Inferred from the - /// caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert is associated with. + /// Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -596,9 +596,9 @@ /// [alertId] - Required. The alert identifier. The "-" wildcard could be used /// to represent all alerts. /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert feedback are associated with. Inferred - /// from the caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert feedback are associated + /// with. Inferred from the caller identity if not provided. /// /// [filter] - Optional. A query string for filtering alert feedback results. /// For more details, see \[Query @@ -671,9 +671,9 @@ /// /// Request parameters: /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert settings are associated with. Inferred - /// from the caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert settings are associated + /// with. Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -725,9 +725,9 @@ /// /// Request parameters: /// - /// [customerId] - Optional. The unique identifier of the G Suite organization - /// account of the customer the alert settings are associated with. Inferred - /// from the caller identity if not provided. + /// [customerId] - Optional. The unique identifier of the Google Workspace + /// organization account of the customer the alert settings are associated + /// with. Inferred from the caller identity if not provided. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -1036,7 +1036,7 @@ /// The type of the alert. /// /// This is output only after alert is created. For a list of available alert - /// types see \[G Suite Alert + /// types see \[Google Workspace Alert /// types\](/admin-sdk/alertcenter/reference/alert-types). /// /// Required. @@ -1438,8 +1438,8 @@ /// Required. core.List<core.String> alertId; - /// The unique identifier of the G Suite organization account of the customer - /// the alerts are associated with. + /// The unique identifier of the Google Workspace organization account of the + /// customer the alerts are associated with. /// /// Optional. core.String customerId; @@ -1517,8 +1517,8 @@ /// Required. core.List<core.String> alertId; - /// The unique identifier of the G Suite organization account of the customer - /// the alerts are associated with. + /// The unique identifier of the Google Workspace organization account of the + /// customer the alerts are associated with. /// /// Optional. core.String customerId; @@ -2021,6 +2021,12 @@ /// A detailed, freeform incident description. core.String description; + /// A header to display above the incident message. + /// + /// Typcially used to attach a localized notice on the timeline for followup + /// comms translations. + core.String header; + /// A one-line incident description. core.String title; @@ -2039,6 +2045,9 @@ if (_json.containsKey('description')) { description = _json['description'] as core.String; } + if (_json.containsKey('header')) { + header = _json['header'] as core.String; + } if (_json.containsKey('title')) { title = _json['title'] as core.String; } @@ -2055,6 +2064,9 @@ if (description != null) { _json['description'] = description; } + if (header != null) { + _json['header'] = header; + } if (title != null) { _json['title'] = title; } @@ -2313,7 +2325,7 @@ /// Settings for callback notifications. /// -/// For more details see \[G Suite Alert +/// For more details see \[Google Workspace Alert /// Notification\](/admin-sdk/alertcenter/guides/notifications). class Notification { /// A Google Cloud Pub/sub topic destination. @@ -2896,8 +2908,8 @@ /// A request to undelete a specific alert that was marked for deletion. class UndeleteAlertRequest { - /// The unique identifier of the G Suite organization account of the customer - /// the alert is associated with. + /// The unique identifier of the Google Workspace organization account of the + /// customer the alert is associated with. /// /// Inferred from the caller identity if not provided. ///
diff --git a/generated/googleapis_beta/lib/analyticsadmin/v1alpha.dart b/generated/googleapis_beta/lib/analyticsadmin/v1alpha.dart new file mode 100644 index 0000000..0b04680 --- /dev/null +++ b/generated/googleapis_beta/lib/analyticsadmin/v1alpha.dart
@@ -0,0 +1,5788 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Google Analytics Admin API - v1alpha +/// +/// For more information, see +/// <http://code.google.com/apis/analytics/docs/mgmt/home.html> +/// +/// Create an instance of [GoogleAnalyticsAdminApi] to access these resources: +/// +/// - [AccountSummariesResource] +/// - [AccountsResource] +/// - [AccountsUserLinksResource] +/// - [PropertiesResource] +/// - [PropertiesAndroidAppDataStreamsResource] +/// - [PropertiesFirebaseLinksResource] +/// - [PropertiesGoogleAdsLinksResource] +/// - [PropertiesIosAppDataStreamsResource] +/// - [PropertiesUserLinksResource] +/// - [PropertiesWebDataStreamsResource] +library analyticsadmin.v1alpha; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +class GoogleAnalyticsAdminApi { + /// Edit Google Analytics management entities + static const analyticsEditScope = + 'https://www.googleapis.com/auth/analytics.edit'; + + /// Manage Google Analytics Account users by email address + static const analyticsManageUsersScope = + 'https://www.googleapis.com/auth/analytics.manage.users'; + + /// View Google Analytics user permissions + static const analyticsManageUsersReadonlyScope = + 'https://www.googleapis.com/auth/analytics.manage.users.readonly'; + + /// See and download your Google Analytics data + static const analyticsReadonlyScope = + 'https://www.googleapis.com/auth/analytics.readonly'; + + final commons.ApiRequester _requester; + + AccountSummariesResource get accountSummaries => + AccountSummariesResource(_requester); + AccountsResource get accounts => AccountsResource(_requester); + PropertiesResource get properties => PropertiesResource(_requester); + + GoogleAnalyticsAdminApi(http.Client client, + {core.String rootUrl = 'https://analyticsadmin.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class AccountSummariesResource { + final commons.ApiRequester _requester; + + AccountSummariesResource(commons.ApiRequester client) : _requester = client; + + /// Returns summaries of all accounts accessible by the caller. + /// + /// Request parameters: + /// + /// [pageSize] - The maximum number of AccountSummary resources to return. The + /// service may return fewer than this value, even if there are additional + /// pages. If unspecified, at most 50 resources will be returned. The maximum + /// value is 200; (higher values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous + /// `ListAccountSummaries` call. Provide this to retrieve the subsequent page. + /// When paginating, all other parameters provided to `ListAccountSummaries` + /// must match the call that provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaListAccountSummariesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListAccountSummariesResponse> list({ + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/accountSummaries'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaListAccountSummariesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class AccountsResource { + final commons.ApiRequester _requester; + + AccountsUserLinksResource get userLinks => + AccountsUserLinksResource(_requester); + + AccountsResource(commons.ApiRequester client) : _requester = client; + + /// Marks target Account as soft-deleted (ie: "trashed") and returns it. + /// + /// This API does not have a method to restore soft-deleted accounts. However, + /// they can be restored using the Trash Can UI. If the accounts are not + /// restored before the expiration time, the account and all child resources + /// (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently + /// purged. https://support.google.com/analytics/answer/6154772 Returns an + /// error if the target is not found. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the Account to soft-delete. Format: + /// accounts/{account} Example: "accounts/100" + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lookup for a single Account. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the account to lookup. Format: + /// accounts/{account} Example: "accounts/100" + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAccount]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAccount> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAccount.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Get data sharing settings on an account. + /// + /// Data sharing settings are singletons. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the settings to lookup. Format: + /// accounts/{account}/dataSharingSettings Example: + /// "accounts/1000/dataSharingSettings" + /// Value must have pattern `^accounts/\[^/\]+/dataSharingSettings$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaDataSharingSettings]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaDataSharingSettings> + getDataSharingSettings( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaDataSharingSettings.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns all accounts accessible by the caller. + /// + /// Note that these accounts might not currently have GA4 properties. + /// Soft-deleted (ie: "trashed") accounts are excluded by default. Returns an + /// empty list if no relevant accounts are found. + /// + /// Request parameters: + /// + /// [pageSize] - The maximum number of resources to return. The service may + /// return fewer than this value, even if there are additional pages. If + /// unspecified, at most 50 resources will be returned. The maximum value is + /// 200; (higher values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous `ListAccounts` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListAccounts` must match the call that provided + /// the page token. + /// + /// [showDeleted] - Whether to include soft-deleted (ie: "trashed") Accounts + /// in the results. Accounts can be inspected to determine whether they are + /// deleted or not. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListAccountsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListAccountsResponse> list({ + core.int pageSize, + core.String pageToken, + core.bool showDeleted, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if (showDeleted != null) { + _queryParams['showDeleted'] = ['${showDeleted}']; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/accounts'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListAccountsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates an account. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this account. Format: + /// accounts/{account} Example: "accounts/100" + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAccount]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAccount> patch( + GoogleAnalyticsAdminV1alphaAccount request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAccount.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Requests a ticket for creating an account. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse> + provisionAccountTicket( + GoogleAnalyticsAdminV1alphaProvisionAccountTicketRequest request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/accounts:provisionAccountTicket'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class AccountsUserLinksResource { + final commons.ApiRequester _requester; + + AccountsUserLinksResource(commons.ApiRequester client) : _requester = client; + + /// Lists all user links on an account or property, including implicit ones + /// that come from effective permissions granted by groups or organization + /// admin roles. + /// + /// If a returned user link does not have direct permissions, they cannot be + /// removed from the account or property directly with the DeleteUserLink + /// command. They have to be removed from the group/etc that gives them + /// permissions, which is currently only usable/discoverable in the GA or GMP + /// UIs. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAuditUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAuditUserLinksResponse> audit( + GoogleAnalyticsAdminV1alphaAuditUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:audit'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAuditUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates information about multiple users' links to an account or property. + /// + /// This method is transactional. If any UserLink cannot be created, none of + /// the UserLinks will be created. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. This field is required. The parent field in the + /// CreateUserLinkRequest messages must either be empty or match this field. + /// Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse> + batchCreate( + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchCreate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes information about multiple users' links to an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent of all values for user link names to delete + /// must match this field. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> batchDelete( + GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchDelete'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets information about multiple users' links to an account or property. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent of all provided values for the 'names' field + /// must match this field. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [names] - Required. The names of the user links to retrieve. A maximum of + /// 1000 user links can be retrieved in a batch. Format: + /// accounts/{accountId}/userLinks/{userLinkId} + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse> batchGet( + core.String parent, { + core.List<core.String> names, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (names != null) { + _queryParams['names'] = names; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchGet'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates information about multiple users' links to an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent field in the UpdateUserLinkRequest messages + /// must either be empty or match this field. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse> + batchUpdate( + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchUpdate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a user link on an account or property. + /// + /// If the user with the specified email already has permissions on the + /// account or property, then the user's existing permissions will be unioned + /// with the permissions specified in the new UserLink. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [notifyNewUser] - Optional. If set, then email the new user notifying them + /// that they've been granted permissions to the resource. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> create( + GoogleAnalyticsAdminV1alphaUserLink request, + core.String parent, { + core.bool notifyNewUser, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (notifyNewUser != null) { + _queryParams['notifyNewUser'] = ['${notifyNewUser}']; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a user link on an account or property. + /// + /// Request parameters: + /// + /// [name] - Required. Example format: accounts/1234/userLinks/5678 + /// Value must have pattern `^accounts/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets information about a user's link to an account or property. + /// + /// Request parameters: + /// + /// [name] - Required. Example format: accounts/1234/userLinks/5678 + /// Value must have pattern `^accounts/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists all user links on an account or property. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^accounts/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of user links to return. The service may + /// return fewer than this value. If unspecified, at most 200 user links will + /// be returned. The maximum value is 500; values above 500 will be coerced to + /// 500. + /// + /// [pageToken] - A page token, received from a previous `ListUserLinks` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListUserLinks` must match the call that provided + /// the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListUserLinksResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a user link on an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Example format: properties/1234/userLinks/5678 + /// Value must have pattern `^accounts/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> patch( + GoogleAnalyticsAdminV1alphaUserLink request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesResource { + final commons.ApiRequester _requester; + + PropertiesAndroidAppDataStreamsResource get androidAppDataStreams => + PropertiesAndroidAppDataStreamsResource(_requester); + PropertiesFirebaseLinksResource get firebaseLinks => + PropertiesFirebaseLinksResource(_requester); + PropertiesGoogleAdsLinksResource get googleAdsLinks => + PropertiesGoogleAdsLinksResource(_requester); + PropertiesIosAppDataStreamsResource get iosAppDataStreams => + PropertiesIosAppDataStreamsResource(_requester); + PropertiesUserLinksResource get userLinks => + PropertiesUserLinksResource(_requester); + PropertiesWebDataStreamsResource get webDataStreams => + PropertiesWebDataStreamsResource(_requester); + + PropertiesResource(commons.ApiRequester client) : _requester = client; + + /// Creates an "GA4" property with the specified location and attributes. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaProperty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaProperty> create( + GoogleAnalyticsAdminV1alphaProperty request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/properties'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaProperty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Marks target Property as soft-deleted (ie: "trashed") and returns it. + /// + /// This API does not have a method to restore soft-deleted properties. + /// However, they can be restored using the Trash Can UI. If the properties + /// are not restored before the expiration time, the Property and all child + /// resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently + /// purged. https://support.google.com/analytics/answer/6154772 Returns an + /// error if the target is not found, or is not an GA4 Property. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the Property to soft-delete. Format: + /// properties/{property_id} Example: "properties/1000" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lookup for a single "GA4" Property. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the property to lookup. Format: + /// properties/{property_id} Example: "properties/1000" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaProperty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaProperty> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaProperty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns child Properties under the specified parent Account. + /// + /// Only "GA4" properties will be returned. Properties will be excluded if the + /// caller does not have access. Soft-deleted (ie: "trashed") properties are + /// excluded by default. Returns an empty list if no relevant properties are + /// found. + /// + /// Request parameters: + /// + /// [filter] - Required. An expression for filtering the results of the + /// request. Fields eligible for filtering are: `parent:`(The resource name of + /// the parent account) or `firebase_project:`(The id or number of the linked + /// firebase project). Some examples of filters: ``` | Filter | Description | + /// |-----------------------------|-------------------------------------------| + /// | parent:accounts/123 | The account with account id: 123. | | + /// firebase_project:project-id | The firebase project with id: project-id. | + /// | firebase_project:123 | The firebase project with number: 123. | ``` + /// + /// [pageSize] - The maximum number of resources to return. The service may + /// return fewer than this value, even if there are additional pages. If + /// unspecified, at most 50 resources will be returned. The maximum value is + /// 200; (higher values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous `ListProperties` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListProperties` must match the call that + /// provided the page token. + /// + /// [showDeleted] - Whether to include soft-deleted (ie: "trashed") Properties + /// in the results. Properties can be inspected to determine whether they are + /// deleted or not. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListPropertiesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListPropertiesResponse> list({ + core.String filter, + core.int pageSize, + core.String pageToken, + core.bool showDeleted, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if (showDeleted != null) { + _queryParams['showDeleted'] = ['${showDeleted}']; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/properties'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListPropertiesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this property. Format: + /// properties/{property_id} Example: "properties/1000" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaProperty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaProperty> patch( + GoogleAnalyticsAdminV1alphaProperty request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaProperty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesAndroidAppDataStreamsResource { + final commons.ApiRequester _requester; + + PropertiesAndroidAppDataStreamsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates an Android app stream with the specified location and attributes. + /// + /// Note that an Android app stream must be linked to a Firebase app to + /// receive traffic. To create a working app stream, make sure your property + /// is linked to a Firebase project. Then, use the Firebase API to create a + /// Firebase app, which will also create an appropriate data stream in + /// Analytics (may take up to 24 hours). + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource where this android app data + /// stream will be created. Format: properties/123 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAndroidAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAndroidAppDataStream> create( + GoogleAnalyticsAdminV1alphaAndroidAppDataStream request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/androidAppDataStreams'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAndroidAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes an android app stream on a property. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the android app data stream to delete. + /// Format: properties/{property_id}/androidAppDataStreams/{stream_id} + /// Example: "properties/123/androidAppDataStreams/456" + /// Value must have pattern + /// `^properties/\[^/\]+/androidAppDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lookup for a single AndroidAppDataStream + /// + /// Request parameters: + /// + /// [name] - Required. The name of the android app data stream to lookup. + /// Format: properties/{property_id}/androidAppDataStreams/{stream_id} + /// Example: "properties/123/androidAppDataStreams/456" + /// Value must have pattern + /// `^properties/\[^/\]+/androidAppDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAndroidAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAndroidAppDataStream> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAndroidAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns child android app streams under the specified parent property. + /// + /// Android app streams will be excluded if the caller does not have access. + /// Returns an empty list if no relevant android app streams are found. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent property. For example, to + /// limit results to app streams under the property with Id 123: + /// "properties/123" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of resources to return. If unspecified, at + /// most 50 resources will be returned. The maximum value is 200; (higher + /// values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous call. Provide this to + /// retrieve the subsequent page. When paginating, all other parameters + /// provided to `ListAndroidAppDataStreams` must match the call that provided + /// the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse> + list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/androidAppDataStreams'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates an android app stream on a property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this Data Stream. Format: + /// properties/{property_id}/androidAppDataStreams/{stream_id} Example: + /// "properties/1000/androidAppDataStreams/2000" + /// Value must have pattern + /// `^properties/\[^/\]+/androidAppDataStreams/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAndroidAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAndroidAppDataStream> patch( + GoogleAnalyticsAdminV1alphaAndroidAppDataStream request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAndroidAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesFirebaseLinksResource { + final commons.ApiRequester _requester; + + PropertiesFirebaseLinksResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a FirebaseLink. + /// + /// Properties can have at most one FirebaseLink. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Format: properties/{property_id} Example: + /// properties/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaFirebaseLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaFirebaseLink> create( + GoogleAnalyticsAdminV1alphaFirebaseLink request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/firebaseLinks'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaFirebaseLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a FirebaseLink on a property + /// + /// Request parameters: + /// + /// [name] - Required. Format: + /// properties/{property_id}/firebaseLinks/{firebase_link_id} Example: + /// properties/1234/firebaseLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/firebaseLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists FirebaseLinks on a property. + /// + /// Properties can have at most one FirebaseLink. + /// + /// Request parameters: + /// + /// [parent] - Required. Format: properties/{property_id} Example: + /// properties/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of resources to return. The service may + /// return fewer than this value, even if there are additional pages. If + /// unspecified, at most 50 resources will be returned. The maximum value is + /// 200; (higher values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous `ListFirebaseLinks` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListProperties` must match the call that + /// provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/firebaseLinks'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a FirebaseLink on a property + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Example format: properties/1234/firebaseLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/firebaseLinks/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaFirebaseLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaFirebaseLink> patch( + GoogleAnalyticsAdminV1alphaFirebaseLink request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaFirebaseLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesGoogleAdsLinksResource { + final commons.ApiRequester _requester; + + PropertiesGoogleAdsLinksResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a GoogleAdsLink. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: properties/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaGoogleAdsLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaGoogleAdsLink> create( + GoogleAnalyticsAdminV1alphaGoogleAdsLink request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/googleAdsLinks'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaGoogleAdsLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a GoogleAdsLink on a property + /// + /// Request parameters: + /// + /// [name] - Required. Example format: properties/1234/googleAdsLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/googleAdsLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists GoogleAdsLinks on a property. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: properties/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of resources to return. If unspecified, at + /// most 50 resources will be returned. The maximum value is 200 (higher + /// values will be coerced to the maximum). + /// + /// [pageToken] - A page token, received from a previous `ListGoogleAdsLinks` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListGoogleAdsLinks` must match the call that + /// provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/googleAdsLinks'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a GoogleAdsLink on a property + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Format: + /// properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} Note: + /// googleAdsLinkId is not the Google Ads customer ID. + /// Value must have pattern `^properties/\[^/\]+/googleAdsLinks/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaGoogleAdsLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaGoogleAdsLink> patch( + GoogleAnalyticsAdminV1alphaGoogleAdsLink request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaGoogleAdsLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesIosAppDataStreamsResource { + final commons.ApiRequester _requester; + + PropertiesIosAppDataStreamsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates an iOS app stream with the specified location and attributes. + /// + /// Note that an iOS app stream must be linked to a Firebase app to receive + /// traffic. To create a working app stream, make sure your property is linked + /// to a Firebase project. Then, use the Firebase API to create a Firebase + /// app, which will also create an appropriate data stream in Analytics (may + /// take up to 24 hours). + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource where this ios app data stream + /// will be created. Format: properties/123 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaIosAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaIosAppDataStream> create( + GoogleAnalyticsAdminV1alphaIosAppDataStream request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/iosAppDataStreams'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaIosAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes an iOS app stream on a property. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the iOS app data stream to delete. Format: + /// properties/{property_id}/iosAppDataStreams/{stream_id} Example: + /// "properties/123/iosAppDataStreams/456" + /// Value must have pattern `^properties/\[^/\]+/iosAppDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lookup for a single IosAppDataStream + /// + /// Request parameters: + /// + /// [name] - Required. The name of the iOS app data stream to lookup. Format: + /// properties/{property_id}/iosAppDataStreams/{stream_id} Example: + /// "properties/123/iosAppDataStreams/456" + /// Value must have pattern `^properties/\[^/\]+/iosAppDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaIosAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaIosAppDataStream> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaIosAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns child iOS app data streams under the specified parent property. + /// + /// iOS app data streams will be excluded if the caller does not have access. + /// Returns an empty list if no relevant iOS app data streams are found. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent property. For example, to list + /// results of app streams under the property with Id 123: "properties/123" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of resources to return. If unspecified, at + /// most 50 resources will be returned. The maximum value is 200; (higher + /// values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous + /// `ListIosAppDataStreams` call. Provide this to retrieve the subsequent + /// page. When paginating, all other parameters provided to + /// `ListIosAppDataStreams` must match the call that provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/iosAppDataStreams'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates an iOS app stream on a property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this Data Stream. Format: + /// properties/{property_id}/iosAppDataStreams/{stream_id} Example: + /// "properties/1000/iosAppDataStreams/2000" + /// Value must have pattern `^properties/\[^/\]+/iosAppDataStreams/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaIosAppDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaIosAppDataStream> patch( + GoogleAnalyticsAdminV1alphaIosAppDataStream request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaIosAppDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesUserLinksResource { + final commons.ApiRequester _requester; + + PropertiesUserLinksResource(commons.ApiRequester client) + : _requester = client; + + /// Lists all user links on an account or property, including implicit ones + /// that come from effective permissions granted by groups or organization + /// admin roles. + /// + /// If a returned user link does not have direct permissions, they cannot be + /// removed from the account or property directly with the DeleteUserLink + /// command. They have to be removed from the group/etc that gives them + /// permissions, which is currently only usable/discoverable in the GA or GMP + /// UIs. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaAuditUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaAuditUserLinksResponse> audit( + GoogleAnalyticsAdminV1alphaAuditUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:audit'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaAuditUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates information about multiple users' links to an account or property. + /// + /// This method is transactional. If any UserLink cannot be created, none of + /// the UserLinks will be created. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. This field is required. The parent field in the + /// CreateUserLinkRequest messages must either be empty or match this field. + /// Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse> + batchCreate( + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchCreate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes information about multiple users' links to an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent of all values for user link names to delete + /// must match this field. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> batchDelete( + GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchDelete'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets information about multiple users' links to an account or property. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent of all provided values for the 'names' field + /// must match this field. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [names] - Required. The names of the user links to retrieve. A maximum of + /// 1000 user links can be retrieved in a batch. Format: + /// accounts/{accountId}/userLinks/{userLinkId} + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse> batchGet( + core.String parent, { + core.List<core.String> names, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (names != null) { + _queryParams['names'] = names; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchGet'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates information about multiple users' links to an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The account or property that all user links in the + /// request are for. The parent field in the UpdateUserLinkRequest messages + /// must either be empty or match this field. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse> + batchUpdate( + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks:batchUpdate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a user link on an account or property. + /// + /// If the user with the specified email already has permissions on the + /// account or property, then the user's existing permissions will be unioned + /// with the permissions specified in the new UserLink. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [notifyNewUser] - Optional. If set, then email the new user notifying them + /// that they've been granted permissions to the resource. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> create( + GoogleAnalyticsAdminV1alphaUserLink request, + core.String parent, { + core.bool notifyNewUser, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (notifyNewUser != null) { + _queryParams['notifyNewUser'] = ['${notifyNewUser}']; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a user link on an account or property. + /// + /// Request parameters: + /// + /// [name] - Required. Example format: accounts/1234/userLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets information about a user's link to an account or property. + /// + /// Request parameters: + /// + /// [name] - Required. Example format: accounts/1234/userLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists all user links on an account or property. + /// + /// Request parameters: + /// + /// [parent] - Required. Example format: accounts/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of user links to return. The service may + /// return fewer than this value. If unspecified, at most 200 user links will + /// be returned. The maximum value is 500; values above 500 will be coerced to + /// 500. + /// + /// [pageToken] - A page token, received from a previous `ListUserLinks` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListUserLinks` must match the call that provided + /// the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListUserLinksResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListUserLinksResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userLinks'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListUserLinksResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a user link on an account or property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Example format: properties/1234/userLinks/5678 + /// Value must have pattern `^properties/\[^/\]+/userLinks/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaUserLink]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaUserLink> patch( + GoogleAnalyticsAdminV1alphaUserLink request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaUserLink.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class PropertiesWebDataStreamsResource { + final commons.ApiRequester _requester; + + PropertiesWebDataStreamsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a web stream with the specified location and attributes. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource where this web data stream will + /// be created. Format: properties/123 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaWebDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaWebDataStream> create( + GoogleAnalyticsAdminV1alphaWebDataStream request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/webDataStreams'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaWebDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a web stream on a property. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the web data stream to delete. Format: + /// properties/{property_id}/webDataStreams/{stream_id} Example: + /// "properties/123/webDataStreams/456" + /// Value must have pattern `^properties/\[^/\]+/webDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lookup for a single WebDataStream + /// + /// Request parameters: + /// + /// [name] - Required. The name of the web data stream to lookup. Format: + /// properties/{property_id}/webDataStreams/{stream_id} Example: + /// "properties/123/webDataStreams/456" + /// Value must have pattern `^properties/\[^/\]+/webDataStreams/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaWebDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaWebDataStream> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaWebDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns the singleton enhanced measurement settings for this web stream. + /// + /// Note that the stream must enable enhanced measurement for these settings + /// to take effect. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the settings to lookup. Format: + /// properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings + /// Example: "properties/1000/webDataStreams/2000/enhancedMeasurementSettings" + /// Value must have pattern + /// `^properties/\[^/\]+/webDataStreams/\[^/\]+/enhancedMeasurementSettings$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings> + getEnhancedMeasurementSettings( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns the Site Tag for the specified web stream. + /// + /// Site Tags are immutable singletons. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the site tag to lookup. Note that site tags + /// are singletons and do not have unique IDs. Format: + /// properties/{property_id}/webDataStreams/{stream_id}/globalSiteTag Example: + /// "properties/123/webDataStreams/456/globalSiteTag" + /// Value must have pattern + /// `^properties/\[^/\]+/webDataStreams/\[^/\]+/globalSiteTag$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaGlobalSiteTag]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaGlobalSiteTag> getGlobalSiteTag( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaGlobalSiteTag.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns child web data streams under the specified parent property. + /// + /// Web data streams will be excluded if the caller does not have access. + /// Returns an empty list if no relevant web data streams are found. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent property. For example, to list + /// results of web streams under the property with Id 123: "properties/123" + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of resources to return. If unspecified, at + /// most 50 resources will be returned. The maximum value is 200; (higher + /// values will be coerced to the maximum) + /// + /// [pageToken] - A page token, received from a previous `ListWebDataStreams` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListWebDataStreams` must match the call that + /// provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/webDataStreams'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a web stream on a property. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this Data Stream. Format: + /// properties/{property_id}/webDataStreams/{stream_id} Example: + /// "properties/1000/webDataStreams/2000" + /// Value must have pattern `^properties/\[^/\]+/webDataStreams/\[^/\]+$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaWebDataStream]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaWebDataStream> patch( + GoogleAnalyticsAdminV1alphaWebDataStream request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaWebDataStream.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the singleton enhanced measurement settings for this web stream. + /// + /// Note that the stream must enable enhanced measurement for these settings + /// to take effect. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name of this Data Stream. Format: + /// properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings + /// Example: "properties/1000/webDataStreams/2000/enhancedMeasurementSettings" + /// Value must have pattern + /// `^properties/\[^/\]+/webDataStreams/\[^/\]+/enhancedMeasurementSettings$`. + /// + /// [updateMask] - Required. The list of fields to be updated. Omitted fields + /// will not be updated. To replace the entire entity, use one path with the + /// string "*" to match all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings> + updateEnhancedMeasurementSettings( + GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// A resource message representing a Google Analytics account. +class GoogleAnalyticsAdminV1alphaAccount { + /// Time when this account was originally created. + /// + /// Output only. + core.String createTime; + + /// Indicates whether this Account is soft-deleted or not. + /// + /// Deleted accounts are excluded from List results unless specifically + /// requested. + /// + /// Output only. + core.bool deleted; + + /// Human-readable display name for this account. + /// + /// Required. + core.String displayName; + + /// Resource name of this account. + /// + /// Format: accounts/{account} Example: "accounts/100" + /// + /// Output only. + core.String name; + + /// Country of business. + /// + /// Must be a Unicode CLDR region code. + core.String regionCode; + + /// Time when account payload fields were last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaAccount(); + + GoogleAnalyticsAdminV1alphaAccount.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('deleted')) { + deleted = _json['deleted'] as core.bool; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('regionCode')) { + regionCode = _json['regionCode'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (deleted != null) { + _json['deleted'] = deleted; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (regionCode != null) { + _json['regionCode'] = regionCode; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A virtual resource representing an overview of an account and all its child +/// GA4 properties. +class GoogleAnalyticsAdminV1alphaAccountSummary { + /// Resource name of account referred to by this account summary Format: + /// accounts/{account_id} Example: "accounts/1000" + core.String account; + + /// Display name for the account referred to in this account summary. + core.String displayName; + + /// Resource name for this account summary. + /// + /// Format: accountSummaries/{account_id} Example: "accountSummaries/1000" + core.String name; + + /// List of summaries for child accounts of this account. + core.List<GoogleAnalyticsAdminV1alphaPropertySummary> propertySummaries; + + GoogleAnalyticsAdminV1alphaAccountSummary(); + + GoogleAnalyticsAdminV1alphaAccountSummary.fromJson(core.Map _json) { + if (_json.containsKey('account')) { + account = _json['account'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('propertySummaries')) { + propertySummaries = (_json['propertySummaries'] as core.List) + .map<GoogleAnalyticsAdminV1alphaPropertySummary>((value) => + GoogleAnalyticsAdminV1alphaPropertySummary.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (account != null) { + _json['account'] = account; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (propertySummaries != null) { + _json['propertySummaries'] = + propertySummaries.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A resource message representing a Google Analytics Android app stream. +class GoogleAnalyticsAdminV1alphaAndroidAppDataStream { + /// Time when this stream was originally created. + /// + /// Output only. + core.String createTime; + + /// Human-readable display name for the Data Stream. + /// + /// The max allowed display name length is 255 UTF-16 code units. + core.String displayName; + + /// ID of the corresponding Android app in Firebase, if any. + /// + /// This ID can change if the Android app is deleted and recreated. + /// + /// Output only. + core.String firebaseAppId; + + /// Resource name of this Data Stream. + /// + /// Format: properties/{property_id}/androidAppDataStreams/{stream_id} + /// Example: "properties/1000/androidAppDataStreams/2000" + /// + /// Output only. + core.String name; + + /// The package name for the app being measured. + /// + /// Example: "com.example.myandroidapp" + /// + /// Immutable. + core.String packageName; + + /// Time when stream payload fields were last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaAndroidAppDataStream(); + + GoogleAnalyticsAdminV1alphaAndroidAppDataStream.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('firebaseAppId')) { + firebaseAppId = _json['firebaseAppId'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('packageName')) { + packageName = _json['packageName'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (firebaseAppId != null) { + _json['firebaseAppId'] = firebaseAppId; + } + if (name != null) { + _json['name'] = name; + } + if (packageName != null) { + _json['packageName'] = packageName; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Read-only resource used to summarize a principal's effective roles. +class GoogleAnalyticsAdminV1alphaAuditUserLink { + /// Roles directly assigned to this user for this entity. + /// + /// Format: predefinedRoles/read Excludes roles that are inherited from an + /// account (if this is for a property), group, or organization admin role. + core.List<core.String> directRoles; + + /// Union of all permissions a user has at this account or property (includes + /// direct permissions, group-inherited permissions, etc.). + /// + /// Format: predefinedRoles/read + core.List<core.String> effectiveRoles; + + /// Email address of the linked user + core.String emailAddress; + + /// Example format: properties/1234/userLinks/5678 + core.String name; + + GoogleAnalyticsAdminV1alphaAuditUserLink(); + + GoogleAnalyticsAdminV1alphaAuditUserLink.fromJson(core.Map _json) { + if (_json.containsKey('directRoles')) { + directRoles = (_json['directRoles'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('effectiveRoles')) { + effectiveRoles = (_json['effectiveRoles'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('emailAddress')) { + emailAddress = _json['emailAddress'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (directRoles != null) { + _json['directRoles'] = directRoles; + } + if (effectiveRoles != null) { + _json['effectiveRoles'] = effectiveRoles; + } + if (emailAddress != null) { + _json['emailAddress'] = emailAddress; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Request message for AuditUserLinks RPC. +class GoogleAnalyticsAdminV1alphaAuditUserLinksRequest { + /// The maximum number of user links to return. + /// + /// The service may return fewer than this value. If unspecified, at most 1000 + /// user links will be returned. The maximum value is 5000; values above 5000 + /// will be coerced to 5000. + core.int pageSize; + + /// A page token, received from a previous `AuditUserLinks` call. + /// + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `AuditUserLinks` must match the call that provided + /// the page token. + core.String pageToken; + + GoogleAnalyticsAdminV1alphaAuditUserLinksRequest(); + + GoogleAnalyticsAdminV1alphaAuditUserLinksRequest.fromJson(core.Map _json) { + if (_json.containsKey('pageSize')) { + pageSize = _json['pageSize'] as core.int; + } + if (_json.containsKey('pageToken')) { + pageToken = _json['pageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pageSize != null) { + _json['pageSize'] = pageSize; + } + if (pageToken != null) { + _json['pageToken'] = pageToken; + } + return _json; + } +} + +/// Response message for AuditUserLinks RPC. +class GoogleAnalyticsAdminV1alphaAuditUserLinksResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// List of AuditUserLinks. + /// + /// These will be ordered stably, but in an arbitrary order. + core.List<GoogleAnalyticsAdminV1alphaAuditUserLink> userLinks; + + GoogleAnalyticsAdminV1alphaAuditUserLinksResponse(); + + GoogleAnalyticsAdminV1alphaAuditUserLinksResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('userLinks')) { + userLinks = (_json['userLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaAuditUserLink>((value) => + GoogleAnalyticsAdminV1alphaAuditUserLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (userLinks != null) { + _json['userLinks'] = userLinks.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for BatchCreateUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest { + /// If set, then email the new users notifying them that they've been granted + /// permissions to the resource. + /// + /// Regardless of whether this is set or not, notify_new_user field inside + /// each individual request is ignored. + /// + /// Optional. + core.bool notifyNewUsers; + + /// The requests specifying the user links to create. + /// + /// A maximum of 1000 user links can be created in a batch. + /// + /// Required. + core.List<GoogleAnalyticsAdminV1alphaCreateUserLinkRequest> requests; + + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest(); + + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksRequest.fromJson( + core.Map _json) { + if (_json.containsKey('notifyNewUsers')) { + notifyNewUsers = _json['notifyNewUsers'] as core.bool; + } + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<GoogleAnalyticsAdminV1alphaCreateUserLinkRequest>((value) => + GoogleAnalyticsAdminV1alphaCreateUserLinkRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (notifyNewUsers != null) { + _json['notifyNewUsers'] = notifyNewUsers; + } + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for BatchCreateUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse { + /// The user links created. + core.List<GoogleAnalyticsAdminV1alphaUserLink> userLinks; + + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse(); + + GoogleAnalyticsAdminV1alphaBatchCreateUserLinksResponse.fromJson( + core.Map _json) { + if (_json.containsKey('userLinks')) { + userLinks = (_json['userLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaUserLink>((value) => + GoogleAnalyticsAdminV1alphaUserLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userLinks != null) { + _json['userLinks'] = userLinks.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for BatchDeleteUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest { + /// The requests specifying the user links to update. + /// + /// A maximum of 1000 user links can be updated in a batch. + /// + /// Required. + core.List<GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest> requests; + + GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest(); + + GoogleAnalyticsAdminV1alphaBatchDeleteUserLinksRequest.fromJson( + core.Map _json) { + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest>((value) => + GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for BatchGetUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse { + /// The requested user links. + core.List<GoogleAnalyticsAdminV1alphaUserLink> userLinks; + + GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse(); + + GoogleAnalyticsAdminV1alphaBatchGetUserLinksResponse.fromJson( + core.Map _json) { + if (_json.containsKey('userLinks')) { + userLinks = (_json['userLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaUserLink>((value) => + GoogleAnalyticsAdminV1alphaUserLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userLinks != null) { + _json['userLinks'] = userLinks.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for BatchUpdateUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest { + /// The requests specifying the user links to update. + /// + /// A maximum of 1000 user links can be updated in a batch. + /// + /// Required. + core.List<GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest> requests; + + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest(); + + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksRequest.fromJson( + core.Map _json) { + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest>((value) => + GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for BatchUpdateUserLinks RPC. +class GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse { + /// The user links updated. + core.List<GoogleAnalyticsAdminV1alphaUserLink> userLinks; + + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse(); + + GoogleAnalyticsAdminV1alphaBatchUpdateUserLinksResponse.fromJson( + core.Map _json) { + if (_json.containsKey('userLinks')) { + userLinks = (_json['userLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaUserLink>((value) => + GoogleAnalyticsAdminV1alphaUserLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userLinks != null) { + _json['userLinks'] = userLinks.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for CreateUserLink RPC. +/// +/// Users can have multiple email addresses associated with their Google +/// account, and one of these email addresses is the "primary" email address. +/// Any of the email addresses associated with a Google account may be used for +/// a new UserLink, but the returned UserLink will always contain the "primary" +/// email address. As a result, the input and output email address for this +/// request may differ. +class GoogleAnalyticsAdminV1alphaCreateUserLinkRequest { + /// If set, then email the new user notifying them that they've been granted + /// permissions to the resource. + /// + /// Optional. + core.bool notifyNewUser; + + /// Example format: accounts/1234 + /// + /// Required. + core.String parent; + + /// The user link to create. + /// + /// Required. + GoogleAnalyticsAdminV1alphaUserLink userLink; + + GoogleAnalyticsAdminV1alphaCreateUserLinkRequest(); + + GoogleAnalyticsAdminV1alphaCreateUserLinkRequest.fromJson(core.Map _json) { + if (_json.containsKey('notifyNewUser')) { + notifyNewUser = _json['notifyNewUser'] as core.bool; + } + if (_json.containsKey('parent')) { + parent = _json['parent'] as core.String; + } + if (_json.containsKey('userLink')) { + userLink = GoogleAnalyticsAdminV1alphaUserLink.fromJson( + _json['userLink'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (notifyNewUser != null) { + _json['notifyNewUser'] = notifyNewUser; + } + if (parent != null) { + _json['parent'] = parent; + } + if (userLink != null) { + _json['userLink'] = userLink.toJson(); + } + return _json; + } +} + +/// A resource message representing data sharing settings of a Google Analytics +/// account. +class GoogleAnalyticsAdminV1alphaDataSharingSettings { + /// Resource name. + /// + /// Format: accounts/{account}/dataSharingSettings Example: + /// "accounts/1000/dataSharingSettings" + /// + /// Output only. + core.String name; + + /// Allows any of Google sales to access the data in order to suggest + /// configuration changes to improve results. + core.bool sharingWithGoogleAnySalesEnabled; + + /// Allows Google sales teams that are assigned to the customer to access the + /// data in order to suggest configuration changes to improve results. + /// + /// Sales team restrictions still apply when enabled. + core.bool sharingWithGoogleAssignedSalesEnabled; + + /// Allows Google to use the data to improve other Google products or + /// services. + core.bool sharingWithGoogleProductsEnabled; + + /// Allows Google support to access the data in order to help troubleshoot + /// issues. + core.bool sharingWithGoogleSupportEnabled; + + /// Allows Google to share the data anonymously in aggregate form with others. + core.bool sharingWithOthersEnabled; + + GoogleAnalyticsAdminV1alphaDataSharingSettings(); + + GoogleAnalyticsAdminV1alphaDataSharingSettings.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('sharingWithGoogleAnySalesEnabled')) { + sharingWithGoogleAnySalesEnabled = + _json['sharingWithGoogleAnySalesEnabled'] as core.bool; + } + if (_json.containsKey('sharingWithGoogleAssignedSalesEnabled')) { + sharingWithGoogleAssignedSalesEnabled = + _json['sharingWithGoogleAssignedSalesEnabled'] as core.bool; + } + if (_json.containsKey('sharingWithGoogleProductsEnabled')) { + sharingWithGoogleProductsEnabled = + _json['sharingWithGoogleProductsEnabled'] as core.bool; + } + if (_json.containsKey('sharingWithGoogleSupportEnabled')) { + sharingWithGoogleSupportEnabled = + _json['sharingWithGoogleSupportEnabled'] as core.bool; + } + if (_json.containsKey('sharingWithOthersEnabled')) { + sharingWithOthersEnabled = _json['sharingWithOthersEnabled'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + if (sharingWithGoogleAnySalesEnabled != null) { + _json['sharingWithGoogleAnySalesEnabled'] = + sharingWithGoogleAnySalesEnabled; + } + if (sharingWithGoogleAssignedSalesEnabled != null) { + _json['sharingWithGoogleAssignedSalesEnabled'] = + sharingWithGoogleAssignedSalesEnabled; + } + if (sharingWithGoogleProductsEnabled != null) { + _json['sharingWithGoogleProductsEnabled'] = + sharingWithGoogleProductsEnabled; + } + if (sharingWithGoogleSupportEnabled != null) { + _json['sharingWithGoogleSupportEnabled'] = + sharingWithGoogleSupportEnabled; + } + if (sharingWithOthersEnabled != null) { + _json['sharingWithOthersEnabled'] = sharingWithOthersEnabled; + } + return _json; + } +} + +/// Request message for DeleteUserLink RPC. +class GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest { + /// Example format: accounts/1234/userLinks/5678 + /// + /// Required. + core.String name; + + GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest(); + + GoogleAnalyticsAdminV1alphaDeleteUserLinkRequest.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Singleton resource under a WebDataStream, configuring measurement of +/// additional site interactions and content. +class GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings { + /// If enabled, capture a file download event each time a link is clicked with + /// a common document, compressed file, application, video, or audio + /// extension. + core.bool fileDownloadsEnabled; + + /// Resource name of this Data Stream. + /// + /// Format: + /// properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings + /// Example: "properties/1000/webDataStreams/2000/enhancedMeasurementSettings" + /// + /// Output only. + core.String name; + + /// If enabled, capture an outbound click event each time a visitor clicks a + /// link that leads them away from your domain. + core.bool outboundClicksEnabled; + + /// If enabled, capture a page view event each time the website changes the + /// browser history state. + core.bool pageChangesEnabled; + + /// If enabled, capture a page view event each time a page loads. + /// + /// Output only. + core.bool pageLoadsEnabled; + + /// If enabled, capture a page view event each time a page loads or the + /// website changes the browser history state. + /// + /// Output only. + core.bool pageViewsEnabled; + + /// If enabled, capture scroll events each time a visitor gets to the bottom + /// of a page. + core.bool scrollsEnabled; + + /// URL query parameters to interpret as site search parameters. + /// + /// Max length is 1024 characters. Must not be empty. + /// + /// Required. + core.String searchQueryParameter; + + /// If enabled, capture a view search results event each time a visitor + /// performs a search on your site (based on a query parameter). + core.bool siteSearchEnabled; + + /// Indicates whether Enhanced Measurement Settings will be used to + /// automatically measure interactions and content on this web stream. + /// + /// Changing this value does not affect the settings themselves, but + /// determines whether they are respected. + core.bool streamEnabled; + + /// Additional URL query parameters. + /// + /// Max length is 1024 characters. + core.String uriQueryParameter; + + /// If enabled, capture video play, progress, and complete events as visitors + /// view embedded videos on your site. + core.bool videoEngagementEnabled; + + GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings(); + + GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings.fromJson( + core.Map _json) { + if (_json.containsKey('fileDownloadsEnabled')) { + fileDownloadsEnabled = _json['fileDownloadsEnabled'] as core.bool; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('outboundClicksEnabled')) { + outboundClicksEnabled = _json['outboundClicksEnabled'] as core.bool; + } + if (_json.containsKey('pageChangesEnabled')) { + pageChangesEnabled = _json['pageChangesEnabled'] as core.bool; + } + if (_json.containsKey('pageLoadsEnabled')) { + pageLoadsEnabled = _json['pageLoadsEnabled'] as core.bool; + } + if (_json.containsKey('pageViewsEnabled')) { + pageViewsEnabled = _json['pageViewsEnabled'] as core.bool; + } + if (_json.containsKey('scrollsEnabled')) { + scrollsEnabled = _json['scrollsEnabled'] as core.bool; + } + if (_json.containsKey('searchQueryParameter')) { + searchQueryParameter = _json['searchQueryParameter'] as core.String; + } + if (_json.containsKey('siteSearchEnabled')) { + siteSearchEnabled = _json['siteSearchEnabled'] as core.bool; + } + if (_json.containsKey('streamEnabled')) { + streamEnabled = _json['streamEnabled'] as core.bool; + } + if (_json.containsKey('uriQueryParameter')) { + uriQueryParameter = _json['uriQueryParameter'] as core.String; + } + if (_json.containsKey('videoEngagementEnabled')) { + videoEngagementEnabled = _json['videoEngagementEnabled'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (fileDownloadsEnabled != null) { + _json['fileDownloadsEnabled'] = fileDownloadsEnabled; + } + if (name != null) { + _json['name'] = name; + } + if (outboundClicksEnabled != null) { + _json['outboundClicksEnabled'] = outboundClicksEnabled; + } + if (pageChangesEnabled != null) { + _json['pageChangesEnabled'] = pageChangesEnabled; + } + if (pageLoadsEnabled != null) { + _json['pageLoadsEnabled'] = pageLoadsEnabled; + } + if (pageViewsEnabled != null) { + _json['pageViewsEnabled'] = pageViewsEnabled; + } + if (scrollsEnabled != null) { + _json['scrollsEnabled'] = scrollsEnabled; + } + if (searchQueryParameter != null) { + _json['searchQueryParameter'] = searchQueryParameter; + } + if (siteSearchEnabled != null) { + _json['siteSearchEnabled'] = siteSearchEnabled; + } + if (streamEnabled != null) { + _json['streamEnabled'] = streamEnabled; + } + if (uriQueryParameter != null) { + _json['uriQueryParameter'] = uriQueryParameter; + } + if (videoEngagementEnabled != null) { + _json['videoEngagementEnabled'] = videoEngagementEnabled; + } + return _json; + } +} + +/// A link between an GA4 property and a Firebase project. +class GoogleAnalyticsAdminV1alphaFirebaseLink { + /// Time when this FirebaseLink was originally created. + /// + /// Output only. + core.String createTime; + + /// Maximum user access to the GA4 property allowed to admins of the linked + /// Firebase project. + /// Possible string values are: + /// - "MAXIMUM_USER_ACCESS_UNSPECIFIED" : Unspecified maximum user access. + /// - "NO_ACCESS" : Firebase users have no access to the Analytics property. + /// - "READ_AND_ANALYZE" : Firebase users have Read & Analyze access to the + /// Analytics property. + /// - "EDITOR_WITHOUT_LINK_MANAGEMENT" : Firebase users have edit access to + /// the Analytics property, but may not manage the Firebase link. + /// - "EDITOR_INCLUDING_LINK_MANAGEMENT" : Firebase users have edit access to + /// the Analytics property and may manage the Firebase link. + core.String maximumUserAccess; + + /// Example format: properties/1234/firebaseLinks/5678 + /// + /// Output only. + core.String name; + + /// Firebase project resource name. + /// + /// When creating a FirebaseLink, you may provide this resource name using + /// either a project number or project ID. Once this resource has been + /// created, returned FirebaseLinks will always have a project_name that + /// contains a project number. Format: 'projects/{project number}' Example: + /// 'projects/1234' + /// + /// Immutable. + core.String project; + + GoogleAnalyticsAdminV1alphaFirebaseLink(); + + GoogleAnalyticsAdminV1alphaFirebaseLink.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('maximumUserAccess')) { + maximumUserAccess = _json['maximumUserAccess'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('project')) { + project = _json['project'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (maximumUserAccess != null) { + _json['maximumUserAccess'] = maximumUserAccess; + } + if (name != null) { + _json['name'] = name; + } + if (project != null) { + _json['project'] = project; + } + return _json; + } +} + +/// Read-only resource with the tag for sending data from a website to a +/// WebDataStream. +class GoogleAnalyticsAdminV1alphaGlobalSiteTag { + /// Resource name for this GlobalSiteTag resource. + /// + /// Format: properties/{propertyId}/globalSiteTag + /// + /// Output only. + core.String name; + + /// JavaScript code snippet to be pasted as the first item into the head tag + /// of every webpage to measure. + /// + /// Immutable. + core.String snippet; + + GoogleAnalyticsAdminV1alphaGlobalSiteTag(); + + GoogleAnalyticsAdminV1alphaGlobalSiteTag.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('snippet')) { + snippet = _json['snippet'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + if (snippet != null) { + _json['snippet'] = snippet; + } + return _json; + } +} + +/// A link between an GA4 property and a Google Ads account. +class GoogleAnalyticsAdminV1alphaGoogleAdsLink { + /// Enable personalized advertising features with this integration. + /// + /// Automatically publish my Google Analytics audience lists and Google + /// Analytics remarketing events/parameters to the linked Google Ads account. + /// If this field is not set on create/update it will be defaulted to true. + core.bool adsPersonalizationEnabled; + + /// If true, this link is for a Google Ads manager account. + /// + /// Output only. + core.bool canManageClients; + + /// Time when this link was originally created. + /// + /// Output only. + core.String createTime; + + /// Google Ads customer ID. + /// + /// Immutable. + core.String customerId; + + /// Email address of the user that created the link. + /// + /// An empty string will be returned if the email address can't be retrieved. + /// + /// Output only. + core.String emailAddress; + + /// Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} Note: + /// googleAdsLinkId is not the Google Ads customer ID. + /// + /// Output only. + core.String name; + + /// Time when this link was last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaGoogleAdsLink(); + + GoogleAnalyticsAdminV1alphaGoogleAdsLink.fromJson(core.Map _json) { + if (_json.containsKey('adsPersonalizationEnabled')) { + adsPersonalizationEnabled = + _json['adsPersonalizationEnabled'] as core.bool; + } + if (_json.containsKey('canManageClients')) { + canManageClients = _json['canManageClients'] as core.bool; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('customerId')) { + customerId = _json['customerId'] as core.String; + } + if (_json.containsKey('emailAddress')) { + emailAddress = _json['emailAddress'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (adsPersonalizationEnabled != null) { + _json['adsPersonalizationEnabled'] = adsPersonalizationEnabled; + } + if (canManageClients != null) { + _json['canManageClients'] = canManageClients; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (customerId != null) { + _json['customerId'] = customerId; + } + if (emailAddress != null) { + _json['emailAddress'] = emailAddress; + } + if (name != null) { + _json['name'] = name; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A resource message representing a Google Analytics IOS app stream. +class GoogleAnalyticsAdminV1alphaIosAppDataStream { + /// The Apple App Store Bundle ID for the app Example: "com.example.myiosapp" + /// + /// Required. Immutable. + core.String bundleId; + + /// Time when this stream was originally created. + /// + /// Output only. + core.String createTime; + + /// Human-readable display name for the Data Stream. + /// + /// The max allowed display name length is 255 UTF-16 code units. + core.String displayName; + + /// ID of the corresponding iOS app in Firebase, if any. + /// + /// This ID can change if the iOS app is deleted and recreated. + /// + /// Output only. + core.String firebaseAppId; + + /// Resource name of this Data Stream. + /// + /// Format: properties/{property_id}/iosAppDataStreams/{stream_id} Example: + /// "properties/1000/iosAppDataStreams/2000" + /// + /// Output only. + core.String name; + + /// Time when stream payload fields were last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaIosAppDataStream(); + + GoogleAnalyticsAdminV1alphaIosAppDataStream.fromJson(core.Map _json) { + if (_json.containsKey('bundleId')) { + bundleId = _json['bundleId'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('firebaseAppId')) { + firebaseAppId = _json['firebaseAppId'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bundleId != null) { + _json['bundleId'] = bundleId; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (firebaseAppId != null) { + _json['firebaseAppId'] = firebaseAppId; + } + if (name != null) { + _json['name'] = name; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Response message for ListAccountSummaries RPC. +class GoogleAnalyticsAdminV1alphaListAccountSummariesResponse { + /// Account summaries of all accounts the caller has access to. + core.List<GoogleAnalyticsAdminV1alphaAccountSummary> accountSummaries; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListAccountSummariesResponse(); + + GoogleAnalyticsAdminV1alphaListAccountSummariesResponse.fromJson( + core.Map _json) { + if (_json.containsKey('accountSummaries')) { + accountSummaries = (_json['accountSummaries'] as core.List) + .map<GoogleAnalyticsAdminV1alphaAccountSummary>((value) => + GoogleAnalyticsAdminV1alphaAccountSummary.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accountSummaries != null) { + _json['accountSummaries'] = + accountSummaries.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Request message for ListAccounts RPC. +class GoogleAnalyticsAdminV1alphaListAccountsResponse { + /// Results that were accessible to the caller. + core.List<GoogleAnalyticsAdminV1alphaAccount> accounts; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListAccountsResponse(); + + GoogleAnalyticsAdminV1alphaListAccountsResponse.fromJson(core.Map _json) { + if (_json.containsKey('accounts')) { + accounts = (_json['accounts'] as core.List) + .map<GoogleAnalyticsAdminV1alphaAccount>((value) => + GoogleAnalyticsAdminV1alphaAccount.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accounts != null) { + _json['accounts'] = accounts.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Request message for ListAndroidDataStreams RPC. +class GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse { + /// Results that matched the filter criteria and were accessible to the + /// caller. + core.List<GoogleAnalyticsAdminV1alphaAndroidAppDataStream> + androidAppDataStreams; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse(); + + GoogleAnalyticsAdminV1alphaListAndroidAppDataStreamsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('androidAppDataStreams')) { + androidAppDataStreams = (_json['androidAppDataStreams'] as core.List) + .map<GoogleAnalyticsAdminV1alphaAndroidAppDataStream>((value) => + GoogleAnalyticsAdminV1alphaAndroidAppDataStream.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (androidAppDataStreams != null) { + _json['androidAppDataStreams'] = + androidAppDataStreams.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for ListFirebaseLinks RPC +class GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse { + /// List of FirebaseLinks. + /// + /// This will have at most one value. + core.List<GoogleAnalyticsAdminV1alphaFirebaseLink> firebaseLinks; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. Currently, Google + /// Analytics supports only one FirebaseLink per property, so this will never + /// be populated. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse(); + + GoogleAnalyticsAdminV1alphaListFirebaseLinksResponse.fromJson( + core.Map _json) { + if (_json.containsKey('firebaseLinks')) { + firebaseLinks = (_json['firebaseLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaFirebaseLink>((value) => + GoogleAnalyticsAdminV1alphaFirebaseLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (firebaseLinks != null) { + _json['firebaseLinks'] = + firebaseLinks.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for ListGoogleAdsLinks RPC. +class GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse { + /// List of GoogleAdsLinks. + core.List<GoogleAnalyticsAdminV1alphaGoogleAdsLink> googleAdsLinks; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse(); + + GoogleAnalyticsAdminV1alphaListGoogleAdsLinksResponse.fromJson( + core.Map _json) { + if (_json.containsKey('googleAdsLinks')) { + googleAdsLinks = (_json['googleAdsLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaGoogleAdsLink>((value) => + GoogleAnalyticsAdminV1alphaGoogleAdsLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (googleAdsLinks != null) { + _json['googleAdsLinks'] = + googleAdsLinks.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Request message for ListIosAppDataStreams RPC. +class GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse { + /// Results that matched the filter criteria and were accessible to the + /// caller. + core.List<GoogleAnalyticsAdminV1alphaIosAppDataStream> iosAppDataStreams; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse(); + + GoogleAnalyticsAdminV1alphaListIosAppDataStreamsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('iosAppDataStreams')) { + iosAppDataStreams = (_json['iosAppDataStreams'] as core.List) + .map<GoogleAnalyticsAdminV1alphaIosAppDataStream>((value) => + GoogleAnalyticsAdminV1alphaIosAppDataStream.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (iosAppDataStreams != null) { + _json['iosAppDataStreams'] = + iosAppDataStreams.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for ListProperties RPC. +class GoogleAnalyticsAdminV1alphaListPropertiesResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Results that matched the filter criteria and were accessible to the + /// caller. + core.List<GoogleAnalyticsAdminV1alphaProperty> properties; + + GoogleAnalyticsAdminV1alphaListPropertiesResponse(); + + GoogleAnalyticsAdminV1alphaListPropertiesResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('properties')) { + properties = (_json['properties'] as core.List) + .map<GoogleAnalyticsAdminV1alphaProperty>((value) => + GoogleAnalyticsAdminV1alphaProperty.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (properties != null) { + _json['properties'] = properties.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for ListUserLinks RPC. +class GoogleAnalyticsAdminV1alphaListUserLinksResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// List of UserLinks. + /// + /// These will be ordered stably, but in an arbitrary order. + core.List<GoogleAnalyticsAdminV1alphaUserLink> userLinks; + + GoogleAnalyticsAdminV1alphaListUserLinksResponse(); + + GoogleAnalyticsAdminV1alphaListUserLinksResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('userLinks')) { + userLinks = (_json['userLinks'] as core.List) + .map<GoogleAnalyticsAdminV1alphaUserLink>((value) => + GoogleAnalyticsAdminV1alphaUserLink.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (userLinks != null) { + _json['userLinks'] = userLinks.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for ListWebDataStreams RPC. +class GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Results that matched the filter criteria and were accessible to the + /// caller. + core.List<GoogleAnalyticsAdminV1alphaWebDataStream> webDataStreams; + + GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse(); + + GoogleAnalyticsAdminV1alphaListWebDataStreamsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('webDataStreams')) { + webDataStreams = (_json['webDataStreams'] as core.List) + .map<GoogleAnalyticsAdminV1alphaWebDataStream>((value) => + GoogleAnalyticsAdminV1alphaWebDataStream.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (webDataStreams != null) { + _json['webDataStreams'] = + webDataStreams.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A resource message representing a Google Analytics GA4 property. +class GoogleAnalyticsAdminV1alphaProperty { + /// Time when the entity was originally created. + /// + /// Output only. + core.String createTime; + + /// The currency type used in reports involving monetary values. + /// + /// Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", + /// "JPY" + core.String currencyCode; + + /// Indicates whether this Property is soft-deleted or not. + /// + /// Deleted properties are excluded from List results unless specifically + /// requested. + /// + /// Output only. + core.bool deleted; + + /// Human-readable display name for this property. + /// + /// The max allowed display name length is 100 UTF-16 code units. + /// + /// Required. + core.String displayName; + + /// Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK + /// Possible string values are: + /// - "INDUSTRY_CATEGORY_UNSPECIFIED" : Industry category unspecified + /// - "AUTOMOTIVE" : Automotive + /// - "BUSINESS_AND_INDUSTRIAL_MARKETS" : Business and industrial markets + /// - "FINANCE" : Finance + /// - "HEALTHCARE" : Healthcare + /// - "TECHNOLOGY" : Technology + /// - "TRAVEL" : Travel + /// - "OTHER" : Other + /// - "ARTS_AND_ENTERTAINMENT" : Arts and entertainment + /// - "BEAUTY_AND_FITNESS" : Beauty and fitness + /// - "BOOKS_AND_LITERATURE" : Books and literature + /// - "FOOD_AND_DRINK" : Food and drink + /// - "GAMES" : Games + /// - "HOBBIES_AND_LEISURE" : Hobbies and leisure + /// - "HOME_AND_GARDEN" : Home and garden + /// - "INTERNET_AND_TELECOM" : Internet and telecom + /// - "LAW_AND_GOVERNMENT" : Law and government + /// - "NEWS" : News + /// - "ONLINE_COMMUNITIES" : Online communities + /// - "PEOPLE_AND_SOCIETY" : People and society + /// - "PETS_AND_ANIMALS" : Pets and animals + /// - "REAL_ESTATE" : Real estate + /// - "REFERENCE" : Reference + /// - "SCIENCE" : Science + /// - "SPORTS" : Sports + /// - "JOBS_AND_EDUCATION" : Jobs and education + /// - "SHOPPING" : Shopping + core.String industryCategory; + + /// Resource name of this property. + /// + /// Format: properties/{property_id} Example: "properties/1000" + /// + /// Output only. + core.String name; + + /// Resource name of this property's logical parent. + /// + /// Note: The Property-Moving UI can be used to change the parent. Format: + /// accounts/{account} Example: "accounts/100" + /// + /// Immutable. + core.String parent; + + /// Reporting Time Zone, used as the day boundary for reports, regardless of + /// where the data originates. + /// + /// If the time zone honors DST, Analytics will automatically adjust for the + /// changes. NOTE: Changing the time zone only affects data going forward, and + /// is not applied retroactively. Format: https://www.iana.org/time-zones + /// Example: "America/Los_Angeles" + core.String timeZone; + + /// Time when entity payload fields were last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaProperty(); + + GoogleAnalyticsAdminV1alphaProperty.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('deleted')) { + deleted = _json['deleted'] as core.bool; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('industryCategory')) { + industryCategory = _json['industryCategory'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('parent')) { + parent = _json['parent'] as core.String; + } + if (_json.containsKey('timeZone')) { + timeZone = _json['timeZone'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (deleted != null) { + _json['deleted'] = deleted; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (industryCategory != null) { + _json['industryCategory'] = industryCategory; + } + if (name != null) { + _json['name'] = name; + } + if (parent != null) { + _json['parent'] = parent; + } + if (timeZone != null) { + _json['timeZone'] = timeZone; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A virtual resource representing metadata for an GA4 property. +class GoogleAnalyticsAdminV1alphaPropertySummary { + /// Display name for the property referred to in this account summary. + core.String displayName; + + /// Resource name of property referred to by this property summary Format: + /// properties/{property_id} Example: "properties/1000" + core.String property; + + GoogleAnalyticsAdminV1alphaPropertySummary(); + + GoogleAnalyticsAdminV1alphaPropertySummary.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('property')) { + property = _json['property'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (property != null) { + _json['property'] = property; + } + return _json; + } +} + +/// Request message for ProvisionAccountTicket RPC. +class GoogleAnalyticsAdminV1alphaProvisionAccountTicketRequest { + /// The account to create. + GoogleAnalyticsAdminV1alphaAccount account; + + /// Redirect URI where the user will be sent after accepting Terms of Service. + /// + /// Must be configured in Developers Console as a Redirect URI + core.String redirectUri; + + GoogleAnalyticsAdminV1alphaProvisionAccountTicketRequest(); + + GoogleAnalyticsAdminV1alphaProvisionAccountTicketRequest.fromJson( + core.Map _json) { + if (_json.containsKey('account')) { + account = GoogleAnalyticsAdminV1alphaAccount.fromJson( + _json['account'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('redirectUri')) { + redirectUri = _json['redirectUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (account != null) { + _json['account'] = account.toJson(); + } + if (redirectUri != null) { + _json['redirectUri'] = redirectUri; + } + return _json; + } +} + +/// Response message for ProvisionAccountTicket RPC. +class GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse { + /// The param to be passed in the ToS link. + core.String accountTicketId; + + GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse(); + + GoogleAnalyticsAdminV1alphaProvisionAccountTicketResponse.fromJson( + core.Map _json) { + if (_json.containsKey('accountTicketId')) { + accountTicketId = _json['accountTicketId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accountTicketId != null) { + _json['accountTicketId'] = accountTicketId; + } + return _json; + } +} + +/// Request message for UpdateUserLink RPC. +class GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest { + /// The user link to update. + /// + /// Required. + GoogleAnalyticsAdminV1alphaUserLink userLink; + + GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest(); + + GoogleAnalyticsAdminV1alphaUpdateUserLinkRequest.fromJson(core.Map _json) { + if (_json.containsKey('userLink')) { + userLink = GoogleAnalyticsAdminV1alphaUserLink.fromJson( + _json['userLink'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userLink != null) { + _json['userLink'] = userLink.toJson(); + } + return _json; + } +} + +/// A resource message representing a user's permissions on an Account or +/// Property resource. +class GoogleAnalyticsAdminV1alphaUserLink { + /// Roles directly assigned to this user for this account or property. + /// + /// Valid values: predefinedRoles/read predefinedRoles/collaborate + /// predefinedRoles/edit predefinedRoles/manage-users Excludes roles that are + /// inherited from a higher-level entity, group, or organization admin role. A + /// UserLink that is updated to have an empty list of direct_roles will be + /// deleted. + core.List<core.String> directRoles; + + /// Email address of the user to link + core.String emailAddress; + + /// Example format: properties/1234/userLinks/5678 + core.String name; + + GoogleAnalyticsAdminV1alphaUserLink(); + + GoogleAnalyticsAdminV1alphaUserLink.fromJson(core.Map _json) { + if (_json.containsKey('directRoles')) { + directRoles = (_json['directRoles'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('emailAddress')) { + emailAddress = _json['emailAddress'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (directRoles != null) { + _json['directRoles'] = directRoles; + } + if (emailAddress != null) { + _json['emailAddress'] = emailAddress; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// A resource message representing a Google Analytics web stream. +class GoogleAnalyticsAdminV1alphaWebDataStream { + /// Time when this stream was originally created. + /// + /// Output only. + core.String createTime; + + /// Domain name of the web app being measured, or empty. + /// + /// Example: "http://www.google.com", "https://www.google.com" + /// + /// Immutable. + core.String defaultUri; + + /// Human-readable display name for the Data Stream. + /// + /// The max allowed display name length is 100 UTF-16 code units. + /// + /// Required. + core.String displayName; + + /// ID of the corresponding web app in Firebase, if any. + /// + /// This ID can change if the web app is deleted and recreated. + /// + /// Output only. + core.String firebaseAppId; + + /// Analytics "Measurement ID", without the "G-" prefix. + /// + /// Example: "G-1A2BCD345E" would just be "1A2BCD345E" + /// + /// Output only. + core.String measurementId; + + /// Resource name of this Data Stream. + /// + /// Format: properties/{property_id}/webDataStreams/{stream_id} Example: + /// "properties/1000/webDataStreams/2000" + /// + /// Output only. + core.String name; + + /// Time when stream payload fields were last updated. + /// + /// Output only. + core.String updateTime; + + GoogleAnalyticsAdminV1alphaWebDataStream(); + + GoogleAnalyticsAdminV1alphaWebDataStream.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('defaultUri')) { + defaultUri = _json['defaultUri'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('firebaseAppId')) { + firebaseAppId = _json['firebaseAppId'] as core.String; + } + if (_json.containsKey('measurementId')) { + measurementId = _json['measurementId'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (defaultUri != null) { + _json['defaultUri'] = defaultUri; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (firebaseAppId != null) { + _json['firebaseAppId'] = firebaseAppId; + } + if (measurementId != null) { + _json['measurementId'] = measurementId; + } + if (name != null) { + _json['name'] = name; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class GoogleProtobufEmpty { + GoogleProtobufEmpty(); + + GoogleProtobufEmpty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/analyticsdata/v1alpha.dart b/generated/googleapis_beta/lib/analyticsdata/v1alpha.dart new file mode 100644 index 0000000..8db3575 --- /dev/null +++ b/generated/googleapis_beta/lib/analyticsdata/v1alpha.dart
@@ -0,0 +1,3140 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Google Analytics Data API - v1alpha +/// +/// Accesses report data in Google Analytics. +/// +/// For more information, see +/// <https://developers.google.com/analytics/devguides/reporting/data/v1/> +/// +/// Create an instance of [AnalyticsDataApi] to access these resources: +/// +/// - [PropertiesResource] +/// - [V1alphaResource] +library analyticsdata.v1alpha; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Accesses report data in Google Analytics. +class AnalyticsDataApi { + /// View and manage your Google Analytics data + static const analyticsScope = 'https://www.googleapis.com/auth/analytics'; + + /// See and download your Google Analytics data + static const analyticsReadonlyScope = + 'https://www.googleapis.com/auth/analytics.readonly'; + + final commons.ApiRequester _requester; + + PropertiesResource get properties => PropertiesResource(_requester); + V1alphaResource get v1alpha => V1alphaResource(_requester); + + AnalyticsDataApi(http.Client client, + {core.String rootUrl = 'https://analyticsdata.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class PropertiesResource { + final commons.ApiRequester _requester; + + PropertiesResource(commons.ApiRequester client) : _requester = client; + + /// Returns metadata for dimensions and metrics available in reporting + /// methods. + /// + /// Used to explore the dimensions and metrics. In this method, a Google + /// Analytics GA4 Property Identifier is specified in the request, and the + /// metadata response includes Custom dimensions and metrics as well as + /// Universal metadata. For example if a custom metric with parameter name + /// `levels_unlocked` is registered to a property, the Metadata response will + /// contain `customEvent:levels_unlocked`. Universal metadata are dimensions + /// and metrics applicable to any property such as `country` and `totalUsers`. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name of the metadata to retrieve. This + /// name field is specified in the URL path and not URL parameters. Property + /// is a numeric Google Analytics GA4 Property identifier. To learn more, see + /// [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + /// Example: properties/1234/metadata Set the Property ID to 0 for dimensions + /// and metrics common to all properties. In this special mode, this method + /// will not return custom dimensions and metrics. + /// Value must have pattern `^properties/\[^/\]+/metadata$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Metadata]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Metadata> getMetadata( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Metadata.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// The Google Analytics Realtime API returns a customized report of realtime + /// event data for your property. + /// + /// These reports show events and usage from the last 30 minutes. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [property] - A Google Analytics GA4 property identifier whose events are + /// tracked. Specified in the URL path and not the body. To learn more, see + /// [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + /// Example: properties/1234 + /// Value must have pattern `^properties/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [RunRealtimeReportResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<RunRealtimeReportResponse> runRealtimeReport( + RunRealtimeReportRequest request, + core.String property, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (property == null) { + throw core.ArgumentError('Parameter property is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha/' + + commons.Escaper.ecapeVariableReserved('$property') + + ':runRealtimeReport'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => RunRealtimeReportResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class V1alphaResource { + final commons.ApiRequester _requester; + + V1alphaResource(commons.ApiRequester client) : _requester = client; + + /// Returns multiple pivot reports in a batch. + /// + /// All reports must be for the same Entity. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [BatchRunPivotReportsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<BatchRunPivotReportsResponse> batchRunPivotReports( + BatchRunPivotReportsRequest request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha:batchRunPivotReports'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => BatchRunPivotReportsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns multiple reports in a batch. + /// + /// All reports must be for the same Entity. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [BatchRunReportsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<BatchRunReportsResponse> batchRunReports( + BatchRunReportsRequest request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha:batchRunReports'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => BatchRunReportsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a customized pivot report of your Google Analytics event data. + /// + /// Pivot reports are more advanced and expressive formats than regular + /// reports. In a pivot report, dimensions are only visible if they are + /// included in a pivot. Multiple pivots can be specified to further dissect + /// your data. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [RunPivotReportResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<RunPivotReportResponse> runPivotReport( + RunPivotReportRequest request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha:runPivotReport'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => RunPivotReportResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a customized report of your Google Analytics event data. + /// + /// Reports contain statistics derived from data collected by the Google + /// Analytics tracking code. The data returned from the API is as a table with + /// columns for the requested dimensions and metrics. Metrics are individual + /// measurements of user activity on your property, such as active users or + /// event count. Dimensions break down metrics across some common criteria, + /// such as country or event name. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [RunReportResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<RunReportResponse> runReport( + RunReportRequest request, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha:runReport'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => RunReportResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// The batch request containing multiple pivot report requests. +class BatchRunPivotReportsRequest { + /// A property whose events are tracked. + /// + /// This entity must be specified for the batch. The entity within + /// RunPivotReportRequest may either be unspecified or consistent with this + /// entity. + Entity entity; + + /// Individual requests. + /// + /// Each request has a separate pivot report response. Each batch request is + /// allowed up to 5 requests. + core.List<RunPivotReportRequest> requests; + + BatchRunPivotReportsRequest(); + + BatchRunPivotReportsRequest.fromJson(core.Map _json) { + if (_json.containsKey('entity')) { + entity = Entity.fromJson( + _json['entity'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<RunPivotReportRequest>((value) => RunPivotReportRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (entity != null) { + _json['entity'] = entity.toJson(); + } + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The batch response containing multiple pivot reports. +class BatchRunPivotReportsResponse { + /// Individual responses. + /// + /// Each response has a separate pivot report request. + core.List<RunPivotReportResponse> pivotReports; + + BatchRunPivotReportsResponse(); + + BatchRunPivotReportsResponse.fromJson(core.Map _json) { + if (_json.containsKey('pivotReports')) { + pivotReports = (_json['pivotReports'] as core.List) + .map<RunPivotReportResponse>((value) => + RunPivotReportResponse.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pivotReports != null) { + _json['pivotReports'] = + pivotReports.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The batch request containing multiple report requests. +class BatchRunReportsRequest { + /// A property whose events are tracked. + /// + /// This entity must be specified for the batch. The entity within + /// RunReportRequest may either be unspecified or consistent with this entity. + Entity entity; + + /// Individual requests. + /// + /// Each request has a separate report response. Each batch request is allowed + /// up to 5 requests. + core.List<RunReportRequest> requests; + + BatchRunReportsRequest(); + + BatchRunReportsRequest.fromJson(core.Map _json) { + if (_json.containsKey('entity')) { + entity = Entity.fromJson( + _json['entity'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<RunReportRequest>((value) => RunReportRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (entity != null) { + _json['entity'] = entity.toJson(); + } + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The batch response containing multiple reports. +class BatchRunReportsResponse { + /// Individual responses. + /// + /// Each response has a separate report request. + core.List<RunReportResponse> reports; + + BatchRunReportsResponse(); + + BatchRunReportsResponse.fromJson(core.Map _json) { + if (_json.containsKey('reports')) { + reports = (_json['reports'] as core.List) + .map<RunReportResponse>((value) => RunReportResponse.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (reports != null) { + _json['reports'] = reports.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// To express that the result needs to be between two numbers (inclusive). +class BetweenFilter { + /// Begins with this number. + NumericValue fromValue; + + /// Ends with this number. + NumericValue toValue; + + BetweenFilter(); + + BetweenFilter.fromJson(core.Map _json) { + if (_json.containsKey('fromValue')) { + fromValue = NumericValue.fromJson( + _json['fromValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('toValue')) { + toValue = NumericValue.fromJson( + _json['toValue'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (fromValue != null) { + _json['fromValue'] = fromValue.toJson(); + } + if (toValue != null) { + _json['toValue'] = toValue.toJson(); + } + return _json; + } +} + +/// Used to convert a dimension value to a single case. +class CaseExpression { + /// Name of a dimension. + /// + /// The name must refer back to a name in dimensions field of the request. + core.String dimensionName; + + CaseExpression(); + + CaseExpression.fromJson(core.Map _json) { + if (_json.containsKey('dimensionName')) { + dimensionName = _json['dimensionName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionName != null) { + _json['dimensionName'] = dimensionName; + } + return _json; + } +} + +/// Defines a cohort selection criteria. +/// +/// A cohort is a group of users who share a common characteristic. For example, +/// users with the same `firstSessionDate` belong to the same cohort. +class Cohort { + /// The cohort selects users whose first touch date is between start date and + /// end date defined in the `dateRange`. + /// + /// This `dateRange` does not specify the full date range of event data that + /// is present in a cohort report. In a cohort report, this `dateRange` is + /// extended by the granularity and offset present in the `cohortsRange`; + /// event data for the extended reporting date range is present in a cohort + /// report. In a cohort request, this `dateRange` is required and the + /// `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be + /// unspecified. This `dateRange` should generally be aligned with the + /// cohort's granularity. If `CohortsRange` uses daily granularity, this + /// `dateRange` can be a single day. If `CohortsRange` uses weekly + /// granularity, this `dateRange` can be aligned to a week boundary, starting + /// at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, + /// this `dateRange` can be aligned to a month, starting at the first and + /// ending on the last day of the month. + DateRange dateRange; + + /// Dimension used by the cohort. + /// + /// Required and only supports `firstSessionDate`. + core.String dimension; + + /// Assigns a name to this cohort. + /// + /// The dimension `cohort` is valued to this name in a report response. If + /// set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are + /// named by their zero based index `cohort_0`, `cohort_1`, etc. + core.String name; + + Cohort(); + + Cohort.fromJson(core.Map _json) { + if (_json.containsKey('dateRange')) { + dateRange = DateRange.fromJson( + _json['dateRange'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dimension')) { + dimension = _json['dimension'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dateRange != null) { + _json['dateRange'] = dateRange.toJson(); + } + if (dimension != null) { + _json['dimension'] = dimension; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Optional settings of a cohort report. +class CohortReportSettings { + /// If true, accumulates the result from first touch day to the end day. + /// + /// Not supported in `RunReportRequest`. + core.bool accumulate; + + CohortReportSettings(); + + CohortReportSettings.fromJson(core.Map _json) { + if (_json.containsKey('accumulate')) { + accumulate = _json['accumulate'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accumulate != null) { + _json['accumulate'] = accumulate; + } + return _json; + } +} + +/// The specification of cohorts for a cohort report. +/// +/// Cohort reports create a time series of user retention for the cohort. For +/// example, you could select the cohort of users that were acquired in the +/// first week of September and follow that cohort for the next six weeks. +/// Selecting the users acquired in the first week of September cohort is +/// specified in the `cohort` object. Following that cohort for the next six +/// weeks is specified in the `cohortsRange` object. For examples, see +/// [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). +/// The report response could show a weekly time series where say your app has +/// retained 60% of this cohort after three weeks and 25% of this cohort after +/// six weeks. These two percentages can be calculated by the metric +/// `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the +/// report. +class CohortSpec { + /// Optional settings for a cohort report. + CohortReportSettings cohortReportSettings; + + /// Defines the selection criteria to group users into cohorts. + /// + /// Most cohort reports define only a single cohort. If multiple cohorts are + /// specified, each cohort can be recognized in the report by their name. + core.List<Cohort> cohorts; + + /// Cohort reports follow cohorts over an extended reporting date range. + /// + /// This range specifies an offset duration to follow the cohorts over. + CohortsRange cohortsRange; + + CohortSpec(); + + CohortSpec.fromJson(core.Map _json) { + if (_json.containsKey('cohortReportSettings')) { + cohortReportSettings = CohortReportSettings.fromJson( + _json['cohortReportSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('cohorts')) { + cohorts = (_json['cohorts'] as core.List) + .map<Cohort>((value) => + Cohort.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('cohortsRange')) { + cohortsRange = CohortsRange.fromJson( + _json['cohortsRange'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cohortReportSettings != null) { + _json['cohortReportSettings'] = cohortReportSettings.toJson(); + } + if (cohorts != null) { + _json['cohorts'] = cohorts.map((value) => value.toJson()).toList(); + } + if (cohortsRange != null) { + _json['cohortsRange'] = cohortsRange.toJson(); + } + return _json; + } +} + +/// Configures the extended reporting date range for a cohort report. +/// +/// Specifies an offset duration to follow the cohorts over. +class CohortsRange { + /// `endOffset` specifies the end date of the extended reporting date range + /// for a cohort report. + /// + /// `endOffset` can be any positive integer but is commonly set to 5 to 10 so + /// that reports contain data on the cohort for the next several granularity + /// time periods. If `granularity` is `DAILY`, the `endDate` of the extended + /// reporting date range is `endDate` of the cohort plus `endOffset` days. If + /// `granularity` is `WEEKLY`, the `endDate` of the extended reporting date + /// range is `endDate` of the cohort plus `endOffset * 7` days. If + /// `granularity` is `MONTHLY`, the `endDate` of the extended reporting date + /// range is `endDate` of the cohort plus `endOffset * 30` days. + /// + /// Required. + core.int endOffset; + + /// The granularity used to interpret the `startOffset` and `endOffset` for + /// the extended reporting date range for a cohort report. + /// + /// Required. + /// Possible string values are: + /// - "GRANULARITY_UNSPECIFIED" : Should never be specified. + /// - "DAILY" : Daily granularity. Commonly used if the cohort's `dateRange` + /// is a single day and the request contains `cohortNthDay`. + /// - "WEEKLY" : Weekly granularity. Commonly used if the cohort's `dateRange` + /// is a week in duration (starting on Sunday and ending on Saturday) and the + /// request contains `cohortNthWeek`. + /// - "MONTHLY" : Monthly granularity. Commonly used if the cohort's + /// `dateRange` is a month in duration and the request contains + /// `cohortNthMonth`. + core.String granularity; + + /// `startOffset` specifies the start date of the extended reporting date + /// range for a cohort report. + /// + /// `startOffset` is commonly set to 0 so that reports contain data from the + /// acquisition of the cohort forward. If `granularity` is `DAILY`, the + /// `startDate` of the extended reporting date range is `startDate` of the + /// cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the + /// `startDate` of the extended reporting date range is `startDate` of the + /// cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the + /// `startDate` of the extended reporting date range is `startDate` of the + /// cohort plus `startOffset * 30` days. + core.int startOffset; + + CohortsRange(); + + CohortsRange.fromJson(core.Map _json) { + if (_json.containsKey('endOffset')) { + endOffset = _json['endOffset'] as core.int; + } + if (_json.containsKey('granularity')) { + granularity = _json['granularity'] as core.String; + } + if (_json.containsKey('startOffset')) { + startOffset = _json['startOffset'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endOffset != null) { + _json['endOffset'] = endOffset; + } + if (granularity != null) { + _json['granularity'] = granularity; + } + if (startOffset != null) { + _json['startOffset'] = startOffset; + } + return _json; + } +} + +/// Used to combine dimension values to a single dimension. +class ConcatenateExpression { + /// The delimiter placed between dimension names. + /// + /// Delimiters are often single characters such as "|" or "," but can be + /// longer strings. If a dimension value contains the delimiter, both will be + /// present in response with no distinction. For example if dimension 1 value + /// = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the + /// response will contain "US,FR,JP". + core.String delimiter; + + /// Names of dimensions. + /// + /// The names must refer back to names in the dimensions field of the request. + core.List<core.String> dimensionNames; + + ConcatenateExpression(); + + ConcatenateExpression.fromJson(core.Map _json) { + if (_json.containsKey('delimiter')) { + delimiter = _json['delimiter'] as core.String; + } + if (_json.containsKey('dimensionNames')) { + dimensionNames = (_json['dimensionNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (delimiter != null) { + _json['delimiter'] = delimiter; + } + if (dimensionNames != null) { + _json['dimensionNames'] = dimensionNames; + } + return _json; + } +} + +/// A contiguous set of days: startDate, startDate + 1, ..., endDate. +/// +/// Requests are allowed up to 4 date ranges. +class DateRange { + /// The inclusive end date for the query in the format `YYYY-MM-DD`. + /// + /// Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or + /// `today` is also accepted, and in that case, the date is inferred based on + /// the property's reporting time zone. + core.String endDate; + + /// Assigns a name to this date range. + /// + /// The dimension `dateRange` is valued to this name in a report response. If + /// set, cannot begin with `date_range_` or `RESERVED_`. If not set, date + /// ranges are named by their zero based index in the request: `date_range_0`, + /// `date_range_1`, etc. + core.String name; + + /// The inclusive start date for the query in the format `YYYY-MM-DD`. + /// + /// Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` + /// is also accepted, and in that case, the date is inferred based on the + /// property's reporting time zone. + core.String startDate; + + DateRange(); + + DateRange.fromJson(core.Map _json) { + if (_json.containsKey('endDate')) { + endDate = _json['endDate'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('startDate')) { + startDate = _json['startDate'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endDate != null) { + _json['endDate'] = endDate; + } + if (name != null) { + _json['name'] = name; + } + if (startDate != null) { + _json['startDate'] = startDate; + } + return _json; + } +} + +/// Dimensions are attributes of your data. +/// +/// For example, the dimension city indicates the city from which an event +/// originates. Dimension values in report responses are strings; for example, +/// city could be "Paris" or "New York". Requests are allowed up to 8 +/// dimensions. +class Dimension { + /// One dimension can be the result of an expression of multiple dimensions. + /// + /// For example, dimension "country, city": concatenate(country, ", ", city). + DimensionExpression dimensionExpression; + + /// The name of the dimension. + /// + /// See the + /// [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) + /// for the list of dimension names. If `dimensionExpression` is specified, + /// `name` can be any string that you would like. For example if a + /// `dimensionExpression` concatenates `country` and `city`, you could call + /// that dimension `countryAndCity`. Dimensions are referenced by `name` in + /// `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`. + core.String name; + + Dimension(); + + Dimension.fromJson(core.Map _json) { + if (_json.containsKey('dimensionExpression')) { + dimensionExpression = DimensionExpression.fromJson( + _json['dimensionExpression'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionExpression != null) { + _json['dimensionExpression'] = dimensionExpression.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Used to express a dimension which is the result of a formula of multiple +/// dimensions. +/// +/// Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, +/// dimension2). +class DimensionExpression { + /// Used to combine dimension values to a single dimension. + /// + /// For example, dimension "country, city": concatenate(country, ", ", city). + ConcatenateExpression concatenate; + + /// Used to convert a dimension value to lower case. + CaseExpression lowerCase; + + /// Used to convert a dimension value to upper case. + CaseExpression upperCase; + + DimensionExpression(); + + DimensionExpression.fromJson(core.Map _json) { + if (_json.containsKey('concatenate')) { + concatenate = ConcatenateExpression.fromJson( + _json['concatenate'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('lowerCase')) { + lowerCase = CaseExpression.fromJson( + _json['lowerCase'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('upperCase')) { + upperCase = CaseExpression.fromJson( + _json['upperCase'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (concatenate != null) { + _json['concatenate'] = concatenate.toJson(); + } + if (lowerCase != null) { + _json['lowerCase'] = lowerCase.toJson(); + } + if (upperCase != null) { + _json['upperCase'] = upperCase.toJson(); + } + return _json; + } +} + +/// Describes a dimension column in the report. +/// +/// Dimensions requested in a report produce column entries within rows and +/// DimensionHeaders. However, dimensions used exclusively within filters or +/// expressions do not produce columns in a report; correspondingly, those +/// dimensions do not produce headers. +class DimensionHeader { + /// The dimension's name. + core.String name; + + DimensionHeader(); + + DimensionHeader.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Explains a dimension. +class DimensionMetadata { + /// This dimension's name. + /// + /// Useable in \[Dimension\](#Dimension)'s `name`. For example, `eventName`. + core.String apiName; + + /// True if the dimension is a custom dimension for this property. + core.bool customDefinition; + + /// Still usable but deprecated names for this dimension. + /// + /// If populated, this dimension is available by either `apiName` or one of + /// `deprecatedApiNames` for a period of time. After the deprecation period, + /// the dimension will be available only by `apiName`. + core.List<core.String> deprecatedApiNames; + + /// Description of how this dimension is used and calculated. + core.String description; + + /// This dimension's name within the Google Analytics user interface. + /// + /// For example, `Event name`. + core.String uiName; + + DimensionMetadata(); + + DimensionMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiName')) { + apiName = _json['apiName'] as core.String; + } + if (_json.containsKey('customDefinition')) { + customDefinition = _json['customDefinition'] as core.bool; + } + if (_json.containsKey('deprecatedApiNames')) { + deprecatedApiNames = (_json['deprecatedApiNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('uiName')) { + uiName = _json['uiName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiName != null) { + _json['apiName'] = apiName; + } + if (customDefinition != null) { + _json['customDefinition'] = customDefinition; + } + if (deprecatedApiNames != null) { + _json['deprecatedApiNames'] = deprecatedApiNames; + } + if (description != null) { + _json['description'] = description; + } + if (uiName != null) { + _json['uiName'] = uiName; + } + return _json; + } +} + +/// Sorts by dimension values. +class DimensionOrderBy { + /// A dimension name in the request to order by. + core.String dimensionName; + + /// Controls the rule for dimension value ordering. + /// Possible string values are: + /// - "ORDER_TYPE_UNSPECIFIED" : Unspecified. + /// - "ALPHANUMERIC" : Alphanumeric sort by Unicode code point. For example, + /// "2" < "A" < "X" < "b" < "z". + /// - "CASE_INSENSITIVE_ALPHANUMERIC" : Case insensitive alphanumeric sort by + /// lower case Unicode code point. For example, "2" < "A" < "b" < "X" < "z". + /// - "NUMERIC" : Dimension values are converted to numbers before sorting. + /// For example in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, + /// "100" < "25". Non-numeric dimension values all have equal ordering value + /// below all numeric values. + core.String orderType; + + DimensionOrderBy(); + + DimensionOrderBy.fromJson(core.Map _json) { + if (_json.containsKey('dimensionName')) { + dimensionName = _json['dimensionName'] as core.String; + } + if (_json.containsKey('orderType')) { + orderType = _json['orderType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionName != null) { + _json['dimensionName'] = dimensionName; + } + if (orderType != null) { + _json['orderType'] = orderType; + } + return _json; + } +} + +/// The value of a dimension. +class DimensionValue { + /// Value as a string if the dimension type is a string. + core.String value; + + DimensionValue(); + + DimensionValue.fromJson(core.Map _json) { + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// The unique identifier of the property whose events are tracked. +class Entity { + /// A Google Analytics GA4 property id. + /// + /// To learn more, see + /// [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). + core.String propertyId; + + Entity(); + + Entity.fromJson(core.Map _json) { + if (_json.containsKey('propertyId')) { + propertyId = _json['propertyId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (propertyId != null) { + _json['propertyId'] = propertyId; + } + return _json; + } +} + +/// An expression to filter dimension or metric values. +class Filter { + /// A filter for two values. + BetweenFilter betweenFilter; + + /// The dimension name or metric name. + /// + /// Must be a name defined in dimensions or metrics. + core.String fieldName; + + /// A filter for in list values. + InListFilter inListFilter; + + /// A filter for null values. + /// + /// If True, a null dimension value is matched by this filter. Null filter is + /// commonly used inside a NOT filter expression. For example, a NOT + /// expression of a null filter removes rows when a dimension is null. + core.bool nullFilter; + + /// A filter for numeric or date values. + NumericFilter numericFilter; + + /// Strings related filter. + StringFilter stringFilter; + + Filter(); + + Filter.fromJson(core.Map _json) { + if (_json.containsKey('betweenFilter')) { + betweenFilter = BetweenFilter.fromJson( + _json['betweenFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('fieldName')) { + fieldName = _json['fieldName'] as core.String; + } + if (_json.containsKey('inListFilter')) { + inListFilter = InListFilter.fromJson( + _json['inListFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('nullFilter')) { + nullFilter = _json['nullFilter'] as core.bool; + } + if (_json.containsKey('numericFilter')) { + numericFilter = NumericFilter.fromJson( + _json['numericFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('stringFilter')) { + stringFilter = StringFilter.fromJson( + _json['stringFilter'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (betweenFilter != null) { + _json['betweenFilter'] = betweenFilter.toJson(); + } + if (fieldName != null) { + _json['fieldName'] = fieldName; + } + if (inListFilter != null) { + _json['inListFilter'] = inListFilter.toJson(); + } + if (nullFilter != null) { + _json['nullFilter'] = nullFilter; + } + if (numericFilter != null) { + _json['numericFilter'] = numericFilter.toJson(); + } + if (stringFilter != null) { + _json['stringFilter'] = stringFilter.toJson(); + } + return _json; + } +} + +/// To express dimension or metric filters. +/// +/// The fields in the same FilterExpression need to be either all dimensions or +/// all metrics. +class FilterExpression { + /// The FilterExpressions in and_group have an AND relationship. + FilterExpressionList andGroup; + + /// A primitive filter. + /// + /// All fields in filter in same FilterExpression needs to be either all + /// dimensions or metrics. + Filter filter; + + /// The FilterExpression is NOT of not_expression. + FilterExpression notExpression; + + /// The FilterExpressions in or_group have an OR relationship. + FilterExpressionList orGroup; + + FilterExpression(); + + FilterExpression.fromJson(core.Map _json) { + if (_json.containsKey('andGroup')) { + andGroup = FilterExpressionList.fromJson( + _json['andGroup'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('filter')) { + filter = Filter.fromJson( + _json['filter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('notExpression')) { + notExpression = FilterExpression.fromJson( + _json['notExpression'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('orGroup')) { + orGroup = FilterExpressionList.fromJson( + _json['orGroup'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (andGroup != null) { + _json['andGroup'] = andGroup.toJson(); + } + if (filter != null) { + _json['filter'] = filter.toJson(); + } + if (notExpression != null) { + _json['notExpression'] = notExpression.toJson(); + } + if (orGroup != null) { + _json['orGroup'] = orGroup.toJson(); + } + return _json; + } +} + +/// A list of filter expressions. +class FilterExpressionList { + /// A list of filter expressions. + core.List<FilterExpression> expressions; + + FilterExpressionList(); + + FilterExpressionList.fromJson(core.Map _json) { + if (_json.containsKey('expressions')) { + expressions = (_json['expressions'] as core.List) + .map<FilterExpression>((value) => FilterExpression.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (expressions != null) { + _json['expressions'] = + expressions.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The result needs to be in a list of string values. +class InListFilter { + /// If true, the string value is case sensitive. + core.bool caseSensitive; + + /// The list of string values. + /// + /// Must be non-empty. + core.List<core.String> values; + + InListFilter(); + + InListFilter.fromJson(core.Map _json) { + if (_json.containsKey('caseSensitive')) { + caseSensitive = _json['caseSensitive'] as core.bool; + } + if (_json.containsKey('values')) { + values = (_json['values'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (caseSensitive != null) { + _json['caseSensitive'] = caseSensitive; + } + if (values != null) { + _json['values'] = values; + } + return _json; + } +} + +/// The dimensions and metrics currently accepted in reporting methods. +class Metadata { + /// The dimension descriptions. + core.List<DimensionMetadata> dimensions; + + /// The metric descriptions. + core.List<MetricMetadata> metrics; + + /// Resource name of this metadata. + core.String name; + + Metadata(); + + Metadata.fromJson(core.Map _json) { + if (_json.containsKey('dimensions')) { + dimensions = (_json['dimensions'] as core.List) + .map<DimensionMetadata>((value) => DimensionMetadata.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metrics')) { + metrics = (_json['metrics'] as core.List) + .map<MetricMetadata>((value) => MetricMetadata.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensions != null) { + _json['dimensions'] = dimensions.map((value) => value.toJson()).toList(); + } + if (metrics != null) { + _json['metrics'] = metrics.map((value) => value.toJson()).toList(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// The quantitative measurements of a report. +/// +/// For example, the metric `eventCount` is the total number of events. Requests +/// are allowed up to 10 metrics. +class Metric { + /// A mathematical expression for derived metrics. + /// + /// For example, the metric Event count per user is `eventCount/totalUsers`. + core.String expression; + + /// Indicates if a metric is invisible in the report response. + /// + /// If a metric is invisible, the metric will not produce a column in the + /// response, but can be used in `metricFilter`, `orderBys`, or a metric + /// `expression`. + core.bool invisible; + + /// The name of the metric. + /// + /// See the + /// [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) + /// for the list of metric names. If `expression` is specified, `name` can be + /// any string that you would like. For example if `expression` is + /// `screenPageViews/sessions`, you could call that metric's name = + /// `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, + /// `orderBys`, and metric `expression`. + core.String name; + + Metric(); + + Metric.fromJson(core.Map _json) { + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('invisible')) { + invisible = _json['invisible'] as core.bool; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (expression != null) { + _json['expression'] = expression; + } + if (invisible != null) { + _json['invisible'] = invisible; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Describes a metric column in the report. +/// +/// Visible metrics requested in a report produce column entries within rows and +/// MetricHeaders. However, metrics used exclusively within filters or +/// expressions do not produce columns in a report; correspondingly, those +/// metrics do not produce headers. +class MetricHeader { + /// The metric's name. + core.String name; + + /// The metric's data type. + /// Possible string values are: + /// - "METRIC_TYPE_UNSPECIFIED" : Unspecified type. + /// - "TYPE_INTEGER" : Integer type. + /// - "TYPE_FLOAT" : Floating point type. + /// - "TYPE_SECONDS" : A duration of seconds; a special floating point type. + /// - "TYPE_MILLISECONDS" : A duration in milliseconds; a special floating + /// point type. + /// - "TYPE_MINUTES" : A duration in minutes; a special floating point type. + /// - "TYPE_HOURS" : A duration in hours; a special floating point type. + /// - "TYPE_STANDARD" : A custom metric of standard type; a special floating + /// point type. + /// - "TYPE_CURRENCY" : An amount of money; a special floating point type. + /// - "TYPE_FEET" : A length in feet; a special floating point type. + /// - "TYPE_MILES" : A length in miles; a special floating point type. + /// - "TYPE_METERS" : A length in meters; a special floating point type. + /// - "TYPE_KILOMETERS" : A length in kilometers; a special floating point + /// type. + core.String type; + + MetricHeader(); + + MetricHeader.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Explains a metric. +class MetricMetadata { + /// A metric name. + /// + /// Useable in \[Metric\](#Metric)'s `name`. For example, `eventCount`. + core.String apiName; + + /// True if the metric is a custom metric for this property. + core.bool customDefinition; + + /// Still usable but deprecated names for this metric. + /// + /// If populated, this metric is available by either `apiName` or one of + /// `deprecatedApiNames` for a period of time. After the deprecation period, + /// the metric will be available only by `apiName`. + core.List<core.String> deprecatedApiNames; + + /// Description of how this metric is used and calculated. + core.String description; + + /// The mathematical expression for this derived metric. + /// + /// Can be used in \[Metric\](#Metric)'s `expression` field for equivalent + /// reports. Most metrics are not expressions, and for non-expressions, this + /// field is empty. + core.String expression; + + /// The type of this metric. + /// Possible string values are: + /// - "METRIC_TYPE_UNSPECIFIED" : Unspecified type. + /// - "TYPE_INTEGER" : Integer type. + /// - "TYPE_FLOAT" : Floating point type. + /// - "TYPE_SECONDS" : A duration of seconds; a special floating point type. + /// - "TYPE_MILLISECONDS" : A duration in milliseconds; a special floating + /// point type. + /// - "TYPE_MINUTES" : A duration in minutes; a special floating point type. + /// - "TYPE_HOURS" : A duration in hours; a special floating point type. + /// - "TYPE_STANDARD" : A custom metric of standard type; a special floating + /// point type. + /// - "TYPE_CURRENCY" : An amount of money; a special floating point type. + /// - "TYPE_FEET" : A length in feet; a special floating point type. + /// - "TYPE_MILES" : A length in miles; a special floating point type. + /// - "TYPE_METERS" : A length in meters; a special floating point type. + /// - "TYPE_KILOMETERS" : A length in kilometers; a special floating point + /// type. + core.String type; + + /// This metric's name within the Google Analytics user interface. + /// + /// For example, `Event count`. + core.String uiName; + + MetricMetadata(); + + MetricMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiName')) { + apiName = _json['apiName'] as core.String; + } + if (_json.containsKey('customDefinition')) { + customDefinition = _json['customDefinition'] as core.bool; + } + if (_json.containsKey('deprecatedApiNames')) { + deprecatedApiNames = (_json['deprecatedApiNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + if (_json.containsKey('uiName')) { + uiName = _json['uiName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiName != null) { + _json['apiName'] = apiName; + } + if (customDefinition != null) { + _json['customDefinition'] = customDefinition; + } + if (deprecatedApiNames != null) { + _json['deprecatedApiNames'] = deprecatedApiNames; + } + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (type != null) { + _json['type'] = type; + } + if (uiName != null) { + _json['uiName'] = uiName; + } + return _json; + } +} + +/// Sorts by metric values. +class MetricOrderBy { + /// A metric name in the request to order by. + core.String metricName; + + MetricOrderBy(); + + MetricOrderBy.fromJson(core.Map _json) { + if (_json.containsKey('metricName')) { + metricName = _json['metricName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metricName != null) { + _json['metricName'] = metricName; + } + return _json; + } +} + +/// The value of a metric. +class MetricValue { + /// Measurement value. + /// + /// See MetricHeader for type. + core.String value; + + MetricValue(); + + MetricValue.fromJson(core.Map _json) { + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// Filters for numeric or date values. +class NumericFilter { + /// The operation type for this filter. + /// Possible string values are: + /// - "OPERATION_UNSPECIFIED" : Unspecified. + /// - "EQUAL" : Equal + /// - "LESS_THAN" : Less than + /// - "LESS_THAN_OR_EQUAL" : Less than or equal + /// - "GREATER_THAN" : Greater than + /// - "GREATER_THAN_OR_EQUAL" : Greater than or equal + core.String operation; + + /// A numeric value or a date value. + NumericValue value; + + NumericFilter(); + + NumericFilter.fromJson(core.Map _json) { + if (_json.containsKey('operation')) { + operation = _json['operation'] as core.String; + } + if (_json.containsKey('value')) { + value = NumericValue.fromJson( + _json['value'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (operation != null) { + _json['operation'] = operation; + } + if (value != null) { + _json['value'] = value.toJson(); + } + return _json; + } +} + +/// To represent a number. +class NumericValue { + /// Double value + core.double doubleValue; + + /// Integer value + core.String int64Value; + + NumericValue(); + + NumericValue.fromJson(core.Map _json) { + if (_json.containsKey('doubleValue')) { + doubleValue = (_json['doubleValue'] as core.num).toDouble(); + } + if (_json.containsKey('int64Value')) { + int64Value = _json['int64Value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (doubleValue != null) { + _json['doubleValue'] = doubleValue; + } + if (int64Value != null) { + _json['int64Value'] = int64Value; + } + return _json; + } +} + +/// The sort options. +class OrderBy { + /// If true, sorts by descending order. + core.bool desc; + + /// Sorts results by a dimension's values. + DimensionOrderBy dimension; + + /// Sorts results by a metric's values. + MetricOrderBy metric; + + /// Sorts results by a metric's values within a pivot column group. + PivotOrderBy pivot; + + OrderBy(); + + OrderBy.fromJson(core.Map _json) { + if (_json.containsKey('desc')) { + desc = _json['desc'] as core.bool; + } + if (_json.containsKey('dimension')) { + dimension = DimensionOrderBy.fromJson( + _json['dimension'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metric')) { + metric = MetricOrderBy.fromJson( + _json['metric'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('pivot')) { + pivot = PivotOrderBy.fromJson( + _json['pivot'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (desc != null) { + _json['desc'] = desc; + } + if (dimension != null) { + _json['dimension'] = dimension.toJson(); + } + if (metric != null) { + _json['metric'] = metric.toJson(); + } + if (pivot != null) { + _json['pivot'] = pivot.toJson(); + } + return _json; + } +} + +/// Describes the visible dimension columns and rows in the report response. +class Pivot { + /// Dimension names for visible columns in the report response. + /// + /// Including "dateRange" produces a date range column; for each row in the + /// response, dimension values in the date range column will indicate the + /// corresponding date range from the request. + core.List<core.String> fieldNames; + + /// The number of rows to return in this pivot. + /// + /// If unspecified, 10 rows are returned. If -1, all rows are returned. + core.String limit; + + /// Aggregate the metrics by dimensions in this pivot using the specified + /// metric_aggregations. + core.List<core.String> metricAggregations; + + /// The row count of the start row. + /// + /// The first row is counted as row 0. + core.String offset; + + /// Specifies how dimensions are ordered in the pivot. + /// + /// In the first Pivot, the OrderBys determine Row and PivotDimensionHeader + /// ordering; in subsequent Pivots, the OrderBys determine only + /// PivotDimensionHeader ordering. Dimensions specified in these OrderBys must + /// be a subset of Pivot.field_names. + core.List<OrderBy> orderBys; + + Pivot(); + + Pivot.fromJson(core.Map _json) { + if (_json.containsKey('fieldNames')) { + fieldNames = (_json['fieldNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('limit')) { + limit = _json['limit'] as core.String; + } + if (_json.containsKey('metricAggregations')) { + metricAggregations = (_json['metricAggregations'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('offset')) { + offset = _json['offset'] as core.String; + } + if (_json.containsKey('orderBys')) { + orderBys = (_json['orderBys'] as core.List) + .map<OrderBy>((value) => + OrderBy.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (fieldNames != null) { + _json['fieldNames'] = fieldNames; + } + if (limit != null) { + _json['limit'] = limit; + } + if (metricAggregations != null) { + _json['metricAggregations'] = metricAggregations; + } + if (offset != null) { + _json['offset'] = offset; + } + if (orderBys != null) { + _json['orderBys'] = orderBys.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Summarizes dimension values from a row for this pivot. +class PivotDimensionHeader { + /// Values of multiple dimensions in a pivot. + core.List<DimensionValue> dimensionValues; + + PivotDimensionHeader(); + + PivotDimensionHeader.fromJson(core.Map _json) { + if (_json.containsKey('dimensionValues')) { + dimensionValues = (_json['dimensionValues'] as core.List) + .map<DimensionValue>((value) => DimensionValue.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionValues != null) { + _json['dimensionValues'] = + dimensionValues.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Dimensions' values in a single pivot. +class PivotHeader { + /// The size is the same as the cardinality of the corresponding dimension + /// combinations. + core.List<PivotDimensionHeader> pivotDimensionHeaders; + + /// The cardinality of the pivot as if offset = 0 and limit = -1. + /// + /// The total number of rows for this pivot's fields regardless of how the + /// parameters offset and limit are specified in the request. + core.int rowCount; + + PivotHeader(); + + PivotHeader.fromJson(core.Map _json) { + if (_json.containsKey('pivotDimensionHeaders')) { + pivotDimensionHeaders = (_json['pivotDimensionHeaders'] as core.List) + .map<PivotDimensionHeader>((value) => PivotDimensionHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('rowCount')) { + rowCount = _json['rowCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pivotDimensionHeaders != null) { + _json['pivotDimensionHeaders'] = + pivotDimensionHeaders.map((value) => value.toJson()).toList(); + } + if (rowCount != null) { + _json['rowCount'] = rowCount; + } + return _json; + } +} + +/// Sorts by a pivot column group. +class PivotOrderBy { + /// In the response to order by, order rows by this column. + /// + /// Must be a metric name from the request. + core.String metricName; + + /// Used to select a dimension name and value pivot. + /// + /// If multiple pivot selections are given, the sort occurs on rows where all + /// pivot selection dimension name and value pairs match the row's dimension + /// name and value pair. + core.List<PivotSelection> pivotSelections; + + PivotOrderBy(); + + PivotOrderBy.fromJson(core.Map _json) { + if (_json.containsKey('metricName')) { + metricName = _json['metricName'] as core.String; + } + if (_json.containsKey('pivotSelections')) { + pivotSelections = (_json['pivotSelections'] as core.List) + .map<PivotSelection>((value) => PivotSelection.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metricName != null) { + _json['metricName'] = metricName; + } + if (pivotSelections != null) { + _json['pivotSelections'] = + pivotSelections.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A pair of dimension names and values. +/// +/// Rows with this dimension pivot pair are ordered by the metric's value. For +/// example if pivots = {{"browser", "Chrome"}} and metric_name = "Sessions", +/// then the rows will be sorted based on Sessions in Chrome. +/// ---------|----------|----------------|----------|---------------- | Chrome | +/// Chrome | Safari | Safari +/// ---------|----------|----------------|----------|---------------- Country | +/// Sessions | Pages/Sessions | Sessions | Pages/Sessions +/// ---------|----------|----------------|----------|---------------- US | 2 | 2 +/// | 3 | 1 ---------|----------|----------------|----------|---------------- +/// Canada | 3 | 1 | 4 | 1 +/// ---------|----------|----------------|----------|---------------- +class PivotSelection { + /// Must be a dimension name from the request. + core.String dimensionName; + + /// Order by only when the named dimension is this value. + core.String dimensionValue; + + PivotSelection(); + + PivotSelection.fromJson(core.Map _json) { + if (_json.containsKey('dimensionName')) { + dimensionName = _json['dimensionName'] as core.String; + } + if (_json.containsKey('dimensionValue')) { + dimensionValue = _json['dimensionValue'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionName != null) { + _json['dimensionName'] = dimensionName; + } + if (dimensionValue != null) { + _json['dimensionValue'] = dimensionValue; + } + return _json; + } +} + +/// Current state of all quotas for this Analytics Property. +/// +/// If any quota for a property is exhausted, all requests to that property will +/// return Resource Exhausted errors. +class PropertyQuota { + /// Standard Analytics Properties can send up to 10 concurrent requests; + /// Analytics 360 Properties can use up to 50 concurrent requests. + QuotaStatus concurrentRequests; + + /// Standard Analytics Properties and cloud project pairs can have up to 10 + /// server errors per hour; Analytics 360 Properties and cloud project pairs + /// can have up to 50 server errors per hour. + QuotaStatus serverErrorsPerProjectPerHour; + + /// Standard Analytics Properties can use up to 25,000 tokens per day; + /// Analytics 360 Properties can use 250,000 tokens per day. + /// + /// Most requests consume fewer than 10 tokens. + QuotaStatus tokensPerDay; + + /// Standard Analytics Properties can use up to 5,000 tokens per hour; + /// Analytics 360 Properties can use 50,000 tokens per hour. + /// + /// An API request consumes a single number of tokens, and that number is + /// deducted from both the hourly and daily quotas. + QuotaStatus tokensPerHour; + + PropertyQuota(); + + PropertyQuota.fromJson(core.Map _json) { + if (_json.containsKey('concurrentRequests')) { + concurrentRequests = QuotaStatus.fromJson( + _json['concurrentRequests'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('serverErrorsPerProjectPerHour')) { + serverErrorsPerProjectPerHour = QuotaStatus.fromJson( + _json['serverErrorsPerProjectPerHour'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('tokensPerDay')) { + tokensPerDay = QuotaStatus.fromJson( + _json['tokensPerDay'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('tokensPerHour')) { + tokensPerHour = QuotaStatus.fromJson( + _json['tokensPerHour'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (concurrentRequests != null) { + _json['concurrentRequests'] = concurrentRequests.toJson(); + } + if (serverErrorsPerProjectPerHour != null) { + _json['serverErrorsPerProjectPerHour'] = + serverErrorsPerProjectPerHour.toJson(); + } + if (tokensPerDay != null) { + _json['tokensPerDay'] = tokensPerDay.toJson(); + } + if (tokensPerHour != null) { + _json['tokensPerHour'] = tokensPerHour.toJson(); + } + return _json; + } +} + +/// Current state for a particular quota group. +class QuotaStatus { + /// Quota consumed by this request. + core.int consumed; + + /// Quota remaining after this request. + core.int remaining; + + QuotaStatus(); + + QuotaStatus.fromJson(core.Map _json) { + if (_json.containsKey('consumed')) { + consumed = _json['consumed'] as core.int; + } + if (_json.containsKey('remaining')) { + remaining = _json['remaining'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (consumed != null) { + _json['consumed'] = consumed; + } + if (remaining != null) { + _json['remaining'] = remaining; + } + return _json; + } +} + +/// Response's metadata carrying additional information about the report +/// content. +class ResponseMetaData { + /// If true, indicates some buckets of dimension combinations are rolled into + /// "(other)" row. + /// + /// This can happen for high cardinality reports. + core.bool dataLossFromOtherRow; + + ResponseMetaData(); + + ResponseMetaData.fromJson(core.Map _json) { + if (_json.containsKey('dataLossFromOtherRow')) { + dataLossFromOtherRow = _json['dataLossFromOtherRow'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataLossFromOtherRow != null) { + _json['dataLossFromOtherRow'] = dataLossFromOtherRow; + } + return _json; + } +} + +/// Report data for each row. +/// +/// For example if RunReportRequest contains: ```none "dimensions": [ { "name": +/// "eventName" }, { "name": "countryId" } ], "metrics": [ { "name": +/// "eventCount" } ] ``` One row with 'in_app_purchase' as the eventName, 'JP' +/// as the countryId, and 15 as the eventCount, would be: ```none +/// "dimensionValues": [ { "value": "in_app_purchase" }, { "value": "JP" } ], +/// "metricValues": [ { "value": "15" } ] ``` +class Row { + /// List of requested dimension values. + /// + /// In a PivotReport, dimension_values are only listed for dimensions included + /// in a pivot. + core.List<DimensionValue> dimensionValues; + + /// List of requested visible metric values. + core.List<MetricValue> metricValues; + + Row(); + + Row.fromJson(core.Map _json) { + if (_json.containsKey('dimensionValues')) { + dimensionValues = (_json['dimensionValues'] as core.List) + .map<DimensionValue>((value) => DimensionValue.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metricValues')) { + metricValues = (_json['metricValues'] as core.List) + .map<MetricValue>((value) => MetricValue.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionValues != null) { + _json['dimensionValues'] = + dimensionValues.map((value) => value.toJson()).toList(); + } + if (metricValues != null) { + _json['metricValues'] = + metricValues.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The request to generate a pivot report. +class RunPivotReportRequest { + /// Cohort group associated with this request. + /// + /// If there is a cohort group in the request the 'cohort' dimension must be + /// present. + CohortSpec cohortSpec; + + /// A currency code in ISO4217 format, such as "AED", "USD", "JPY". + /// + /// If the field is empty, the report uses the entity's default currency. + core.String currencyCode; + + /// The date range to retrieve event data for the report. + /// + /// If multiple date ranges are specified, event data from each date range is + /// used in the report. A special dimension with field name "dateRange" can be + /// included in a Pivot's field names; if included, the report compares + /// between date ranges. In a cohort request, this `dateRanges` must be + /// unspecified. + core.List<DateRange> dateRanges; + + /// The filter clause of dimensions. + /// + /// Dimensions must be requested to be used in this filter. Metrics cannot be + /// used in this filter. + FilterExpression dimensionFilter; + + /// The dimensions requested. + /// + /// All defined dimensions must be used by one of the following: + /// dimension_expression, dimension_filter, pivots, order_bys. + core.List<Dimension> dimensions; + + /// A property whose events are tracked. + /// + /// Within a batch request, this entity should either be unspecified or + /// consistent with the batch-level entity. + Entity entity; + + /// If false or unspecified, each row with all metrics equal to 0 will not be + /// returned. + /// + /// If true, these rows will be returned if they are not separately removed by + /// a filter. + core.bool keepEmptyRows; + + /// The filter clause of metrics. + /// + /// Applied at post aggregation phase, similar to SQL having-clause. Metrics + /// must be requested to be used in this filter. Dimensions cannot be used in + /// this filter. + FilterExpression metricFilter; + + /// The metrics requested, at least one metric needs to be specified. + /// + /// All defined metrics must be used by one of the following: + /// metric_expression, metric_filter, order_bys. + core.List<Metric> metrics; + + /// Describes the visual format of the report's dimensions in columns or rows. + /// + /// The union of the fieldNames (dimension names) in all pivots must be a + /// subset of dimension names defined in Dimensions. No two pivots can share a + /// dimension. A dimension is only visible if it appears in a pivot. + core.List<Pivot> pivots; + + /// Toggles whether to return the current state of this Analytics Property's + /// quota. + /// + /// Quota is returned in \[PropertyQuota\](#PropertyQuota). + core.bool returnPropertyQuota; + + RunPivotReportRequest(); + + RunPivotReportRequest.fromJson(core.Map _json) { + if (_json.containsKey('cohortSpec')) { + cohortSpec = CohortSpec.fromJson( + _json['cohortSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('dateRanges')) { + dateRanges = (_json['dateRanges'] as core.List) + .map<DateRange>((value) => + DateRange.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dimensionFilter')) { + dimensionFilter = FilterExpression.fromJson( + _json['dimensionFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dimensions')) { + dimensions = (_json['dimensions'] as core.List) + .map<Dimension>((value) => + Dimension.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('entity')) { + entity = Entity.fromJson( + _json['entity'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('keepEmptyRows')) { + keepEmptyRows = _json['keepEmptyRows'] as core.bool; + } + if (_json.containsKey('metricFilter')) { + metricFilter = FilterExpression.fromJson( + _json['metricFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metrics')) { + metrics = (_json['metrics'] as core.List) + .map<Metric>((value) => + Metric.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('pivots')) { + pivots = (_json['pivots'] as core.List) + .map<Pivot>((value) => + Pivot.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('returnPropertyQuota')) { + returnPropertyQuota = _json['returnPropertyQuota'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cohortSpec != null) { + _json['cohortSpec'] = cohortSpec.toJson(); + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (dateRanges != null) { + _json['dateRanges'] = dateRanges.map((value) => value.toJson()).toList(); + } + if (dimensionFilter != null) { + _json['dimensionFilter'] = dimensionFilter.toJson(); + } + if (dimensions != null) { + _json['dimensions'] = dimensions.map((value) => value.toJson()).toList(); + } + if (entity != null) { + _json['entity'] = entity.toJson(); + } + if (keepEmptyRows != null) { + _json['keepEmptyRows'] = keepEmptyRows; + } + if (metricFilter != null) { + _json['metricFilter'] = metricFilter.toJson(); + } + if (metrics != null) { + _json['metrics'] = metrics.map((value) => value.toJson()).toList(); + } + if (pivots != null) { + _json['pivots'] = pivots.map((value) => value.toJson()).toList(); + } + if (returnPropertyQuota != null) { + _json['returnPropertyQuota'] = returnPropertyQuota; + } + return _json; + } +} + +/// The response pivot report table corresponding to a pivot request. +class RunPivotReportResponse { + /// Aggregation of metric values. + /// + /// Can be totals, minimums, or maximums. The returned aggregations are + /// controlled by the metric_aggregations in the pivot. The type of + /// aggregation returned in each row is shown by the dimension_values which + /// are set to "RESERVED_". + core.List<Row> aggregates; + + /// Describes dimension columns. + /// + /// The number of DimensionHeaders and ordering of DimensionHeaders matches + /// the dimensions present in rows. + core.List<DimensionHeader> dimensionHeaders; + + /// Metadata for the report. + ResponseMetaData metadata; + + /// Describes metric columns. + /// + /// The number of MetricHeaders and ordering of MetricHeaders matches the + /// metrics present in rows. + core.List<MetricHeader> metricHeaders; + + /// Summarizes the columns and rows created by a pivot. + /// + /// Each pivot in the request produces one header in the response. If we have + /// a request like this: "pivots": \[{ "fieldNames": \["country", "city"\] }, + /// { "fieldNames": "eventName" }\] We will have the following `pivotHeaders` + /// in the response: "pivotHeaders" : \[{ "dimensionHeaders": \[{ + /// "dimensionValues": \[ { "value": "United Kingdom" }, { "value": "London" } + /// \] }, { "dimensionValues": \[ { "value": "Japan" }, { "value": "Osaka" } + /// \] }\] }, { "dimensionHeaders": \[{ "dimensionValues": \[{ "value": + /// "session_start" }\] }, { "dimensionValues": \[{ "value": "scroll" }\] }\] + /// }\] + core.List<PivotHeader> pivotHeaders; + + /// This Analytics Property's quota state including this request. + PropertyQuota propertyQuota; + + /// Rows of dimension value combinations and metric values in the report. + core.List<Row> rows; + + RunPivotReportResponse(); + + RunPivotReportResponse.fromJson(core.Map _json) { + if (_json.containsKey('aggregates')) { + aggregates = (_json['aggregates'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dimensionHeaders')) { + dimensionHeaders = (_json['dimensionHeaders'] as core.List) + .map<DimensionHeader>((value) => DimensionHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metadata')) { + metadata = ResponseMetaData.fromJson( + _json['metadata'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metricHeaders')) { + metricHeaders = (_json['metricHeaders'] as core.List) + .map<MetricHeader>((value) => MetricHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('pivotHeaders')) { + pivotHeaders = (_json['pivotHeaders'] as core.List) + .map<PivotHeader>((value) => PivotHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('propertyQuota')) { + propertyQuota = PropertyQuota.fromJson( + _json['propertyQuota'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (aggregates != null) { + _json['aggregates'] = aggregates.map((value) => value.toJson()).toList(); + } + if (dimensionHeaders != null) { + _json['dimensionHeaders'] = + dimensionHeaders.map((value) => value.toJson()).toList(); + } + if (metadata != null) { + _json['metadata'] = metadata.toJson(); + } + if (metricHeaders != null) { + _json['metricHeaders'] = + metricHeaders.map((value) => value.toJson()).toList(); + } + if (pivotHeaders != null) { + _json['pivotHeaders'] = + pivotHeaders.map((value) => value.toJson()).toList(); + } + if (propertyQuota != null) { + _json['propertyQuota'] = propertyQuota.toJson(); + } + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The request to generate a realtime report. +class RunRealtimeReportRequest { + /// The filter clause of dimensions. + /// + /// Dimensions must be requested to be used in this filter. Metrics cannot be + /// used in this filter. + FilterExpression dimensionFilter; + + /// The dimensions requested and displayed. + core.List<Dimension> dimensions; + + /// The number of rows to return. + /// + /// If unspecified, 10 rows are returned. If -1, all rows are returned. + core.String limit; + + /// Aggregation of metrics. + /// + /// Aggregated metric values will be shown in rows where the dimension_values + /// are set to "RESERVED_(MetricAggregation)". + core.List<core.String> metricAggregations; + + /// The filter clause of metrics. + /// + /// Applied at post aggregation phase, similar to SQL having-clause. Metrics + /// must be requested to be used in this filter. Dimensions cannot be used in + /// this filter. + FilterExpression metricFilter; + + /// The metrics requested and displayed. + core.List<Metric> metrics; + + /// Specifies how rows are ordered in the response. + core.List<OrderBy> orderBys; + + /// Toggles whether to return the current state of this Analytics Property's + /// Realtime quota. + /// + /// Quota is returned in \[PropertyQuota\](#PropertyQuota). + core.bool returnPropertyQuota; + + RunRealtimeReportRequest(); + + RunRealtimeReportRequest.fromJson(core.Map _json) { + if (_json.containsKey('dimensionFilter')) { + dimensionFilter = FilterExpression.fromJson( + _json['dimensionFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dimensions')) { + dimensions = (_json['dimensions'] as core.List) + .map<Dimension>((value) => + Dimension.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('limit')) { + limit = _json['limit'] as core.String; + } + if (_json.containsKey('metricAggregations')) { + metricAggregations = (_json['metricAggregations'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('metricFilter')) { + metricFilter = FilterExpression.fromJson( + _json['metricFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metrics')) { + metrics = (_json['metrics'] as core.List) + .map<Metric>((value) => + Metric.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('orderBys')) { + orderBys = (_json['orderBys'] as core.List) + .map<OrderBy>((value) => + OrderBy.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('returnPropertyQuota')) { + returnPropertyQuota = _json['returnPropertyQuota'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionFilter != null) { + _json['dimensionFilter'] = dimensionFilter.toJson(); + } + if (dimensions != null) { + _json['dimensions'] = dimensions.map((value) => value.toJson()).toList(); + } + if (limit != null) { + _json['limit'] = limit; + } + if (metricAggregations != null) { + _json['metricAggregations'] = metricAggregations; + } + if (metricFilter != null) { + _json['metricFilter'] = metricFilter.toJson(); + } + if (metrics != null) { + _json['metrics'] = metrics.map((value) => value.toJson()).toList(); + } + if (orderBys != null) { + _json['orderBys'] = orderBys.map((value) => value.toJson()).toList(); + } + if (returnPropertyQuota != null) { + _json['returnPropertyQuota'] = returnPropertyQuota; + } + return _json; + } +} + +/// The response realtime report table corresponding to a request. +class RunRealtimeReportResponse { + /// Describes dimension columns. + /// + /// The number of DimensionHeaders and ordering of DimensionHeaders matches + /// the dimensions present in rows. + core.List<DimensionHeader> dimensionHeaders; + + /// If requested, the maximum values of metrics. + core.List<Row> maximums; + + /// Describes metric columns. + /// + /// The number of MetricHeaders and ordering of MetricHeaders matches the + /// metrics present in rows. + core.List<MetricHeader> metricHeaders; + + /// If requested, the minimum values of metrics. + core.List<Row> minimums; + + /// This Analytics Property's Realtime quota state including this request. + PropertyQuota propertyQuota; + + /// The total number of rows in the query result, regardless of the number of + /// rows returned in the response. + /// + /// For example if a query returns 175 rows and includes limit = 50 in the API + /// request, the response will contain row_count = 175 but only 50 rows. + core.int rowCount; + + /// Rows of dimension value combinations and metric values in the report. + core.List<Row> rows; + + /// If requested, the totaled values of metrics. + core.List<Row> totals; + + RunRealtimeReportResponse(); + + RunRealtimeReportResponse.fromJson(core.Map _json) { + if (_json.containsKey('dimensionHeaders')) { + dimensionHeaders = (_json['dimensionHeaders'] as core.List) + .map<DimensionHeader>((value) => DimensionHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('maximums')) { + maximums = (_json['maximums'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metricHeaders')) { + metricHeaders = (_json['metricHeaders'] as core.List) + .map<MetricHeader>((value) => MetricHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('minimums')) { + minimums = (_json['minimums'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('propertyQuota')) { + propertyQuota = PropertyQuota.fromJson( + _json['propertyQuota'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rowCount')) { + rowCount = _json['rowCount'] as core.int; + } + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('totals')) { + totals = (_json['totals'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionHeaders != null) { + _json['dimensionHeaders'] = + dimensionHeaders.map((value) => value.toJson()).toList(); + } + if (maximums != null) { + _json['maximums'] = maximums.map((value) => value.toJson()).toList(); + } + if (metricHeaders != null) { + _json['metricHeaders'] = + metricHeaders.map((value) => value.toJson()).toList(); + } + if (minimums != null) { + _json['minimums'] = minimums.map((value) => value.toJson()).toList(); + } + if (propertyQuota != null) { + _json['propertyQuota'] = propertyQuota.toJson(); + } + if (rowCount != null) { + _json['rowCount'] = rowCount; + } + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + if (totals != null) { + _json['totals'] = totals.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The request to generate a report. +class RunReportRequest { + /// Cohort group associated with this request. + /// + /// If there is a cohort group in the request the 'cohort' dimension must be + /// present. + CohortSpec cohortSpec; + + /// A currency code in ISO4217 format, such as "AED", "USD", "JPY". + /// + /// If the field is empty, the report uses the entity's default currency. + core.String currencyCode; + + /// Date ranges of data to read. + /// + /// If multiple date ranges are requested, each response row will contain a + /// zero based date range index. If two date ranges overlap, the event data + /// for the overlapping days is included in the response rows for both date + /// ranges. In a cohort request, this `dateRanges` must be unspecified. + core.List<DateRange> dateRanges; + + /// The filter clause of dimensions. + /// + /// Dimensions must be requested to be used in this filter. Metrics cannot be + /// used in this filter. + FilterExpression dimensionFilter; + + /// The dimensions requested and displayed. + core.List<Dimension> dimensions; + + /// A property whose events are tracked. + /// + /// Within a batch request, this entity should either be unspecified or + /// consistent with the batch-level entity. + Entity entity; + + /// If false or unspecified, each row with all metrics equal to 0 will not be + /// returned. + /// + /// If true, these rows will be returned if they are not separately removed by + /// a filter. + core.bool keepEmptyRows; + + /// The number of rows to return. + /// + /// If unspecified, 10 rows are returned. If -1, all rows are returned. To + /// learn more about this pagination parameter, see + /// [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + core.String limit; + + /// Aggregation of metrics. + /// + /// Aggregated metric values will be shown in rows where the dimension_values + /// are set to "RESERVED_(MetricAggregation)". + core.List<core.String> metricAggregations; + + /// The filter clause of metrics. + /// + /// Applied at post aggregation phase, similar to SQL having-clause. Metrics + /// must be requested to be used in this filter. Dimensions cannot be used in + /// this filter. + FilterExpression metricFilter; + + /// The metrics requested and displayed. + core.List<Metric> metrics; + + /// The row count of the start row. + /// + /// The first row is counted as row 0. To learn more about this pagination + /// parameter, see + /// [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + core.String offset; + + /// Specifies how rows are ordered in the response. + core.List<OrderBy> orderBys; + + /// Toggles whether to return the current state of this Analytics Property's + /// quota. + /// + /// Quota is returned in \[PropertyQuota\](#PropertyQuota). + core.bool returnPropertyQuota; + + RunReportRequest(); + + RunReportRequest.fromJson(core.Map _json) { + if (_json.containsKey('cohortSpec')) { + cohortSpec = CohortSpec.fromJson( + _json['cohortSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('dateRanges')) { + dateRanges = (_json['dateRanges'] as core.List) + .map<DateRange>((value) => + DateRange.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dimensionFilter')) { + dimensionFilter = FilterExpression.fromJson( + _json['dimensionFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dimensions')) { + dimensions = (_json['dimensions'] as core.List) + .map<Dimension>((value) => + Dimension.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('entity')) { + entity = Entity.fromJson( + _json['entity'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('keepEmptyRows')) { + keepEmptyRows = _json['keepEmptyRows'] as core.bool; + } + if (_json.containsKey('limit')) { + limit = _json['limit'] as core.String; + } + if (_json.containsKey('metricAggregations')) { + metricAggregations = (_json['metricAggregations'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('metricFilter')) { + metricFilter = FilterExpression.fromJson( + _json['metricFilter'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metrics')) { + metrics = (_json['metrics'] as core.List) + .map<Metric>((value) => + Metric.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('offset')) { + offset = _json['offset'] as core.String; + } + if (_json.containsKey('orderBys')) { + orderBys = (_json['orderBys'] as core.List) + .map<OrderBy>((value) => + OrderBy.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('returnPropertyQuota')) { + returnPropertyQuota = _json['returnPropertyQuota'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cohortSpec != null) { + _json['cohortSpec'] = cohortSpec.toJson(); + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (dateRanges != null) { + _json['dateRanges'] = dateRanges.map((value) => value.toJson()).toList(); + } + if (dimensionFilter != null) { + _json['dimensionFilter'] = dimensionFilter.toJson(); + } + if (dimensions != null) { + _json['dimensions'] = dimensions.map((value) => value.toJson()).toList(); + } + if (entity != null) { + _json['entity'] = entity.toJson(); + } + if (keepEmptyRows != null) { + _json['keepEmptyRows'] = keepEmptyRows; + } + if (limit != null) { + _json['limit'] = limit; + } + if (metricAggregations != null) { + _json['metricAggregations'] = metricAggregations; + } + if (metricFilter != null) { + _json['metricFilter'] = metricFilter.toJson(); + } + if (metrics != null) { + _json['metrics'] = metrics.map((value) => value.toJson()).toList(); + } + if (offset != null) { + _json['offset'] = offset; + } + if (orderBys != null) { + _json['orderBys'] = orderBys.map((value) => value.toJson()).toList(); + } + if (returnPropertyQuota != null) { + _json['returnPropertyQuota'] = returnPropertyQuota; + } + return _json; + } +} + +/// The response report table corresponding to a request. +class RunReportResponse { + /// Describes dimension columns. + /// + /// The number of DimensionHeaders and ordering of DimensionHeaders matches + /// the dimensions present in rows. + core.List<DimensionHeader> dimensionHeaders; + + /// If requested, the maximum values of metrics. + core.List<Row> maximums; + + /// Metadata for the report. + ResponseMetaData metadata; + + /// Describes metric columns. + /// + /// The number of MetricHeaders and ordering of MetricHeaders matches the + /// metrics present in rows. + core.List<MetricHeader> metricHeaders; + + /// If requested, the minimum values of metrics. + core.List<Row> minimums; + + /// This Analytics Property's quota state including this request. + PropertyQuota propertyQuota; + + /// The total number of rows in the query result, regardless of the number of + /// rows returned in the response. + /// + /// For example if a query returns 175 rows and includes limit = 50 in the API + /// request, the response will contain row_count = 175 but only 50 rows. To + /// learn more about this pagination parameter, see + /// [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). + core.int rowCount; + + /// Rows of dimension value combinations and metric values in the report. + core.List<Row> rows; + + /// If requested, the totaled values of metrics. + core.List<Row> totals; + + RunReportResponse(); + + RunReportResponse.fromJson(core.Map _json) { + if (_json.containsKey('dimensionHeaders')) { + dimensionHeaders = (_json['dimensionHeaders'] as core.List) + .map<DimensionHeader>((value) => DimensionHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('maximums')) { + maximums = (_json['maximums'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metadata')) { + metadata = ResponseMetaData.fromJson( + _json['metadata'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metricHeaders')) { + metricHeaders = (_json['metricHeaders'] as core.List) + .map<MetricHeader>((value) => MetricHeader.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('minimums')) { + minimums = (_json['minimums'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('propertyQuota')) { + propertyQuota = PropertyQuota.fromJson( + _json['propertyQuota'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rowCount')) { + rowCount = _json['rowCount'] as core.int; + } + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('totals')) { + totals = (_json['totals'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dimensionHeaders != null) { + _json['dimensionHeaders'] = + dimensionHeaders.map((value) => value.toJson()).toList(); + } + if (maximums != null) { + _json['maximums'] = maximums.map((value) => value.toJson()).toList(); + } + if (metadata != null) { + _json['metadata'] = metadata.toJson(); + } + if (metricHeaders != null) { + _json['metricHeaders'] = + metricHeaders.map((value) => value.toJson()).toList(); + } + if (minimums != null) { + _json['minimums'] = minimums.map((value) => value.toJson()).toList(); + } + if (propertyQuota != null) { + _json['propertyQuota'] = propertyQuota.toJson(); + } + if (rowCount != null) { + _json['rowCount'] = rowCount; + } + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + if (totals != null) { + _json['totals'] = totals.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The filter for string +class StringFilter { + /// If true, the string value is case sensitive. + core.bool caseSensitive; + + /// The match type for this filter. + /// Possible string values are: + /// - "MATCH_TYPE_UNSPECIFIED" : Unspecified + /// - "EXACT" : Exact match of the string value. + /// - "BEGINS_WITH" : Begins with the string value. + /// - "ENDS_WITH" : Ends with the string value. + /// - "CONTAINS" : Contains the string value. + /// - "FULL_REGEXP" : Full regular expression match with the string value. + /// - "PARTIAL_REGEXP" : Partial regular expression match with the string + /// value. + core.String matchType; + + /// The string value used for the matching. + core.String value; + + StringFilter(); + + StringFilter.fromJson(core.Map _json) { + if (_json.containsKey('caseSensitive')) { + caseSensitive = _json['caseSensitive'] as core.bool; + } + if (_json.containsKey('matchType')) { + matchType = _json['matchType'] as core.String; + } + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (caseSensitive != null) { + _json['caseSensitive'] = caseSensitive; + } + if (matchType != null) { + _json['matchType'] = matchType; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/appengine/v1beta.dart b/generated/googleapis_beta/lib/appengine/v1beta.dart deleted file mode 100644 index 2df0c33..0000000 --- a/generated/googleapis_beta/lib/appengine/v1beta.dart +++ /dev/null
@@ -1,7479 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// App Engine Admin API - v1beta -/// -/// Provisions and manages developers' App Engine applications. -/// -/// For more information, see -/// <https://cloud.google.com/appengine/docs/admin-api/> -/// -/// Create an instance of [AppengineApi] to access these resources: -/// -/// - [AppsResource] -/// - [AppsAuthorizedCertificatesResource] -/// - [AppsAuthorizedDomainsResource] -/// - [AppsDomainMappingsResource] -/// - [AppsFirewallResource] -/// - [AppsFirewallIngressRulesResource] -/// - [AppsLocationsResource] -/// - [AppsOperationsResource] -/// - [AppsServicesResource] -/// - [AppsServicesVersionsResource] -/// - [AppsServicesVersionsInstancesResource] -library appengine.v1beta; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Provisions and manages developers' App Engine applications. -class AppengineApi { - /// View and manage your applications deployed on Google App Engine - static const appengineAdminScope = - 'https://www.googleapis.com/auth/appengine.admin'; - - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - final commons.ApiRequester _requester; - - AppsResource get apps => AppsResource(_requester); - - AppengineApi(http.Client client, - {core.String rootUrl = 'https://appengine.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class AppsResource { - final commons.ApiRequester _requester; - - AppsAuthorizedCertificatesResource get authorizedCertificates => - AppsAuthorizedCertificatesResource(_requester); - AppsAuthorizedDomainsResource get authorizedDomains => - AppsAuthorizedDomainsResource(_requester); - AppsDomainMappingsResource get domainMappings => - AppsDomainMappingsResource(_requester); - AppsFirewallResource get firewall => AppsFirewallResource(_requester); - AppsLocationsResource get locations => AppsLocationsResource(_requester); - AppsOperationsResource get operations => AppsOperationsResource(_requester); - AppsServicesResource get services => AppsServicesResource(_requester); - - AppsResource(commons.ApiRequester client) : _requester = client; - - /// Creates an App Engine application for a Google Cloud Platform project. - /// - /// Required fields: id - The ID of the target Cloud Platform project. - /// location - The region (https://cloud.google.com/appengine/docs/locations) - /// where you want the App Engine application located.For more information - /// about App Engine applications, see Managing Projects, Applications, and - /// Billing - /// (https://cloud.google.com/appengine/docs/standard/python/console/). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Application request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets information about an application. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Application resource to get. - /// Example: apps/myapp. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Application]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Application> get( - core.String appsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + commons.Escaper.ecapeVariable('$appsId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Application.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified Application resource. - /// - /// You can update the following fields: auth_domain - Google authentication - /// domain for controlling user access to the application. - /// default_cookie_expiration - Cookie expiration policy for the application. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Application resource to update. - /// Example: apps/myapp. - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Application request, - core.String appsId, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + commons.Escaper.ecapeVariable('$appsId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Recreates the required App Engine features for the specified App Engine - /// application, for example a Cloud Storage bucket or App Engine service - /// account. - /// - /// Use this method if you receive an error message about a missing feature, - /// for example, Error retrieving the App Engine service account. If you have - /// deleted your App Engine service account, this will not be able to recreate - /// it. Instead, you should attempt to use the IAM undelete API if possible at - /// https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D - /// . If the deletion was recent, the numeric ID can be found in the Cloud - /// Console Activity Log. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the application to repair. Example: - /// apps/myapp - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> repair( - RepairApplicationRequest request, - core.String appsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta/apps/' + commons.Escaper.ecapeVariable('$appsId') + ':repair'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsAuthorizedCertificatesResource { - final commons.ApiRequester _requester; - - AppsAuthorizedCertificatesResource(commons.ApiRequester client) - : _requester = client; - - /// Uploads the specified SSL certificate. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AuthorizedCertificate]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AuthorizedCertificate> create( - AuthorizedCertificate request, - core.String appsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedCertificates'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AuthorizedCertificate.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified SSL certificate. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to delete. Example: - /// apps/myapp/authorizedCertificates/12345. - /// - /// [authorizedCertificatesId] - Part of `name`. See documentation of - /// `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String appsId, - core.String authorizedCertificatesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (authorizedCertificatesId == null) { - throw core.ArgumentError( - 'Parameter authorizedCertificatesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedCertificates/' + - commons.Escaper.ecapeVariable('$authorizedCertificatesId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the specified SSL certificate. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/authorizedCertificates/12345. - /// - /// [authorizedCertificatesId] - Part of `name`. See documentation of - /// `appsId`. - /// - /// [view] - Controls the set of fields returned in the GET response. - /// Possible string values are: - /// - "BASIC_CERTIFICATE" : Basic certificate information, including - /// applicable domains and expiration date. - /// - "FULL_CERTIFICATE" : The information from BASIC_CERTIFICATE, plus - /// detailed information on the domain mappings that have this certificate - /// mapped. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AuthorizedCertificate]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AuthorizedCertificate> get( - core.String appsId, - core.String authorizedCertificatesId, { - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (authorizedCertificatesId == null) { - throw core.ArgumentError( - 'Parameter authorizedCertificatesId is required.'); - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedCertificates/' + - commons.Escaper.ecapeVariable('$authorizedCertificatesId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AuthorizedCertificate.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all SSL certificates the user is authorized to administer. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [view] - Controls the set of fields returned in the LIST response. - /// Possible string values are: - /// - "BASIC_CERTIFICATE" : Basic certificate information, including - /// applicable domains and expiration date. - /// - "FULL_CERTIFICATE" : The information from BASIC_CERTIFICATE, plus - /// detailed information on the domain mappings that have this certificate - /// mapped. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListAuthorizedCertificatesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListAuthorizedCertificatesResponse> list( - core.String appsId, { - core.int pageSize, - core.String pageToken, - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedCertificates'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListAuthorizedCertificatesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified SSL certificate. - /// - /// To renew a certificate and maintain its existing domain mappings, update - /// certificate_data with a new certificate. The new certificate must be - /// applicable to the same domains as the original certificate. The - /// certificate display_name may also be updated. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to update. Example: - /// apps/myapp/authorizedCertificates/12345. - /// - /// [authorizedCertificatesId] - Part of `name`. See documentation of - /// `appsId`. - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// Updates are only supported on the certificate_raw_data and display_name - /// fields. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AuthorizedCertificate]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AuthorizedCertificate> patch( - AuthorizedCertificate request, - core.String appsId, - core.String authorizedCertificatesId, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (authorizedCertificatesId == null) { - throw core.ArgumentError( - 'Parameter authorizedCertificatesId is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedCertificates/' + - commons.Escaper.ecapeVariable('$authorizedCertificatesId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AuthorizedCertificate.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsAuthorizedDomainsResource { - final commons.ApiRequester _requester; - - AppsAuthorizedDomainsResource(commons.ApiRequester client) - : _requester = client; - - /// Lists all domains the user is authorized to administer. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListAuthorizedDomainsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListAuthorizedDomainsResponse> list( - core.String appsId, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/authorizedDomains'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListAuthorizedDomainsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsDomainMappingsResource { - final commons.ApiRequester _requester; - - AppsDomainMappingsResource(commons.ApiRequester client) : _requester = client; - - /// Maps a domain to an application. - /// - /// A user must be authorized to administer a domain in order to map it to an - /// application. For a list of available authorized domains, see - /// AuthorizedDomains.ListAuthorizedDomains. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [overrideStrategy] - Whether the domain creation should override any - /// existing mappings for this domain. By default, overrides are rejected. - /// Possible string values are: - /// - "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" : Strategy unspecified. Defaults - /// to STRICT. - /// - "STRICT" : Overrides not allowed. If a mapping already exists for the - /// specified domain, the request will return an ALREADY_EXISTS (409). - /// - "OVERRIDE" : Overrides allowed. If a mapping already exists for the - /// specified domain, the request will overwrite it. Note that this might stop - /// another Google product from serving. For example, if the domain is mapped - /// to another App Engine application, that app will no longer serve from that - /// domain. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - DomainMapping request, - core.String appsId, { - core.String overrideStrategy, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (overrideStrategy != null) { - _queryParams['overrideStrategy'] = [overrideStrategy]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/domainMappings'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified domain mapping. - /// - /// A user must be authorized to administer the associated domain in order to - /// delete a DomainMapping resource. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to delete. Example: - /// apps/myapp/domainMappings/example.com. - /// - /// [domainMappingsId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String appsId, - core.String domainMappingsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (domainMappingsId == null) { - throw core.ArgumentError('Parameter domainMappingsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/domainMappings/' + - commons.Escaper.ecapeVariable('$domainMappingsId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the specified domain mapping. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/domainMappings/example.com. - /// - /// [domainMappingsId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [DomainMapping]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<DomainMapping> get( - core.String appsId, - core.String domainMappingsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (domainMappingsId == null) { - throw core.ArgumentError('Parameter domainMappingsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/domainMappings/' + - commons.Escaper.ecapeVariable('$domainMappingsId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - DomainMapping.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the domain mappings on an application. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListDomainMappingsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListDomainMappingsResponse> list( - core.String appsId, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/domainMappings'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListDomainMappingsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified domain mapping. - /// - /// To map an SSL certificate to a domain mapping, update certificate_id to - /// point to an AuthorizedCertificate resource. A user must be authorized to - /// administer the associated domain in order to update a DomainMapping - /// resource. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to update. Example: - /// apps/myapp/domainMappings/example.com. - /// - /// [domainMappingsId] - Part of `name`. See documentation of `appsId`. - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - DomainMapping request, - core.String appsId, - core.String domainMappingsId, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (domainMappingsId == null) { - throw core.ArgumentError('Parameter domainMappingsId is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/domainMappings/' + - commons.Escaper.ecapeVariable('$domainMappingsId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsFirewallResource { - final commons.ApiRequester _requester; - - AppsFirewallIngressRulesResource get ingressRules => - AppsFirewallIngressRulesResource(_requester); - - AppsFirewallResource(commons.ApiRequester client) : _requester = client; -} - -class AppsFirewallIngressRulesResource { - final commons.ApiRequester _requester; - - AppsFirewallIngressRulesResource(commons.ApiRequester client) - : _requester = client; - - /// Replaces the entire firewall ruleset in one bulk operation. - /// - /// This overrides and replaces the rules of an existing firewall with the new - /// rules.If the final rule does not match traffic with the '*' wildcard IP - /// range, then an "allow all" rule is explicitly added to the end of the - /// list. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Firewall collection to set. - /// Example: apps/myapp/firewall/ingressRules. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [BatchUpdateIngressRulesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<BatchUpdateIngressRulesResponse> batchUpdate( - BatchUpdateIngressRulesRequest request, - core.String appsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => BatchUpdateIngressRulesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a firewall rule for the application. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Firewall collection in - /// which to create a new rule. Example: apps/myapp/firewall/ingressRules. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [FirewallRule]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<FirewallRule> create( - FirewallRule request, - core.String appsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - FirewallRule.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified firewall rule. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Firewall resource to delete. - /// Example: apps/myapp/firewall/ingressRules/100. - /// - /// [ingressRulesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String appsId, - core.String ingressRulesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (ingressRulesId == null) { - throw core.ArgumentError('Parameter ingressRulesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules/' + - commons.Escaper.ecapeVariable('$ingressRulesId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the specified firewall rule. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Firewall resource to retrieve. - /// Example: apps/myapp/firewall/ingressRules/100. - /// - /// [ingressRulesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [FirewallRule]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<FirewallRule> get( - core.String appsId, - core.String ingressRulesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (ingressRulesId == null) { - throw core.ArgumentError('Parameter ingressRulesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules/' + - commons.Escaper.ecapeVariable('$ingressRulesId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - FirewallRule.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the firewall rules of an application. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the Firewall collection to retrieve. - /// Example: apps/myapp/firewall/ingressRules. - /// - /// [matchingAddress] - A valid IP Address. If set, only rules matching this - /// address will be returned. The first returned rule will be the rule that - /// fires on requests from this IP. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListIngressRulesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListIngressRulesResponse> list( - core.String appsId, { - core.String matchingAddress, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (matchingAddress != null) { - _queryParams['matchingAddress'] = [matchingAddress]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListIngressRulesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified firewall rule. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the Firewall resource to update. - /// Example: apps/myapp/firewall/ingressRules/100. - /// - /// [ingressRulesId] - Part of `name`. See documentation of `appsId`. - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [FirewallRule]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<FirewallRule> patch( - FirewallRule request, - core.String appsId, - core.String ingressRulesId, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (ingressRulesId == null) { - throw core.ArgumentError('Parameter ingressRulesId is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/firewall/ingressRules/' + - commons.Escaper.ecapeVariable('$ingressRulesId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - FirewallRule.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsLocationsResource { - final commons.ApiRequester _requester; - - AppsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Resource name for the location. - /// - /// [locationsId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String appsId, - core.String locationsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (locationsId == null) { - throw core.ArgumentError('Parameter locationsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/locations/' + - commons.Escaper.ecapeVariable('$locationsId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. The resource that owns the locations - /// collection, if applicable. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String appsId, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsOperationsResource { - final commons.ApiRequester _requester; - - AppsOperationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. The name of the operation resource. - /// - /// [operationsId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String appsId, - core.String operationsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (operationsId == null) { - throw core.ArgumentError('Parameter operationsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/operations/' + - commons.Escaper.ecapeVariable('$operationsId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: - /// the name binding allows API services to override the binding to use - /// different resource name schemes, such as users / * /operations. To - /// override the binding, API services can add a binding such as - /// "/v1/{name=users / * }/operations" to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. The name of the operation's parent resource. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String appsId, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsServicesResource { - final commons.ApiRequester _requester; - - AppsServicesVersionsResource get versions => - AppsServicesVersionsResource(_requester); - - AppsServicesResource(commons.ApiRequester client) : _requester = client; - - /// Deletes the specified service and all enclosed versions. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String appsId, - core.String servicesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the current configuration of the specified service. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Service]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Service> get( - core.String appsId, - core.String servicesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Service.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all the services in the application. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Application resource. - /// Example: apps/myapp. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListServicesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListServicesResponse> list( - core.String appsId, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta/apps/' + commons.Escaper.ecapeVariable('$appsId') + '/services'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListServicesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the configuration of the specified service. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to update. Example: - /// apps/myapp/services/default. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [migrateTraffic] - Set to true to gradually shift traffic to one or more - /// versions that you specify. By default, traffic is shifted immediately. For - /// gradual traffic migration, the target versions must be located within - /// instances that are configured for both warmup requests - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#InboundServiceType) - /// and automatic scaling - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#AutomaticScaling). - /// You must specify the shardBy - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services#ShardBy) - /// field in the Service resource. Gradual traffic migration is not supported - /// in the App Engine flexible environment. For examples, see Migrating and - /// Splitting Traffic - /// (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Service request, - core.String appsId, - core.String servicesId, { - core.bool migrateTraffic, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (migrateTraffic != null) { - _queryParams['migrateTraffic'] = ['${migrateTraffic}']; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsServicesVersionsResource { - final commons.ApiRequester _requester; - - AppsServicesVersionsInstancesResource get instances => - AppsServicesVersionsInstancesResource(_requester); - - AppsServicesVersionsResource(commons.ApiRequester client) - : _requester = client; - - /// Deploys code and resource files to a new version. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent resource to create this - /// version under. Example: apps/myapp/services/default. - /// - /// [servicesId] - Part of `parent`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Version request, - core.String appsId, - core.String servicesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes an existing Version resource. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default/versions/v1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String appsId, - core.String servicesId, - core.String versionsId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the specified Version resource. - /// - /// By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW - /// parameter to get the full resource. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default/versions/v1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [view] - Controls the set of fields returned in the Get response. - /// Possible string values are: - /// - "BASIC" : Basic version information including scaling and inbound - /// services, but not detailed deployment information. - /// - "FULL" : The information from BASIC, plus detailed information about the - /// deployment. This format is required when creating resources, but is not - /// returned in Get or List by default. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> get( - core.String appsId, - core.String servicesId, - core.String versionsId, { - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the versions of a service. - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Service resource. Example: - /// apps/myapp/services/default. - /// - /// [servicesId] - Part of `parent`. See documentation of `appsId`. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [view] - Controls the set of fields returned in the List response. - /// Possible string values are: - /// - "BASIC" : Basic version information including scaling and inbound - /// services, but not detailed deployment information. - /// - "FULL" : The information from BASIC, plus detailed information about the - /// deployment. This format is required when creating resources, but is not - /// returned in Get or List by default. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionsResponse> list( - core.String appsId, - core.String servicesId, { - core.int pageSize, - core.String pageToken, - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified Version resource. - /// - /// You can specify the following fields depending on the App Engine - /// environment and type of scaling that the version resource uses:Standard - /// environment instance_class - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.instance_class)automatic - /// scaling in the standard environment: automatic_scaling.min_idle_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) - /// automatic_scaling.max_idle_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) - /// automaticScaling.standard_scheduler_settings.max_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) - /// automaticScaling.standard_scheduler_settings.min_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) - /// automaticScaling.standard_scheduler_settings.target_cpu_utilization - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) - /// automaticScaling.standard_scheduler_settings.target_throughput_utilization - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings)basic - /// scaling or manual scaling in the standard environment: serving_status - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status) - /// manual_scaling.instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#manualscaling)Flexible - /// environment serving_status - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status)automatic - /// scaling in the flexible environment: automatic_scaling.min_total_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) - /// automatic_scaling.max_total_instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) - /// automatic_scaling.cool_down_period_sec - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) - /// automatic_scaling.cpu_utilization.target_utilization - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling)manual - /// scaling in the flexible environment: manual_scaling.instances - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#manualscaling) - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource to update. Example: - /// apps/myapp/services/default/versions/1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [updateMask] - Standard field mask for the set of fields to be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Version request, - core.String appsId, - core.String servicesId, - core.String versionsId, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class AppsServicesVersionsInstancesResource { - final commons.ApiRequester _requester; - - AppsServicesVersionsInstancesResource(commons.ApiRequester client) - : _requester = client; - - /// Enables debugging on a VM instance. - /// - /// This allows you to use the SSH command to connect to the virtual machine - /// where the instance lives. While in "debug mode", the instance continues to - /// serve live traffic. You should delete the instance when you are done - /// debugging and then allow the system to take over and determine if another - /// instance should be started.Only applicable for instances in App Engine - /// flexible environment. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default/versions/v1/instances/instance-1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [instancesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> debug( - DebugInstanceRequest request, - core.String appsId, - core.String servicesId, - core.String versionsId, - core.String instancesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (instancesId == null) { - throw core.ArgumentError('Parameter instancesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId') + - '/instances/' + - commons.Escaper.ecapeVariable('$instancesId') + - ':debug'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Stops a running instance.The instance might be automatically recreated - /// based on the scaling settings of the version. - /// - /// For more information, see "How Instances are Managed" (standard - /// environment - /// (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) - /// | flexible environment - /// (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).To - /// ensure that instances are not re-created and avoid getting billed, you can - /// stop all instances within the target version by changing the serving - /// status of the version to STOPPED with the apps.services.versions.patch - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) - /// method. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default/versions/v1/instances/instance-1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [instancesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String appsId, - core.String servicesId, - core.String versionsId, - core.String instancesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (instancesId == null) { - throw core.ArgumentError('Parameter instancesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId') + - '/instances/' + - commons.Escaper.ecapeVariable('$instancesId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets instance information. - /// - /// Request parameters: - /// - /// [appsId] - Part of `name`. Name of the resource requested. Example: - /// apps/myapp/services/default/versions/v1/instances/instance-1. - /// - /// [servicesId] - Part of `name`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `name`. See documentation of `appsId`. - /// - /// [instancesId] - Part of `name`. See documentation of `appsId`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Instance]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Instance> get( - core.String appsId, - core.String servicesId, - core.String versionsId, - core.String instancesId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (instancesId == null) { - throw core.ArgumentError('Parameter instancesId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId') + - '/instances/' + - commons.Escaper.ecapeVariable('$instancesId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Instance.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the instances of a version.Tip: To aggregate details about instances - /// over time, see the Stackdriver Monitoring API - /// (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - /// - /// Request parameters: - /// - /// [appsId] - Part of `parent`. Name of the parent Version resource. Example: - /// apps/myapp/services/default/versions/v1. - /// - /// [servicesId] - Part of `parent`. See documentation of `appsId`. - /// - /// [versionsId] - Part of `parent`. See documentation of `appsId`. - /// - /// [pageSize] - Maximum results to return per page. - /// - /// [pageToken] - Continuation token for fetching the next page of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListInstancesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListInstancesResponse> list( - core.String appsId, - core.String servicesId, - core.String versionsId, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (appsId == null) { - throw core.ArgumentError('Parameter appsId is required.'); - } - if (servicesId == null) { - throw core.ArgumentError('Parameter servicesId is required.'); - } - if (versionsId == null) { - throw core.ArgumentError('Parameter versionsId is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/apps/' + - commons.Escaper.ecapeVariable('$appsId') + - '/services/' + - commons.Escaper.ecapeVariable('$servicesId') + - '/versions/' + - commons.Escaper.ecapeVariable('$versionsId') + - '/instances'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListInstancesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Google Cloud Endpoints -/// (https://cloud.google.com/appengine/docs/python/endpoints/) configuration -/// for API handlers. -class ApiConfigHandler { - /// Action to take when users access resources that require authentication. - /// - /// Defaults to redirect. - /// Possible string values are: - /// - "AUTH_FAIL_ACTION_UNSPECIFIED" : Not specified. - /// AUTH_FAIL_ACTION_REDIRECT is assumed. - /// - "AUTH_FAIL_ACTION_REDIRECT" : Redirects user to "accounts.google.com". - /// The user is redirected back to the application URL after signing in or - /// creating an account. - /// - "AUTH_FAIL_ACTION_UNAUTHORIZED" : Rejects request with a 401 HTTP status - /// code and an error message. - core.String authFailAction; - - /// Level of login required to access this resource. - /// - /// Defaults to optional. - /// Possible string values are: - /// - "LOGIN_UNSPECIFIED" : Not specified. LOGIN_OPTIONAL is assumed. - /// - "LOGIN_OPTIONAL" : Does not require that the user is signed in. - /// - "LOGIN_ADMIN" : If the user is not signed in, the auth_fail_action is - /// taken. In addition, if the user is not an administrator for the - /// application, they are given an error message regardless of - /// auth_fail_action. If the user is an administrator, the handler proceeds. - /// - "LOGIN_REQUIRED" : If the user has signed in, the handler proceeds - /// normally. Otherwise, the auth_fail_action is taken. - core.String login; - - /// Path to the script from the application root directory. - core.String script; - - /// Security (HTTPS) enforcement for this URL. - /// Possible string values are: - /// - "SECURE_UNSPECIFIED" : Not specified. - /// - "SECURE_DEFAULT" : Both HTTP and HTTPS requests with URLs that match the - /// handler succeed without redirects. The application can examine the request - /// to determine which protocol was used, and respond accordingly. - /// - "SECURE_NEVER" : Requests for a URL that match this handler that use - /// HTTPS are automatically redirected to the HTTP equivalent URL. - /// - "SECURE_OPTIONAL" : Both HTTP and HTTPS requests with URLs that match - /// the handler succeed without redirects. The application can examine the - /// request to determine which protocol was used and respond accordingly. - /// - "SECURE_ALWAYS" : Requests for a URL that match this handler that do not - /// use HTTPS are automatically redirected to the HTTPS URL with the same - /// path. Query parameters are reserved for the redirect. - core.String securityLevel; - - /// URL to serve the endpoint at. - core.String url; - - ApiConfigHandler(); - - ApiConfigHandler.fromJson(core.Map _json) { - if (_json.containsKey('authFailAction')) { - authFailAction = _json['authFailAction'] as core.String; - } - if (_json.containsKey('login')) { - login = _json['login'] as core.String; - } - if (_json.containsKey('script')) { - script = _json['script'] as core.String; - } - if (_json.containsKey('securityLevel')) { - securityLevel = _json['securityLevel'] as core.String; - } - if (_json.containsKey('url')) { - url = _json['url'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (authFailAction != null) { - _json['authFailAction'] = authFailAction; - } - if (login != null) { - _json['login'] = login; - } - if (script != null) { - _json['script'] = script; - } - if (securityLevel != null) { - _json['securityLevel'] = securityLevel; - } - if (url != null) { - _json['url'] = url; - } - return _json; - } -} - -/// Uses Google Cloud Endpoints to handle requests. -class ApiEndpointHandler { - /// Path to the script from the application root directory. - core.String scriptPath; - - ApiEndpointHandler(); - - ApiEndpointHandler.fromJson(core.Map _json) { - if (_json.containsKey('scriptPath')) { - scriptPath = _json['scriptPath'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (scriptPath != null) { - _json['scriptPath'] = scriptPath; - } - return _json; - } -} - -/// An Application resource contains the top-level configuration of an App -/// Engine application. -class Application { - /// Google Apps authentication domain that controls which users can access - /// this application.Defaults to open access for any Google Account. - core.String authDomain; - - /// Google Cloud Storage bucket that can be used for storing files associated - /// with this application. - /// - /// This bucket is associated with the application and can be used by the - /// gcloud deployment commands.@OutputOnly - core.String codeBucket; - - /// The type of the Cloud Firestore or Cloud Datastore database associated - /// with this application. - /// Possible string values are: - /// - "DATABASE_TYPE_UNSPECIFIED" : Database type is unspecified. - /// - "CLOUD_DATASTORE" : Cloud Datastore - /// - "CLOUD_FIRESTORE" : Cloud Firestore Native - /// - "CLOUD_DATASTORE_COMPATIBILITY" : Cloud Firestore in Datastore Mode - core.String databaseType; - - /// Google Cloud Storage bucket that can be used by this application to store - /// content.@OutputOnly - core.String defaultBucket; - - /// Cookie expiration policy for this application. - core.String defaultCookieExpiration; - - /// Hostname used to reach this application, as resolved by App - /// Engine.@OutputOnly - core.String defaultHostname; - - /// HTTP path dispatch rules for requests to the application that do not - /// explicitly target a service or version. - /// - /// Rules are order-dependent. Up to 20 dispatch rules can be supported. - core.List<UrlDispatchRule> dispatchRules; - - /// The feature specific settings to be used in the application. - FeatureSettings featureSettings; - - /// The Google Container Registry domain used for storing managed build docker - /// images for this application. - core.String gcrDomain; - IdentityAwareProxy iap; - - /// Identifier of the Application resource. - /// - /// This identifier is equivalent to the project ID of the Google Cloud - /// Platform project where you want to deploy your application. Example: - /// myapp. - core.String id; - - /// Location from which this application runs. - /// - /// Application instances run out of the data centers in the specified - /// location, which is also where all of the application's end user content is - /// stored.Defaults to us-central.View the list of supported locations - /// (https://cloud.google.com/appengine/docs/locations). - core.String locationId; - - /// Full path to the Application resource in the API. - /// - /// Example: apps/myapp.@OutputOnly - core.String name; - - /// Serving status of this application. - /// Possible string values are: - /// - "UNSPECIFIED" : Serving status is unspecified. - /// - "SERVING" : Application is serving. - /// - "USER_DISABLED" : Application has been disabled by the user. - /// - "SYSTEM_DISABLED" : Application has been disabled by the system. - core.String servingStatus; - - Application(); - - Application.fromJson(core.Map _json) { - if (_json.containsKey('authDomain')) { - authDomain = _json['authDomain'] as core.String; - } - if (_json.containsKey('codeBucket')) { - codeBucket = _json['codeBucket'] as core.String; - } - if (_json.containsKey('databaseType')) { - databaseType = _json['databaseType'] as core.String; - } - if (_json.containsKey('defaultBucket')) { - defaultBucket = _json['defaultBucket'] as core.String; - } - if (_json.containsKey('defaultCookieExpiration')) { - defaultCookieExpiration = _json['defaultCookieExpiration'] as core.String; - } - if (_json.containsKey('defaultHostname')) { - defaultHostname = _json['defaultHostname'] as core.String; - } - if (_json.containsKey('dispatchRules')) { - dispatchRules = (_json['dispatchRules'] as core.List) - .map<UrlDispatchRule>((value) => UrlDispatchRule.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('featureSettings')) { - featureSettings = FeatureSettings.fromJson( - _json['featureSettings'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('gcrDomain')) { - gcrDomain = _json['gcrDomain'] as core.String; - } - if (_json.containsKey('iap')) { - iap = IdentityAwareProxy.fromJson( - _json['iap'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('servingStatus')) { - servingStatus = _json['servingStatus'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (authDomain != null) { - _json['authDomain'] = authDomain; - } - if (codeBucket != null) { - _json['codeBucket'] = codeBucket; - } - if (databaseType != null) { - _json['databaseType'] = databaseType; - } - if (defaultBucket != null) { - _json['defaultBucket'] = defaultBucket; - } - if (defaultCookieExpiration != null) { - _json['defaultCookieExpiration'] = defaultCookieExpiration; - } - if (defaultHostname != null) { - _json['defaultHostname'] = defaultHostname; - } - if (dispatchRules != null) { - _json['dispatchRules'] = - dispatchRules.map((value) => value.toJson()).toList(); - } - if (featureSettings != null) { - _json['featureSettings'] = featureSettings.toJson(); - } - if (gcrDomain != null) { - _json['gcrDomain'] = gcrDomain; - } - if (iap != null) { - _json['iap'] = iap.toJson(); - } - if (id != null) { - _json['id'] = id; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (name != null) { - _json['name'] = name; - } - if (servingStatus != null) { - _json['servingStatus'] = servingStatus; - } - return _json; - } -} - -/// An SSL certificate that a user has been authorized to administer. -/// -/// A user is authorized to administer any certificate that applies to one of -/// their authorized domains. -class AuthorizedCertificate { - /// The SSL certificate serving the AuthorizedCertificate resource. - /// - /// This must be obtained independently from a certificate authority. - CertificateRawData certificateRawData; - - /// The user-specified display name of the certificate. - /// - /// This is not guaranteed to be unique. Example: My Certificate. - core.String displayName; - - /// Aggregate count of the domain mappings with this certificate mapped. - /// - /// This count includes domain mappings on applications for which the user - /// does not have VIEWER permissions.Only returned by GET or LIST requests - /// when specifically requested by the view=FULL_CERTIFICATE - /// option.@OutputOnly - core.int domainMappingsCount; - - /// Topmost applicable domains of this certificate. - /// - /// This certificate applies to these domains and their subdomains. Example: - /// example.com.@OutputOnly - core.List<core.String> domainNames; - - /// The time when this certificate expires. - /// - /// To update the renewal time on this certificate, upload an SSL certificate - /// with a different expiration time using - /// AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly - core.String expireTime; - - /// Relative name of the certificate. - /// - /// This is a unique value autogenerated on AuthorizedCertificate resource - /// creation. Example: 12345.@OutputOnly - core.String id; - - /// Only applicable if this certificate is managed by App Engine. - /// - /// Managed certificates are tied to the lifecycle of a DomainMapping and - /// cannot be updated or deleted via the AuthorizedCertificates API. If this - /// certificate is manually administered by the user, this field will be - /// empty.@OutputOnly - ManagedCertificate managedCertificate; - - /// Full path to the AuthorizedCertificate resource in the API. - /// - /// Example: apps/myapp/authorizedCertificates/12345.@OutputOnly - core.String name; - - /// The full paths to user visible Domain Mapping resources that have this - /// certificate mapped. - /// - /// Example: apps/myapp/domainMappings/example.com.This may not represent the - /// full list of mapped domain mappings if the user does not have VIEWER - /// permissions on all of the applications that have this certificate mapped. - /// See domain_mappings_count for a complete count.Only returned by GET or - /// LIST requests when specifically requested by the view=FULL_CERTIFICATE - /// option.@OutputOnly - core.List<core.String> visibleDomainMappings; - - AuthorizedCertificate(); - - AuthorizedCertificate.fromJson(core.Map _json) { - if (_json.containsKey('certificateRawData')) { - certificateRawData = CertificateRawData.fromJson( - _json['certificateRawData'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('domainMappingsCount')) { - domainMappingsCount = _json['domainMappingsCount'] as core.int; - } - if (_json.containsKey('domainNames')) { - domainNames = (_json['domainNames'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('expireTime')) { - expireTime = _json['expireTime'] as core.String; - } - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('managedCertificate')) { - managedCertificate = ManagedCertificate.fromJson( - _json['managedCertificate'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('visibleDomainMappings')) { - visibleDomainMappings = (_json['visibleDomainMappings'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (certificateRawData != null) { - _json['certificateRawData'] = certificateRawData.toJson(); - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (domainMappingsCount != null) { - _json['domainMappingsCount'] = domainMappingsCount; - } - if (domainNames != null) { - _json['domainNames'] = domainNames; - } - if (expireTime != null) { - _json['expireTime'] = expireTime; - } - if (id != null) { - _json['id'] = id; - } - if (managedCertificate != null) { - _json['managedCertificate'] = managedCertificate.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (visibleDomainMappings != null) { - _json['visibleDomainMappings'] = visibleDomainMappings; - } - return _json; - } -} - -/// A domain that a user has been authorized to administer. -/// -/// To authorize use of a domain, verify ownership via Webmaster Central -/// (https://www.google.com/webmasters/verification/home). -class AuthorizedDomain { - /// Fully qualified domain name of the domain authorized for use. - /// - /// Example: example.com. - core.String id; - - /// Full path to the AuthorizedDomain resource in the API. - /// - /// Example: apps/myapp/authorizedDomains/example.com.@OutputOnly - core.String name; - - AuthorizedDomain(); - - AuthorizedDomain.fromJson(core.Map _json) { - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (id != null) { - _json['id'] = id; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Automatic scaling is based on request rate, response latencies, and other -/// application metrics. -class AutomaticScaling { - /// The time period that the Autoscaler - /// (https://cloud.google.com/compute/docs/autoscaler/) should wait before it - /// starts collecting information from a new instance. - /// - /// This prevents the autoscaler from collecting information when the instance - /// is initializing, during which the collected usage would not be reliable. - /// Only applicable in the App Engine flexible environment. - core.String coolDownPeriod; - - /// Target scaling by CPU usage. - CpuUtilization cpuUtilization; - - /// Target scaling by user-provided metrics. - /// - /// Only applicable in the App Engine flexible environment. - core.List<CustomMetric> customMetrics; - - /// Target scaling by disk usage. - DiskUtilization diskUtilization; - - /// Number of concurrent requests an automatic scaling instance can accept - /// before the scheduler spawns a new instance.Defaults to a runtime-specific - /// value. - core.int maxConcurrentRequests; - - /// Maximum number of idle instances that should be maintained for this - /// version. - core.int maxIdleInstances; - - /// Maximum amount of time that a request should wait in the pending queue - /// before starting a new instance to handle it. - core.String maxPendingLatency; - - /// Maximum number of instances that should be started to handle requests for - /// this version. - core.int maxTotalInstances; - - /// Minimum number of idle instances that should be maintained for this - /// version. - /// - /// Only applicable for the default version of a service. - core.int minIdleInstances; - - /// Minimum amount of time a request should wait in the pending queue before - /// starting a new instance to handle it. - core.String minPendingLatency; - - /// Minimum number of running instances that should be maintained for this - /// version. - core.int minTotalInstances; - - /// Target scaling by network usage. - NetworkUtilization networkUtilization; - - /// Target scaling by request utilization. - RequestUtilization requestUtilization; - - /// Scheduler settings for standard environment. - StandardSchedulerSettings standardSchedulerSettings; - - AutomaticScaling(); - - AutomaticScaling.fromJson(core.Map _json) { - if (_json.containsKey('coolDownPeriod')) { - coolDownPeriod = _json['coolDownPeriod'] as core.String; - } - if (_json.containsKey('cpuUtilization')) { - cpuUtilization = CpuUtilization.fromJson( - _json['cpuUtilization'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('customMetrics')) { - customMetrics = (_json['customMetrics'] as core.List) - .map<CustomMetric>((value) => CustomMetric.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('diskUtilization')) { - diskUtilization = DiskUtilization.fromJson( - _json['diskUtilization'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('maxConcurrentRequests')) { - maxConcurrentRequests = _json['maxConcurrentRequests'] as core.int; - } - if (_json.containsKey('maxIdleInstances')) { - maxIdleInstances = _json['maxIdleInstances'] as core.int; - } - if (_json.containsKey('maxPendingLatency')) { - maxPendingLatency = _json['maxPendingLatency'] as core.String; - } - if (_json.containsKey('maxTotalInstances')) { - maxTotalInstances = _json['maxTotalInstances'] as core.int; - } - if (_json.containsKey('minIdleInstances')) { - minIdleInstances = _json['minIdleInstances'] as core.int; - } - if (_json.containsKey('minPendingLatency')) { - minPendingLatency = _json['minPendingLatency'] as core.String; - } - if (_json.containsKey('minTotalInstances')) { - minTotalInstances = _json['minTotalInstances'] as core.int; - } - if (_json.containsKey('networkUtilization')) { - networkUtilization = NetworkUtilization.fromJson( - _json['networkUtilization'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('requestUtilization')) { - requestUtilization = RequestUtilization.fromJson( - _json['requestUtilization'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('standardSchedulerSettings')) { - standardSchedulerSettings = StandardSchedulerSettings.fromJson( - _json['standardSchedulerSettings'] - as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (coolDownPeriod != null) { - _json['coolDownPeriod'] = coolDownPeriod; - } - if (cpuUtilization != null) { - _json['cpuUtilization'] = cpuUtilization.toJson(); - } - if (customMetrics != null) { - _json['customMetrics'] = - customMetrics.map((value) => value.toJson()).toList(); - } - if (diskUtilization != null) { - _json['diskUtilization'] = diskUtilization.toJson(); - } - if (maxConcurrentRequests != null) { - _json['maxConcurrentRequests'] = maxConcurrentRequests; - } - if (maxIdleInstances != null) { - _json['maxIdleInstances'] = maxIdleInstances; - } - if (maxPendingLatency != null) { - _json['maxPendingLatency'] = maxPendingLatency; - } - if (maxTotalInstances != null) { - _json['maxTotalInstances'] = maxTotalInstances; - } - if (minIdleInstances != null) { - _json['minIdleInstances'] = minIdleInstances; - } - if (minPendingLatency != null) { - _json['minPendingLatency'] = minPendingLatency; - } - if (minTotalInstances != null) { - _json['minTotalInstances'] = minTotalInstances; - } - if (networkUtilization != null) { - _json['networkUtilization'] = networkUtilization.toJson(); - } - if (requestUtilization != null) { - _json['requestUtilization'] = requestUtilization.toJson(); - } - if (standardSchedulerSettings != null) { - _json['standardSchedulerSettings'] = standardSchedulerSettings.toJson(); - } - return _json; - } -} - -/// A service with basic scaling will create an instance when the application -/// receives a request. -/// -/// The instance will be turned down when the app becomes idle. Basic scaling is -/// ideal for work that is intermittent or driven by user activity. -class BasicScaling { - /// Duration of time after the last request that an instance must wait before - /// the instance is shut down. - core.String idleTimeout; - - /// Maximum number of instances to create for this version. - core.int maxInstances; - - BasicScaling(); - - BasicScaling.fromJson(core.Map _json) { - if (_json.containsKey('idleTimeout')) { - idleTimeout = _json['idleTimeout'] as core.String; - } - if (_json.containsKey('maxInstances')) { - maxInstances = _json['maxInstances'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (idleTimeout != null) { - _json['idleTimeout'] = idleTimeout; - } - if (maxInstances != null) { - _json['maxInstances'] = maxInstances; - } - return _json; - } -} - -/// Request message for Firewall.BatchUpdateIngressRules. -class BatchUpdateIngressRulesRequest { - /// A list of FirewallRules to replace the existing set. - core.List<FirewallRule> ingressRules; - - BatchUpdateIngressRulesRequest(); - - BatchUpdateIngressRulesRequest.fromJson(core.Map _json) { - if (_json.containsKey('ingressRules')) { - ingressRules = (_json['ingressRules'] as core.List) - .map<FirewallRule>((value) => FirewallRule.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ingressRules != null) { - _json['ingressRules'] = - ingressRules.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response message for Firewall.UpdateAllIngressRules. -class BatchUpdateIngressRulesResponse { - /// The full list of ingress FirewallRules for this application. - core.List<FirewallRule> ingressRules; - - BatchUpdateIngressRulesResponse(); - - BatchUpdateIngressRulesResponse.fromJson(core.Map _json) { - if (_json.containsKey('ingressRules')) { - ingressRules = (_json['ingressRules'] as core.List) - .map<FirewallRule>((value) => FirewallRule.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ingressRules != null) { - _json['ingressRules'] = - ingressRules.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Google Cloud Build information. -class BuildInfo { - /// The Google Cloud Build id. - /// - /// Example: "f966068f-08b2-42c8-bdfe-74137dff2bf9" - core.String cloudBuildId; - - BuildInfo(); - - BuildInfo.fromJson(core.Map _json) { - if (_json.containsKey('cloudBuildId')) { - cloudBuildId = _json['cloudBuildId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudBuildId != null) { - _json['cloudBuildId'] = cloudBuildId; - } - return _json; - } -} - -/// An SSL certificate obtained from a certificate authority. -class CertificateRawData { - /// Unencrypted PEM encoded RSA private key. - /// - /// This field is set once on certificate creation and then encrypted. The key - /// size must be 2048 bits or fewer. Must include the header and footer. - /// Example: -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY----- - /// @InputOnly - core.String privateKey; - - /// PEM encoded x.509 public key certificate. - /// - /// This field is set once on certificate creation. Must include the header - /// and footer. Example: -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- - core.String publicCertificate; - - CertificateRawData(); - - CertificateRawData.fromJson(core.Map _json) { - if (_json.containsKey('privateKey')) { - privateKey = _json['privateKey'] as core.String; - } - if (_json.containsKey('publicCertificate')) { - publicCertificate = _json['publicCertificate'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (privateKey != null) { - _json['privateKey'] = privateKey; - } - if (publicCertificate != null) { - _json['publicCertificate'] = publicCertificate; - } - return _json; - } -} - -/// Options for the build operations performed as a part of the version -/// deployment. -/// -/// Only applicable for App Engine flexible environment when creating a version -/// using source code directly. -class CloudBuildOptions { - /// Path to the yaml file used in deployment, used to determine runtime - /// configuration details.Required for flexible environment builds.See - /// https://cloud.google.com/appengine/docs/standard/python/config/appref for - /// more details. - core.String appYamlPath; - - /// The Cloud Build timeout used as part of any dependent builds performed by - /// version creation. - /// - /// Defaults to 10 minutes. - core.String cloudBuildTimeout; - - CloudBuildOptions(); - - CloudBuildOptions.fromJson(core.Map _json) { - if (_json.containsKey('appYamlPath')) { - appYamlPath = _json['appYamlPath'] as core.String; - } - if (_json.containsKey('cloudBuildTimeout')) { - cloudBuildTimeout = _json['cloudBuildTimeout'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (appYamlPath != null) { - _json['appYamlPath'] = appYamlPath; - } - if (cloudBuildTimeout != null) { - _json['cloudBuildTimeout'] = cloudBuildTimeout; - } - return _json; - } -} - -/// Docker image that is used to create a container and start a VM instance for -/// the version that you deploy. -/// -/// Only applicable for instances running in the App Engine flexible -/// environment. -class ContainerInfo { - /// URI to the hosted container image in Google Container Registry. - /// - /// The URI must be fully qualified and include a tag or digest. Examples: - /// "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" - core.String image; - - ContainerInfo(); - - ContainerInfo.fromJson(core.Map _json) { - if (_json.containsKey('image')) { - image = _json['image'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (image != null) { - _json['image'] = image; - } - return _json; - } -} - -/// Target scaling by CPU usage. -class CpuUtilization { - /// Period of time over which CPU utilization is calculated. - core.String aggregationWindowLength; - - /// Target CPU utilization ratio to maintain when scaling. - /// - /// Must be between 0 and 1. - core.double targetUtilization; - - CpuUtilization(); - - CpuUtilization.fromJson(core.Map _json) { - if (_json.containsKey('aggregationWindowLength')) { - aggregationWindowLength = _json['aggregationWindowLength'] as core.String; - } - if (_json.containsKey('targetUtilization')) { - targetUtilization = (_json['targetUtilization'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (aggregationWindowLength != null) { - _json['aggregationWindowLength'] = aggregationWindowLength; - } - if (targetUtilization != null) { - _json['targetUtilization'] = targetUtilization; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation during a -/// google.appengine.v1.CreateVersionRequest. -class CreateVersionMetadataV1 { - /// The Cloud Build ID if one was created as part of the version create. - /// - /// @OutputOnly - core.String cloudBuildId; - - CreateVersionMetadataV1(); - - CreateVersionMetadataV1.fromJson(core.Map _json) { - if (_json.containsKey('cloudBuildId')) { - cloudBuildId = _json['cloudBuildId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudBuildId != null) { - _json['cloudBuildId'] = cloudBuildId; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation during a -/// google.appengine.v1alpha.CreateVersionRequest. -class CreateVersionMetadataV1Alpha { - /// The Cloud Build ID if one was created as part of the version create. - /// - /// @OutputOnly - core.String cloudBuildId; - - CreateVersionMetadataV1Alpha(); - - CreateVersionMetadataV1Alpha.fromJson(core.Map _json) { - if (_json.containsKey('cloudBuildId')) { - cloudBuildId = _json['cloudBuildId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudBuildId != null) { - _json['cloudBuildId'] = cloudBuildId; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation during a -/// google.appengine.v1beta.CreateVersionRequest. -class CreateVersionMetadataV1Beta { - /// The Cloud Build ID if one was created as part of the version create. - /// - /// @OutputOnly - core.String cloudBuildId; - - CreateVersionMetadataV1Beta(); - - CreateVersionMetadataV1Beta.fromJson(core.Map _json) { - if (_json.containsKey('cloudBuildId')) { - cloudBuildId = _json['cloudBuildId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudBuildId != null) { - _json['cloudBuildId'] = cloudBuildId; - } - return _json; - } -} - -/// Allows autoscaling based on Stackdriver metrics. -class CustomMetric { - /// Allows filtering on the metric's fields. - core.String filter; - - /// The name of the metric. - core.String metricName; - - /// May be used instead of target_utilization when an instance can handle a - /// specific amount of work/resources and the metric value is equal to the - /// current amount of work remaining. - /// - /// The autoscaler will try to keep the number of instances equal to the - /// metric value divided by single_instance_assignment. - core.double singleInstanceAssignment; - - /// The type of the metric. - /// - /// Must be a string representing a Stackdriver metric type e.g. GAGUE, - /// DELTA_PER_SECOND, etc. - core.String targetType; - - /// The target value for the metric. - core.double targetUtilization; - - CustomMetric(); - - CustomMetric.fromJson(core.Map _json) { - if (_json.containsKey('filter')) { - filter = _json['filter'] as core.String; - } - if (_json.containsKey('metricName')) { - metricName = _json['metricName'] as core.String; - } - if (_json.containsKey('singleInstanceAssignment')) { - singleInstanceAssignment = - (_json['singleInstanceAssignment'] as core.num).toDouble(); - } - if (_json.containsKey('targetType')) { - targetType = _json['targetType'] as core.String; - } - if (_json.containsKey('targetUtilization')) { - targetUtilization = (_json['targetUtilization'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (filter != null) { - _json['filter'] = filter; - } - if (metricName != null) { - _json['metricName'] = metricName; - } - if (singleInstanceAssignment != null) { - _json['singleInstanceAssignment'] = singleInstanceAssignment; - } - if (targetType != null) { - _json['targetType'] = targetType; - } - if (targetUtilization != null) { - _json['targetUtilization'] = targetUtilization; - } - return _json; - } -} - -/// Request message for Instances.DebugInstance. -class DebugInstanceRequest { - /// Public SSH key to add to the instance. - /// - /// Examples: \[USERNAME\]:ssh-rsa \[KEY_VALUE\] \[USERNAME\] - /// \[USERNAME\]:ssh-rsa \[KEY_VALUE\] google-ssh - /// {"userName":"\[USERNAME\]","expireOn":"\[EXPIRE_TIME\]"}For more - /// information, see Adding and Removing SSH Keys - /// (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). - core.String sshKey; - - DebugInstanceRequest(); - - DebugInstanceRequest.fromJson(core.Map _json) { - if (_json.containsKey('sshKey')) { - sshKey = _json['sshKey'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (sshKey != null) { - _json['sshKey'] = sshKey; - } - return _json; - } -} - -/// Code and application artifacts used to deploy a version to App Engine. -class Deployment { - /// Google Cloud Build build information. - /// - /// Only applicable for instances running in the App Engine flexible - /// environment. - BuildInfo build; - - /// Options for any Google Cloud Build builds created as a part of this - /// deployment.These options will only be used if a new build is created, such - /// as when deploying to the App Engine flexible environment using files or - /// zip. - CloudBuildOptions cloudBuildOptions; - - /// The Docker image for the container that runs the version. - /// - /// Only applicable for instances running in the App Engine flexible - /// environment. - ContainerInfo container; - - /// Manifest of the files stored in Google Cloud Storage that are included as - /// part of this version. - /// - /// All files must be readable using the credentials supplied with this call. - core.Map<core.String, FileInfo> files; - - /// The zip file for this deployment, if this is a zip deployment. - ZipInfo zip; - - Deployment(); - - Deployment.fromJson(core.Map _json) { - if (_json.containsKey('build')) { - build = BuildInfo.fromJson( - _json['build'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('cloudBuildOptions')) { - cloudBuildOptions = CloudBuildOptions.fromJson( - _json['cloudBuildOptions'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('container')) { - container = ContainerInfo.fromJson( - _json['container'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('files')) { - files = (_json['files'] as core.Map).cast<core.String, core.Map>().map( - (key, item) => core.MapEntry( - key, - FileInfo.fromJson(item as core.Map<core.String, core.dynamic>), - ), - ); - } - if (_json.containsKey('zip')) { - zip = - ZipInfo.fromJson(_json['zip'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (build != null) { - _json['build'] = build.toJson(); - } - if (cloudBuildOptions != null) { - _json['cloudBuildOptions'] = cloudBuildOptions.toJson(); - } - if (container != null) { - _json['container'] = container.toJson(); - } - if (files != null) { - _json['files'] = - files.map((key, item) => core.MapEntry(key, item.toJson())); - } - if (zip != null) { - _json['zip'] = zip.toJson(); - } - return _json; - } -} - -/// Target scaling by disk usage. -/// -/// Only applicable in the App Engine flexible environment. -class DiskUtilization { - /// Target bytes read per second. - core.int targetReadBytesPerSecond; - - /// Target ops read per seconds. - core.int targetReadOpsPerSecond; - - /// Target bytes written per second. - core.int targetWriteBytesPerSecond; - - /// Target ops written per second. - core.int targetWriteOpsPerSecond; - - DiskUtilization(); - - DiskUtilization.fromJson(core.Map _json) { - if (_json.containsKey('targetReadBytesPerSecond')) { - targetReadBytesPerSecond = _json['targetReadBytesPerSecond'] as core.int; - } - if (_json.containsKey('targetReadOpsPerSecond')) { - targetReadOpsPerSecond = _json['targetReadOpsPerSecond'] as core.int; - } - if (_json.containsKey('targetWriteBytesPerSecond')) { - targetWriteBytesPerSecond = - _json['targetWriteBytesPerSecond'] as core.int; - } - if (_json.containsKey('targetWriteOpsPerSecond')) { - targetWriteOpsPerSecond = _json['targetWriteOpsPerSecond'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (targetReadBytesPerSecond != null) { - _json['targetReadBytesPerSecond'] = targetReadBytesPerSecond; - } - if (targetReadOpsPerSecond != null) { - _json['targetReadOpsPerSecond'] = targetReadOpsPerSecond; - } - if (targetWriteBytesPerSecond != null) { - _json['targetWriteBytesPerSecond'] = targetWriteBytesPerSecond; - } - if (targetWriteOpsPerSecond != null) { - _json['targetWriteOpsPerSecond'] = targetWriteOpsPerSecond; - } - return _json; - } -} - -/// A domain serving an App Engine application. -class DomainMapping { - /// Relative name of the domain serving the application. - /// - /// Example: example.com. - core.String id; - - /// Full path to the DomainMapping resource in the API. - /// - /// Example: apps/myapp/domainMapping/example.com.@OutputOnly - core.String name; - - /// The resource records required to configure this domain mapping. - /// - /// These records must be added to the domain's DNS configuration in order to - /// serve the application via this domain mapping.@OutputOnly - core.List<ResourceRecord> resourceRecords; - - /// SSL configuration for this domain. - /// - /// If unconfigured, this domain will not serve with SSL. - SslSettings sslSettings; - - DomainMapping(); - - DomainMapping.fromJson(core.Map _json) { - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('resourceRecords')) { - resourceRecords = (_json['resourceRecords'] as core.List) - .map<ResourceRecord>((value) => ResourceRecord.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('sslSettings')) { - sslSettings = SslSettings.fromJson( - _json['sslSettings'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (id != null) { - _json['id'] = id; - } - if (name != null) { - _json['name'] = name; - } - if (resourceRecords != null) { - _json['resourceRecords'] = - resourceRecords.map((value) => value.toJson()).toList(); - } - if (sslSettings != null) { - _json['sslSettings'] = sslSettings.toJson(); - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for Empty is empty JSON -/// object {}. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Cloud Endpoints (https://cloud.google.com/endpoints) configuration. -/// -/// The Endpoints API Service provides tooling for serving Open API and gRPC -/// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment -/// deployments.The fields here refer to the name and configuration ID of a -/// "service" resource in the Service Management API -/// (https://cloud.google.com/service-management/overview). -class EndpointsApiService { - /// Endpoints service configuration ID as specified by the Service Management - /// API. - /// - /// For example "2016-09-19r1".By default, the rollout strategy for Endpoints - /// is RolloutStrategy.FIXED. This means that Endpoints starts up with a - /// particular configuration ID. When a new configuration is rolled out, - /// Endpoints must be given the new configuration ID. The config_id field is - /// used to give the configuration ID and is required in this case.Endpoints - /// also has a rollout strategy called RolloutStrategy.MANAGED. When using - /// this, Endpoints fetches the latest configuration and does not need the - /// configuration ID. In this case, config_id must be omitted. - core.String configId; - - /// Enable or disable trace sampling. - /// - /// By default, this is set to false for enabled. - core.bool disableTraceSampling; - - /// Endpoints service name which is the name of the "service" resource in the - /// Service Management API. - /// - /// For example "myapi.endpoints.myproject.cloud.goog" - core.String name; - - /// Endpoints rollout strategy. - /// - /// If FIXED, config_id must be specified. If MANAGED, config_id must be - /// omitted. - /// Possible string values are: - /// - "UNSPECIFIED_ROLLOUT_STRATEGY" : Not specified. Defaults to FIXED. - /// - "FIXED" : Endpoints service configuration ID will be fixed to the - /// configuration ID specified by config_id. - /// - "MANAGED" : Endpoints service configuration ID will be updated with each - /// rollout. - core.String rolloutStrategy; - - EndpointsApiService(); - - EndpointsApiService.fromJson(core.Map _json) { - if (_json.containsKey('configId')) { - configId = _json['configId'] as core.String; - } - if (_json.containsKey('disableTraceSampling')) { - disableTraceSampling = _json['disableTraceSampling'] as core.bool; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('rolloutStrategy')) { - rolloutStrategy = _json['rolloutStrategy'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (configId != null) { - _json['configId'] = configId; - } - if (disableTraceSampling != null) { - _json['disableTraceSampling'] = disableTraceSampling; - } - if (name != null) { - _json['name'] = name; - } - if (rolloutStrategy != null) { - _json['rolloutStrategy'] = rolloutStrategy; - } - return _json; - } -} - -/// The entrypoint for the application. -class Entrypoint { - /// The format should be a shell command that can be fed to bash -c. - core.String shell; - - Entrypoint(); - - Entrypoint.fromJson(core.Map _json) { - if (_json.containsKey('shell')) { - shell = _json['shell'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (shell != null) { - _json['shell'] = shell; - } - return _json; - } -} - -/// Custom static error page to be served when an error occurs. -class ErrorHandler { - /// Error condition this handler applies to. - /// Possible string values are: - /// - "ERROR_CODE_UNSPECIFIED" : Not specified. ERROR_CODE_DEFAULT is assumed. - /// - "ERROR_CODE_DEFAULT" : All other error types. - /// - "ERROR_CODE_OVER_QUOTA" : Application has exceeded a resource quota. - /// - "ERROR_CODE_DOS_API_DENIAL" : Client blocked by the application's Denial - /// of Service protection configuration. - /// - "ERROR_CODE_TIMEOUT" : Deadline reached before the application responds. - core.String errorCode; - - /// MIME type of file. - /// - /// Defaults to text/html. - core.String mimeType; - - /// Static file content to be served for this error. - core.String staticFile; - - ErrorHandler(); - - ErrorHandler.fromJson(core.Map _json) { - if (_json.containsKey('errorCode')) { - errorCode = _json['errorCode'] as core.String; - } - if (_json.containsKey('mimeType')) { - mimeType = _json['mimeType'] as core.String; - } - if (_json.containsKey('staticFile')) { - staticFile = _json['staticFile'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (errorCode != null) { - _json['errorCode'] = errorCode; - } - if (mimeType != null) { - _json['mimeType'] = mimeType; - } - if (staticFile != null) { - _json['staticFile'] = staticFile; - } - return _json; - } -} - -/// The feature specific settings to be used in the application. -/// -/// These define behaviors that are user configurable. -class FeatureSettings { - /// Boolean value indicating if split health checks should be used instead of - /// the legacy health checks. - /// - /// At an app.yaml level, this means defaulting to 'readiness_check' and - /// 'liveness_check' values instead of 'health_check' ones. Once the legacy - /// 'health_check' behavior is deprecated, and this value is always true, this - /// setting can be removed. - core.bool splitHealthChecks; - - /// If true, use Container-Optimized OS - /// (https://cloud.google.com/container-optimized-os/) base image for VMs, - /// rather than a base Debian image. - core.bool useContainerOptimizedOs; - - FeatureSettings(); - - FeatureSettings.fromJson(core.Map _json) { - if (_json.containsKey('splitHealthChecks')) { - splitHealthChecks = _json['splitHealthChecks'] as core.bool; - } - if (_json.containsKey('useContainerOptimizedOs')) { - useContainerOptimizedOs = _json['useContainerOptimizedOs'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (splitHealthChecks != null) { - _json['splitHealthChecks'] = splitHealthChecks; - } - if (useContainerOptimizedOs != null) { - _json['useContainerOptimizedOs'] = useContainerOptimizedOs; - } - return _json; - } -} - -/// Single source file that is part of the version to be deployed. -/// -/// Each source file that is deployed must be specified separately. -class FileInfo { - /// The MIME type of the file.Defaults to the value from Google Cloud Storage. - core.String mimeType; - - /// The SHA1 hash of the file, in hex. - core.String sha1Sum; - - /// URL source to use to fetch this file. - /// - /// Must be a URL to a resource in Google Cloud Storage in the form - /// 'http(s)://storage.googleapis.com//'. - core.String sourceUrl; - - FileInfo(); - - FileInfo.fromJson(core.Map _json) { - if (_json.containsKey('mimeType')) { - mimeType = _json['mimeType'] as core.String; - } - if (_json.containsKey('sha1Sum')) { - sha1Sum = _json['sha1Sum'] as core.String; - } - if (_json.containsKey('sourceUrl')) { - sourceUrl = _json['sourceUrl'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mimeType != null) { - _json['mimeType'] = mimeType; - } - if (sha1Sum != null) { - _json['sha1Sum'] = sha1Sum; - } - if (sourceUrl != null) { - _json['sourceUrl'] = sourceUrl; - } - return _json; - } -} - -/// A single firewall rule that is evaluated against incoming traffic and -/// provides an action to take on matched requests. -class FirewallRule { - /// The action to take on matched requests. - /// Possible string values are: - /// - "UNSPECIFIED_ACTION" - /// - "ALLOW" : Matching requests are allowed. - /// - "DENY" : Matching requests are denied. - core.String action; - - /// An optional string description of this rule. - /// - /// This field has a maximum length of 100 characters. - core.String description; - - /// A positive integer between 1, Int32.MaxValue-1 that defines the order of - /// rule evaluation. - /// - /// Rules with the lowest priority are evaluated first.A default rule at - /// priority Int32.MaxValue matches all IPv4 and IPv6 traffic when no previous - /// rule matches. Only the action of this rule can be modified by the user. - core.int priority; - - /// IP address or range, defined using CIDR notation, of requests that this - /// rule applies to. - /// - /// You can use the wildcard character "*" to match all IPs equivalent to - /// "0/0" and "::/0" together. Examples: 192.168.1.1 or 192.168.0.0/16 or - /// 2001:db8::/32 or 2001:0db8:0000:0042:0000:8a2e:0370:7334. Truncation will - /// be silently performed on addresses which are not properly truncated. For - /// example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. - /// Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as - /// 2001:db8::/32. - core.String sourceRange; - - FirewallRule(); - - FirewallRule.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('priority')) { - priority = _json['priority'] as core.int; - } - if (_json.containsKey('sourceRange')) { - sourceRange = _json['sourceRange'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (description != null) { - _json['description'] = description; - } - if (priority != null) { - _json['priority'] = priority; - } - if (sourceRange != null) { - _json['sourceRange'] = sourceRange; - } - return _json; - } -} - -/// Health checking configuration for VM instances. -/// -/// Unhealthy instances are killed and replaced with new instances. Only -/// applicable for instances in App Engine flexible environment. -class HealthCheck { - /// Interval between health checks. - core.String checkInterval; - - /// Whether to explicitly disable health checks for this instance. - core.bool disableHealthCheck; - - /// Number of consecutive successful health checks required before receiving - /// traffic. - core.int healthyThreshold; - - /// Host header to send when performing an HTTP health check. - /// - /// Example: "myapp.appspot.com" - core.String host; - - /// Number of consecutive failed health checks required before an instance is - /// restarted. - core.int restartThreshold; - - /// Time before the health check is considered failed. - core.String timeout; - - /// Number of consecutive failed health checks required before removing - /// traffic. - core.int unhealthyThreshold; - - HealthCheck(); - - HealthCheck.fromJson(core.Map _json) { - if (_json.containsKey('checkInterval')) { - checkInterval = _json['checkInterval'] as core.String; - } - if (_json.containsKey('disableHealthCheck')) { - disableHealthCheck = _json['disableHealthCheck'] as core.bool; - } - if (_json.containsKey('healthyThreshold')) { - healthyThreshold = _json['healthyThreshold'] as core.int; - } - if (_json.containsKey('host')) { - host = _json['host'] as core.String; - } - if (_json.containsKey('restartThreshold')) { - restartThreshold = _json['restartThreshold'] as core.int; - } - if (_json.containsKey('timeout')) { - timeout = _json['timeout'] as core.String; - } - if (_json.containsKey('unhealthyThreshold')) { - unhealthyThreshold = _json['unhealthyThreshold'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (checkInterval != null) { - _json['checkInterval'] = checkInterval; - } - if (disableHealthCheck != null) { - _json['disableHealthCheck'] = disableHealthCheck; - } - if (healthyThreshold != null) { - _json['healthyThreshold'] = healthyThreshold; - } - if (host != null) { - _json['host'] = host; - } - if (restartThreshold != null) { - _json['restartThreshold'] = restartThreshold; - } - if (timeout != null) { - _json['timeout'] = timeout; - } - if (unhealthyThreshold != null) { - _json['unhealthyThreshold'] = unhealthyThreshold; - } - return _json; - } -} - -/// Identity-Aware Proxy -class IdentityAwareProxy { - /// Whether the serving infrastructure will authenticate and authorize all - /// incoming requests.If true, the oauth2_client_id and oauth2_client_secret - /// fields must be non-empty. - core.bool enabled; - - /// OAuth2 client ID to use for the authentication flow. - core.String oauth2ClientId; - - /// OAuth2 client secret to use for the authentication flow.For security - /// reasons, this value cannot be retrieved via the API. - /// - /// Instead, the SHA-256 hash of the value is returned in the - /// oauth2_client_secret_sha256 field.@InputOnly - core.String oauth2ClientSecret; - - /// Hex-encoded SHA-256 hash of the client secret.@OutputOnly - core.String oauth2ClientSecretSha256; - - IdentityAwareProxy(); - - IdentityAwareProxy.fromJson(core.Map _json) { - if (_json.containsKey('enabled')) { - enabled = _json['enabled'] as core.bool; - } - if (_json.containsKey('oauth2ClientId')) { - oauth2ClientId = _json['oauth2ClientId'] as core.String; - } - if (_json.containsKey('oauth2ClientSecret')) { - oauth2ClientSecret = _json['oauth2ClientSecret'] as core.String; - } - if (_json.containsKey('oauth2ClientSecretSha256')) { - oauth2ClientSecretSha256 = - _json['oauth2ClientSecretSha256'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (enabled != null) { - _json['enabled'] = enabled; - } - if (oauth2ClientId != null) { - _json['oauth2ClientId'] = oauth2ClientId; - } - if (oauth2ClientSecret != null) { - _json['oauth2ClientSecret'] = oauth2ClientSecret; - } - if (oauth2ClientSecretSha256 != null) { - _json['oauth2ClientSecretSha256'] = oauth2ClientSecretSha256; - } - return _json; - } -} - -/// An Instance resource is the computing unit that App Engine uses to -/// automatically scale an application. -class Instance { - /// App Engine release this instance is running on. - /// - /// Output only. - core.String appEngineRelease; - - /// Availability of the instance. - /// - /// Output only. - /// Possible string values are: - /// - "UNSPECIFIED" - /// - "RESIDENT" - /// - "DYNAMIC" - core.String availability; - - /// Average latency (ms) over the last minute. - /// - /// Output only. - core.int averageLatency; - - /// Number of errors since this instance was started. - /// - /// Output only. - core.int errors; - - /// Relative name of the instance within the version. - /// - /// Example: instance-1. - /// - /// Output only. - core.String id; - - /// Total memory in use (bytes). - /// - /// Output only. - core.String memoryUsage; - - /// Full path to the Instance resource in the API. - /// - /// Example: apps/myapp/services/default/versions/v1/instances/instance-1. - /// - /// Output only. - core.String name; - - /// Average queries per second (QPS) over the last minute. - /// - /// Output only. - core.double qps; - - /// Number of requests since this instance was started. - /// - /// Output only. - core.int requests; - - /// Time that this instance was started.@OutputOnly - /// - /// Output only. - core.String startTime; - - /// Whether this instance is in debug mode. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.bool vmDebugEnabled; - - /// Virtual machine ID of this instance. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.String vmId; - - /// The IP address of this instance. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.String vmIp; - - /// The liveness health check of this instance. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : There is no liveness health check for the - /// instance. Only applicable for instances in App Engine standard - /// environment. - /// - "UNKNOWN" : The health checking system is aware of the instance but its - /// health is not known at the moment. - /// - "HEALTHY" : The instance is reachable i.e. a connection to the - /// application health checking endpoint can be established, and conforms to - /// the requirements defined by the health check. - /// - "UNHEALTHY" : The instance is reachable, but does not conform to the - /// requirements defined by the health check. - /// - "DRAINING" : The instance is being drained. The existing connections to - /// the instance have time to complete, but the new ones are being refused. - /// - "TIMEOUT" : The instance is unreachable i.e. a connection to the - /// application health checking endpoint cannot be established, or the server - /// does not respond within the specified timeout. - core.String vmLiveness; - - /// Name of the virtual machine where this instance lives. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.String vmName; - - /// Status of the virtual machine where this instance lives. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.String vmStatus; - - /// Zone where the virtual machine is located. - /// - /// Only applicable for instances in App Engine flexible environment. - /// - /// Output only. - core.String vmZoneName; - - Instance(); - - Instance.fromJson(core.Map _json) { - if (_json.containsKey('appEngineRelease')) { - appEngineRelease = _json['appEngineRelease'] as core.String; - } - if (_json.containsKey('availability')) { - availability = _json['availability'] as core.String; - } - if (_json.containsKey('averageLatency')) { - averageLatency = _json['averageLatency'] as core.int; - } - if (_json.containsKey('errors')) { - errors = _json['errors'] as core.int; - } - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('memoryUsage')) { - memoryUsage = _json['memoryUsage'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('qps')) { - qps = (_json['qps'] as core.num).toDouble(); - } - if (_json.containsKey('requests')) { - requests = _json['requests'] as core.int; - } - if (_json.containsKey('startTime')) { - startTime = _json['startTime'] as core.String; - } - if (_json.containsKey('vmDebugEnabled')) { - vmDebugEnabled = _json['vmDebugEnabled'] as core.bool; - } - if (_json.containsKey('vmId')) { - vmId = _json['vmId'] as core.String; - } - if (_json.containsKey('vmIp')) { - vmIp = _json['vmIp'] as core.String; - } - if (_json.containsKey('vmLiveness')) { - vmLiveness = _json['vmLiveness'] as core.String; - } - if (_json.containsKey('vmName')) { - vmName = _json['vmName'] as core.String; - } - if (_json.containsKey('vmStatus')) { - vmStatus = _json['vmStatus'] as core.String; - } - if (_json.containsKey('vmZoneName')) { - vmZoneName = _json['vmZoneName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (appEngineRelease != null) { - _json['appEngineRelease'] = appEngineRelease; - } - if (availability != null) { - _json['availability'] = availability; - } - if (averageLatency != null) { - _json['averageLatency'] = averageLatency; - } - if (errors != null) { - _json['errors'] = errors; - } - if (id != null) { - _json['id'] = id; - } - if (memoryUsage != null) { - _json['memoryUsage'] = memoryUsage; - } - if (name != null) { - _json['name'] = name; - } - if (qps != null) { - _json['qps'] = qps; - } - if (requests != null) { - _json['requests'] = requests; - } - if (startTime != null) { - _json['startTime'] = startTime; - } - if (vmDebugEnabled != null) { - _json['vmDebugEnabled'] = vmDebugEnabled; - } - if (vmId != null) { - _json['vmId'] = vmId; - } - if (vmIp != null) { - _json['vmIp'] = vmIp; - } - if (vmLiveness != null) { - _json['vmLiveness'] = vmLiveness; - } - if (vmName != null) { - _json['vmName'] = vmName; - } - if (vmStatus != null) { - _json['vmStatus'] = vmStatus; - } - if (vmZoneName != null) { - _json['vmZoneName'] = vmZoneName; - } - return _json; - } -} - -/// Third-party Python runtime library that is required by the application. -class Library { - /// Name of the library. - /// - /// Example: "django". - core.String name; - - /// Version of the library to select, or "latest". - core.String version; - - Library(); - - Library.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Response message for AuthorizedCertificates.ListAuthorizedCertificates. -class ListAuthorizedCertificatesResponse { - /// The SSL certificates the user is authorized to administer. - core.List<AuthorizedCertificate> certificates; - - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - ListAuthorizedCertificatesResponse(); - - ListAuthorizedCertificatesResponse.fromJson(core.Map _json) { - if (_json.containsKey('certificates')) { - certificates = (_json['certificates'] as core.List) - .map<AuthorizedCertificate>((value) => AuthorizedCertificate.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (certificates != null) { - _json['certificates'] = - certificates.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for AuthorizedDomains.ListAuthorizedDomains. -class ListAuthorizedDomainsResponse { - /// The authorized domains belonging to the user. - core.List<AuthorizedDomain> domains; - - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - ListAuthorizedDomainsResponse(); - - ListAuthorizedDomainsResponse.fromJson(core.Map _json) { - if (_json.containsKey('domains')) { - domains = (_json['domains'] as core.List) - .map<AuthorizedDomain>((value) => AuthorizedDomain.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domains != null) { - _json['domains'] = domains.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for DomainMappings.ListDomainMappings. -class ListDomainMappingsResponse { - /// The domain mappings for the application. - core.List<DomainMapping> domainMappings; - - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - ListDomainMappingsResponse(); - - ListDomainMappingsResponse.fromJson(core.Map _json) { - if (_json.containsKey('domainMappings')) { - domainMappings = (_json['domainMappings'] as core.List) - .map<DomainMapping>((value) => DomainMapping.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domainMappings != null) { - _json['domainMappings'] = - domainMappings.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for Firewall.ListIngressRules. -class ListIngressRulesResponse { - /// The ingress FirewallRules for this application. - core.List<FirewallRule> ingressRules; - - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - ListIngressRulesResponse(); - - ListIngressRulesResponse.fromJson(core.Map _json) { - if (_json.containsKey('ingressRules')) { - ingressRules = (_json['ingressRules'] as core.List) - .map<FirewallRule>((value) => FirewallRule.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ingressRules != null) { - _json['ingressRules'] = - ingressRules.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for Instances.ListInstances. -class ListInstancesResponse { - /// The instances belonging to the requested version. - core.List<Instance> instances; - - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - ListInstancesResponse(); - - ListInstancesResponse.fromJson(core.Map _json) { - if (_json.containsKey('instances')) { - instances = (_json['instances'] as core.List) - .map<Instance>((value) => - Instance.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (instances != null) { - _json['instances'] = instances.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response message for Services.ListServices. -class ListServicesResponse { - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - /// The services belonging to the requested application. - core.List<Service> services; - - ListServicesResponse(); - - ListServicesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('services')) { - services = (_json['services'] as core.List) - .map<Service>((value) => - Service.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (services != null) { - _json['services'] = services.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response message for Versions.ListVersions. -class ListVersionsResponse { - /// Continuation token for fetching the next page of results. - core.String nextPageToken; - - /// The versions belonging to the requested service. - core.List<Version> versions; - - ListVersionsResponse(); - - ListVersionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('versions')) { - versions = (_json['versions'] as core.List) - .map<Version>((value) => - Version.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (versions != null) { - _json['versions'] = versions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Health checking configuration for VM instances. -/// -/// Unhealthy instances are killed and replaced with new instances. -class LivenessCheck { - /// Interval between health checks. - core.String checkInterval; - - /// Number of consecutive failed checks required before considering the VM - /// unhealthy. - core.int failureThreshold; - - /// Host header to send when performing a HTTP Liveness check. - /// - /// Example: "myapp.appspot.com" - core.String host; - - /// The initial delay before starting to execute the checks. - core.String initialDelay; - - /// The request path. - core.String path; - - /// Number of consecutive successful checks required before considering the VM - /// healthy. - core.int successThreshold; - - /// Time before the check is considered failed. - core.String timeout; - - LivenessCheck(); - - LivenessCheck.fromJson(core.Map _json) { - if (_json.containsKey('checkInterval')) { - checkInterval = _json['checkInterval'] as core.String; - } - if (_json.containsKey('failureThreshold')) { - failureThreshold = _json['failureThreshold'] as core.int; - } - if (_json.containsKey('host')) { - host = _json['host'] as core.String; - } - if (_json.containsKey('initialDelay')) { - initialDelay = _json['initialDelay'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('successThreshold')) { - successThreshold = _json['successThreshold'] as core.int; - } - if (_json.containsKey('timeout')) { - timeout = _json['timeout'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (checkInterval != null) { - _json['checkInterval'] = checkInterval; - } - if (failureThreshold != null) { - _json['failureThreshold'] = failureThreshold; - } - if (host != null) { - _json['host'] = host; - } - if (initialDelay != null) { - _json['initialDelay'] = initialDelay; - } - if (path != null) { - _json['path'] = path; - } - if (successThreshold != null) { - _json['successThreshold'] = successThreshold; - } - if (timeout != null) { - _json['timeout'] = timeout; - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: "us-east1". - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: "projects/example-project/locations/us-east1" - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Metadata for the given google.cloud.location.Location. -class LocationMetadata { - /// App Engine flexible environment is available in the given - /// location.@OutputOnly - core.bool flexibleEnvironmentAvailable; - - /// App Engine standard environment is available in the given - /// location.@OutputOnly - core.bool standardEnvironmentAvailable; - - LocationMetadata(); - - LocationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('flexibleEnvironmentAvailable')) { - flexibleEnvironmentAvailable = - _json['flexibleEnvironmentAvailable'] as core.bool; - } - if (_json.containsKey('standardEnvironmentAvailable')) { - standardEnvironmentAvailable = - _json['standardEnvironmentAvailable'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (flexibleEnvironmentAvailable != null) { - _json['flexibleEnvironmentAvailable'] = flexibleEnvironmentAvailable; - } - if (standardEnvironmentAvailable != null) { - _json['standardEnvironmentAvailable'] = standardEnvironmentAvailable; - } - return _json; - } -} - -/// A certificate managed by App Engine. -class ManagedCertificate { - /// Time at which the certificate was last renewed. - /// - /// The renewal process is fully managed. Certificate renewal will - /// automatically occur before the certificate expires. Renewal errors can be - /// tracked via ManagementStatus.@OutputOnly - core.String lastRenewalTime; - - /// Status of certificate management. - /// - /// Refers to the most recent certificate acquisition or renewal - /// attempt.@OutputOnly - /// Possible string values are: - /// - "MANAGEMENT_STATUS_UNSPECIFIED" - /// - "OK" : Certificate was successfully obtained and inserted into the - /// serving system. - /// - "PENDING" : Certificate is under active attempts to acquire or renew. - /// - "FAILED_RETRYING_NOT_VISIBLE" : Most recent renewal failed due to an - /// invalid DNS setup and will be retried. Renewal attempts will continue to - /// fail until the certificate domain's DNS configuration is fixed. The last - /// successfully provisioned certificate may still be serving. - /// - "FAILED_PERMANENT" : All renewal attempts have been exhausted, likely - /// due to an invalid DNS setup. - /// - "FAILED_RETRYING_CAA_FORBIDDEN" : Most recent renewal failed due to an - /// explicit CAA record that does not include one of the in-use CAs (Google CA - /// and Let's Encrypt). Renewals will continue to fail until the CAA is - /// reconfigured. The last successfully provisioned certificate may still be - /// serving. - /// - "FAILED_RETRYING_CAA_CHECKING" : Most recent renewal failed due to a CAA - /// retrieval failure. This means that the domain's DNS provider does not - /// properly handle CAA records, failing requests for CAA records when no CAA - /// records are defined. Renewals will continue to fail until the DNS provider - /// is changed or a CAA record is added for the given domain. The last - /// successfully provisioned certificate may still be serving. - core.String status; - - ManagedCertificate(); - - ManagedCertificate.fromJson(core.Map _json) { - if (_json.containsKey('lastRenewalTime')) { - lastRenewalTime = _json['lastRenewalTime'] as core.String; - } - if (_json.containsKey('status')) { - status = _json['status'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lastRenewalTime != null) { - _json['lastRenewalTime'] = lastRenewalTime; - } - if (status != null) { - _json['status'] = status; - } - return _json; - } -} - -/// A service with manual scaling runs continuously, allowing you to perform -/// complex initialization and rely on the state of its memory over time. -class ManualScaling { - /// Number of instances to assign to the service at the start. - /// - /// This number can later be altered by using the Modules API - /// (https://cloud.google.com/appengine/docs/python/modules/functions) - /// set_num_instances() function. - core.int instances; - - ManualScaling(); - - ManualScaling.fromJson(core.Map _json) { - if (_json.containsKey('instances')) { - instances = _json['instances'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (instances != null) { - _json['instances'] = instances; - } - return _json; - } -} - -/// Extra network settings. -/// -/// Only applicable in the App Engine flexible environment. -class Network { - /// List of ports, or port pairs, to forward from the virtual machine to the - /// application container. - /// - /// Only applicable in the App Engine flexible environment. - core.List<core.String> forwardedPorts; - - /// Tag to apply to the instance during creation. - /// - /// Only applicable in the App Engine flexible environment. - core.String instanceTag; - - /// Google Compute Engine network where the virtual machines are created. - /// - /// Specify the short name, not the resource path.Defaults to default. - core.String name; - - /// Enable session affinity. - /// - /// Only applicable in the App Engine flexible environment. - core.bool sessionAffinity; - - /// Google Cloud Platform sub-network where the virtual machines are created. - /// - /// Specify the short name, not the resource path.If a subnetwork name is - /// specified, a network name will also be required unless it is for the - /// default network. If the network that the instance is being created in is a - /// Legacy network, then the IP address is allocated from the IPv4Range. If - /// the network that the instance is being created in is an auto Subnet Mode - /// Network, then only network name should be specified (not the - /// subnetwork_name) and the IP address is created from the IPCidrRange of the - /// subnetwork that exists in that zone for that network. If the network that - /// the instance is being created in is a custom Subnet Mode Network, then the - /// subnetwork_name must be specified and the IP address is created from the - /// IPCidrRange of the subnetwork.If specified, the subnetwork must exist in - /// the same region as the App Engine flexible environment application. - core.String subnetworkName; - - Network(); - - Network.fromJson(core.Map _json) { - if (_json.containsKey('forwardedPorts')) { - forwardedPorts = (_json['forwardedPorts'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('instanceTag')) { - instanceTag = _json['instanceTag'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('sessionAffinity')) { - sessionAffinity = _json['sessionAffinity'] as core.bool; - } - if (_json.containsKey('subnetworkName')) { - subnetworkName = _json['subnetworkName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (forwardedPorts != null) { - _json['forwardedPorts'] = forwardedPorts; - } - if (instanceTag != null) { - _json['instanceTag'] = instanceTag; - } - if (name != null) { - _json['name'] = name; - } - if (sessionAffinity != null) { - _json['sessionAffinity'] = sessionAffinity; - } - if (subnetworkName != null) { - _json['subnetworkName'] = subnetworkName; - } - return _json; - } -} - -/// A NetworkSettings resource is a container for ingress settings for a version -/// or service. -class NetworkSettings { - /// The ingress settings for version or service. - /// Possible string values are: - /// - "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" : Unspecified - /// - "INGRESS_TRAFFIC_ALLOWED_ALL" : Allow HTTP traffic from public and - /// private sources. - /// - "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" : Allow HTTP traffic from only - /// private VPC sources. - /// - "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB" : Allow HTTP traffic from - /// private VPC sources and through load balancers. - core.String ingressTrafficAllowed; - - NetworkSettings(); - - NetworkSettings.fromJson(core.Map _json) { - if (_json.containsKey('ingressTrafficAllowed')) { - ingressTrafficAllowed = _json['ingressTrafficAllowed'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ingressTrafficAllowed != null) { - _json['ingressTrafficAllowed'] = ingressTrafficAllowed; - } - return _json; - } -} - -/// Target scaling by network usage. -/// -/// Only applicable in the App Engine flexible environment. -class NetworkUtilization { - /// Target bytes received per second. - core.int targetReceivedBytesPerSecond; - - /// Target packets received per second. - core.int targetReceivedPacketsPerSecond; - - /// Target bytes sent per second. - core.int targetSentBytesPerSecond; - - /// Target packets sent per second. - core.int targetSentPacketsPerSecond; - - NetworkUtilization(); - - NetworkUtilization.fromJson(core.Map _json) { - if (_json.containsKey('targetReceivedBytesPerSecond')) { - targetReceivedBytesPerSecond = - _json['targetReceivedBytesPerSecond'] as core.int; - } - if (_json.containsKey('targetReceivedPacketsPerSecond')) { - targetReceivedPacketsPerSecond = - _json['targetReceivedPacketsPerSecond'] as core.int; - } - if (_json.containsKey('targetSentBytesPerSecond')) { - targetSentBytesPerSecond = _json['targetSentBytesPerSecond'] as core.int; - } - if (_json.containsKey('targetSentPacketsPerSecond')) { - targetSentPacketsPerSecond = - _json['targetSentPacketsPerSecond'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (targetReceivedBytesPerSecond != null) { - _json['targetReceivedBytesPerSecond'] = targetReceivedBytesPerSecond; - } - if (targetReceivedPacketsPerSecond != null) { - _json['targetReceivedPacketsPerSecond'] = targetReceivedPacketsPerSecond; - } - if (targetSentBytesPerSecond != null) { - _json['targetSentBytesPerSecond'] = targetSentBytesPerSecond; - } - if (targetSentPacketsPerSecond != null) { - _json['targetSentPacketsPerSecond'] = targetSentPacketsPerSecond; - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is false, it means the operation is still in progress. - /// - /// If true, the operation is completed, and either error or response is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the name should be a resource name - /// ending with operations/{unique_id}. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as Delete, the - /// response is google.protobuf.Empty. If the original method is standard - /// Get/Create/Update, the response should be the resource. For other methods, - /// the response should have the type XxxResponse, where Xxx is the original - /// method name. For example, if the original method name is TakeSnapshot(), - /// the inferred response type is TakeSnapshotResponse. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation. -class OperationMetadataV1 { - CreateVersionMetadataV1 createVersionMetadata; - - /// Time that this operation completed.@OutputOnly - core.String endTime; - - /// Ephemeral message that may change every time the operation is polled. - /// - /// @OutputOnly - core.String ephemeralMessage; - - /// Time that this operation was created.@OutputOnly - core.String insertTime; - - /// API method that initiated this operation. - /// - /// Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly - core.String method; - - /// Name of the resource that this operation is acting on. - /// - /// Example: apps/myapp/services/default.@OutputOnly - core.String target; - - /// User who requested this operation.@OutputOnly - core.String user; - - /// Durable messages that persist on every operation poll. - /// - /// @OutputOnly - core.List<core.String> warning; - - OperationMetadataV1(); - - OperationMetadataV1.fromJson(core.Map _json) { - if (_json.containsKey('createVersionMetadata')) { - createVersionMetadata = CreateVersionMetadataV1.fromJson( - _json['createVersionMetadata'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('ephemeralMessage')) { - ephemeralMessage = _json['ephemeralMessage'] as core.String; - } - if (_json.containsKey('insertTime')) { - insertTime = _json['insertTime'] as core.String; - } - if (_json.containsKey('method')) { - method = _json['method'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('user')) { - user = _json['user'] as core.String; - } - if (_json.containsKey('warning')) { - warning = (_json['warning'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createVersionMetadata != null) { - _json['createVersionMetadata'] = createVersionMetadata.toJson(); - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (ephemeralMessage != null) { - _json['ephemeralMessage'] = ephemeralMessage; - } - if (insertTime != null) { - _json['insertTime'] = insertTime; - } - if (method != null) { - _json['method'] = method; - } - if (target != null) { - _json['target'] = target; - } - if (user != null) { - _json['user'] = user; - } - if (warning != null) { - _json['warning'] = warning; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation. -class OperationMetadataV1Alpha { - CreateVersionMetadataV1Alpha createVersionMetadata; - - /// Time that this operation completed.@OutputOnly - core.String endTime; - - /// Ephemeral message that may change every time the operation is polled. - /// - /// @OutputOnly - core.String ephemeralMessage; - - /// Time that this operation was created.@OutputOnly - core.String insertTime; - - /// API method that initiated this operation. - /// - /// Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - core.String method; - - /// Name of the resource that this operation is acting on. - /// - /// Example: apps/myapp/services/default.@OutputOnly - core.String target; - - /// User who requested this operation.@OutputOnly - core.String user; - - /// Durable messages that persist on every operation poll. - /// - /// @OutputOnly - core.List<core.String> warning; - - OperationMetadataV1Alpha(); - - OperationMetadataV1Alpha.fromJson(core.Map _json) { - if (_json.containsKey('createVersionMetadata')) { - createVersionMetadata = CreateVersionMetadataV1Alpha.fromJson( - _json['createVersionMetadata'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('ephemeralMessage')) { - ephemeralMessage = _json['ephemeralMessage'] as core.String; - } - if (_json.containsKey('insertTime')) { - insertTime = _json['insertTime'] as core.String; - } - if (_json.containsKey('method')) { - method = _json['method'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('user')) { - user = _json['user'] as core.String; - } - if (_json.containsKey('warning')) { - warning = (_json['warning'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createVersionMetadata != null) { - _json['createVersionMetadata'] = createVersionMetadata.toJson(); - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (ephemeralMessage != null) { - _json['ephemeralMessage'] = ephemeralMessage; - } - if (insertTime != null) { - _json['insertTime'] = insertTime; - } - if (method != null) { - _json['method'] = method; - } - if (target != null) { - _json['target'] = target; - } - if (user != null) { - _json['user'] = user; - } - if (warning != null) { - _json['warning'] = warning; - } - return _json; - } -} - -/// Metadata for the given google.longrunning.Operation. -class OperationMetadataV1Beta { - CreateVersionMetadataV1Beta createVersionMetadata; - - /// Time that this operation completed.@OutputOnly - core.String endTime; - - /// Ephemeral message that may change every time the operation is polled. - /// - /// @OutputOnly - core.String ephemeralMessage; - - /// Time that this operation was created.@OutputOnly - core.String insertTime; - - /// API method that initiated this operation. - /// - /// Example: google.appengine.v1beta.Versions.CreateVersion.@OutputOnly - core.String method; - - /// Name of the resource that this operation is acting on. - /// - /// Example: apps/myapp/services/default.@OutputOnly - core.String target; - - /// User who requested this operation.@OutputOnly - core.String user; - - /// Durable messages that persist on every operation poll. - /// - /// @OutputOnly - core.List<core.String> warning; - - OperationMetadataV1Beta(); - - OperationMetadataV1Beta.fromJson(core.Map _json) { - if (_json.containsKey('createVersionMetadata')) { - createVersionMetadata = CreateVersionMetadataV1Beta.fromJson( - _json['createVersionMetadata'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('ephemeralMessage')) { - ephemeralMessage = _json['ephemeralMessage'] as core.String; - } - if (_json.containsKey('insertTime')) { - insertTime = _json['insertTime'] as core.String; - } - if (_json.containsKey('method')) { - method = _json['method'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('user')) { - user = _json['user'] as core.String; - } - if (_json.containsKey('warning')) { - warning = (_json['warning'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createVersionMetadata != null) { - _json['createVersionMetadata'] = createVersionMetadata.toJson(); - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (ephemeralMessage != null) { - _json['ephemeralMessage'] = ephemeralMessage; - } - if (insertTime != null) { - _json['insertTime'] = insertTime; - } - if (method != null) { - _json['method'] = method; - } - if (target != null) { - _json['target'] = target; - } - if (user != null) { - _json['user'] = user; - } - if (warning != null) { - _json['warning'] = warning; - } - return _json; - } -} - -/// Readiness checking configuration for VM instances. -/// -/// Unhealthy instances are removed from traffic rotation. -class ReadinessCheck { - /// A maximum time limit on application initialization, measured from moment - /// the application successfully replies to a healthcheck until it is ready to - /// serve traffic. - core.String appStartTimeout; - - /// Interval between health checks. - core.String checkInterval; - - /// Number of consecutive failed checks required before removing traffic. - core.int failureThreshold; - - /// Host header to send when performing a HTTP Readiness check. - /// - /// Example: "myapp.appspot.com" - core.String host; - - /// The request path. - core.String path; - - /// Number of consecutive successful checks required before receiving traffic. - core.int successThreshold; - - /// Time before the check is considered failed. - core.String timeout; - - ReadinessCheck(); - - ReadinessCheck.fromJson(core.Map _json) { - if (_json.containsKey('appStartTimeout')) { - appStartTimeout = _json['appStartTimeout'] as core.String; - } - if (_json.containsKey('checkInterval')) { - checkInterval = _json['checkInterval'] as core.String; - } - if (_json.containsKey('failureThreshold')) { - failureThreshold = _json['failureThreshold'] as core.int; - } - if (_json.containsKey('host')) { - host = _json['host'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('successThreshold')) { - successThreshold = _json['successThreshold'] as core.int; - } - if (_json.containsKey('timeout')) { - timeout = _json['timeout'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (appStartTimeout != null) { - _json['appStartTimeout'] = appStartTimeout; - } - if (checkInterval != null) { - _json['checkInterval'] = checkInterval; - } - if (failureThreshold != null) { - _json['failureThreshold'] = failureThreshold; - } - if (host != null) { - _json['host'] = host; - } - if (path != null) { - _json['path'] = path; - } - if (successThreshold != null) { - _json['successThreshold'] = successThreshold; - } - if (timeout != null) { - _json['timeout'] = timeout; - } - return _json; - } -} - -/// Request message for 'Applications.RepairApplication'. -class RepairApplicationRequest { - RepairApplicationRequest(); - - RepairApplicationRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Target scaling by request utilization. -/// -/// Only applicable in the App Engine flexible environment. -class RequestUtilization { - /// Target number of concurrent requests. - core.int targetConcurrentRequests; - - /// Target requests per second. - core.int targetRequestCountPerSecond; - - RequestUtilization(); - - RequestUtilization.fromJson(core.Map _json) { - if (_json.containsKey('targetConcurrentRequests')) { - targetConcurrentRequests = _json['targetConcurrentRequests'] as core.int; - } - if (_json.containsKey('targetRequestCountPerSecond')) { - targetRequestCountPerSecond = - _json['targetRequestCountPerSecond'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (targetConcurrentRequests != null) { - _json['targetConcurrentRequests'] = targetConcurrentRequests; - } - if (targetRequestCountPerSecond != null) { - _json['targetRequestCountPerSecond'] = targetRequestCountPerSecond; - } - return _json; - } -} - -/// A DNS resource record. -class ResourceRecord { - /// Relative name of the object affected by this record. - /// - /// Only applicable for CNAME records. Example: 'www'. - core.String name; - - /// Data for this record. - /// - /// Values vary by record type, as defined in RFC 1035 (section 5) and RFC - /// 1034 (section 3.6.1). - core.String rrdata; - - /// Resource record type. - /// - /// Example: AAAA. - /// Possible string values are: - /// - "A" : An A resource record. Data is an IPv4 address. - /// - "AAAA" : An AAAA resource record. Data is an IPv6 address. - /// - "CNAME" : A CNAME resource record. Data is a domain name to be aliased. - core.String type; - - ResourceRecord(); - - ResourceRecord.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('rrdata')) { - rrdata = _json['rrdata'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (rrdata != null) { - _json['rrdata'] = rrdata; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Machine resources for a version. -class Resources { - /// Number of CPU cores needed. - core.double cpu; - - /// Disk size (GB) needed. - core.double diskGb; - - /// The name of the encryption key that is stored in Google Cloud KMS. - /// - /// Only should be used by Cloud Composer to encrypt the vm disk - core.String kmsKeyReference; - - /// Memory (GB) needed. - core.double memoryGb; - - /// User specified volumes. - core.List<Volume> volumes; - - Resources(); - - Resources.fromJson(core.Map _json) { - if (_json.containsKey('cpu')) { - cpu = (_json['cpu'] as core.num).toDouble(); - } - if (_json.containsKey('diskGb')) { - diskGb = (_json['diskGb'] as core.num).toDouble(); - } - if (_json.containsKey('kmsKeyReference')) { - kmsKeyReference = _json['kmsKeyReference'] as core.String; - } - if (_json.containsKey('memoryGb')) { - memoryGb = (_json['memoryGb'] as core.num).toDouble(); - } - if (_json.containsKey('volumes')) { - volumes = (_json['volumes'] as core.List) - .map<Volume>((value) => - Volume.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cpu != null) { - _json['cpu'] = cpu; - } - if (diskGb != null) { - _json['diskGb'] = diskGb; - } - if (kmsKeyReference != null) { - _json['kmsKeyReference'] = kmsKeyReference; - } - if (memoryGb != null) { - _json['memoryGb'] = memoryGb; - } - if (volumes != null) { - _json['volumes'] = volumes.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Executes a script to handle the request that matches the URL pattern. -class ScriptHandler { - /// Path to the script from the application root directory. - core.String scriptPath; - - ScriptHandler(); - - ScriptHandler.fromJson(core.Map _json) { - if (_json.containsKey('scriptPath')) { - scriptPath = _json['scriptPath'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (scriptPath != null) { - _json['scriptPath'] = scriptPath; - } - return _json; - } -} - -/// A Service resource is a logical component of an application that can share -/// state and communicate in a secure fashion with other services. -/// -/// For example, an application that handles customer requests might include -/// separate services to handle tasks such as backend data analysis or API -/// requests from mobile devices. Each service has a collection of versions that -/// define a specific set of code used to implement the functionality of that -/// service. -class Service { - /// Relative name of the service within the application. - /// - /// Example: default.@OutputOnly - core.String id; - - /// Full path to the Service resource in the API. - /// - /// Example: apps/myapp/services/default.@OutputOnly - core.String name; - - /// Ingress settings for this service. - /// - /// Will apply to all versions. - NetworkSettings networkSettings; - - /// Mapping that defines fractional HTTP traffic diversion to different - /// versions within the service. - TrafficSplit split; - - Service(); - - Service.fromJson(core.Map _json) { - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('networkSettings')) { - networkSettings = NetworkSettings.fromJson( - _json['networkSettings'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('split')) { - split = TrafficSplit.fromJson( - _json['split'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (id != null) { - _json['id'] = id; - } - if (name != null) { - _json['name'] = name; - } - if (networkSettings != null) { - _json['networkSettings'] = networkSettings.toJson(); - } - if (split != null) { - _json['split'] = split.toJson(); - } - return _json; - } -} - -/// SSL configuration for a DomainMapping resource. -class SslSettings { - /// ID of the AuthorizedCertificate resource configuring SSL for the - /// application. - /// - /// Clearing this field will remove SSL support.By default, a managed - /// certificate is automatically created for every domain mapping. To omit SSL - /// support or to configure SSL manually, specify SslManagementType.MANUAL on - /// a CREATE or UPDATE request. You must be authorized to administer the - /// AuthorizedCertificate resource to manually map it to a DomainMapping - /// resource. Example: 12345. - core.String certificateId; - - /// ID of the managed AuthorizedCertificate resource currently being - /// provisioned, if applicable. - /// - /// Until the new managed certificate has been successfully provisioned, the - /// previous SSL state will be preserved. Once the provisioning process - /// completes, the certificate_id field will reflect the new managed - /// certificate and this field will be left empty. To remove SSL support while - /// there is still a pending managed certificate, clear the certificate_id - /// field with an UpdateDomainMappingRequest.@OutputOnly - core.String pendingManagedCertificateId; - - /// SSL management type for this domain. - /// - /// If AUTOMATIC, a managed certificate is automatically provisioned. If - /// MANUAL, certificate_id must be manually specified in order to configure - /// SSL for this domain. - /// Possible string values are: - /// - "AUTOMATIC" : SSL support for this domain is configured automatically. - /// The mapped SSL certificate will be automatically renewed. - /// - "MANUAL" : SSL support for this domain is configured manually by the - /// user. Either the domain has no SSL support or a user-obtained SSL - /// certificate has been explictly mapped to this domain. - core.String sslManagementType; - - SslSettings(); - - SslSettings.fromJson(core.Map _json) { - if (_json.containsKey('certificateId')) { - certificateId = _json['certificateId'] as core.String; - } - if (_json.containsKey('pendingManagedCertificateId')) { - pendingManagedCertificateId = - _json['pendingManagedCertificateId'] as core.String; - } - if (_json.containsKey('sslManagementType')) { - sslManagementType = _json['sslManagementType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (certificateId != null) { - _json['certificateId'] = certificateId; - } - if (pendingManagedCertificateId != null) { - _json['pendingManagedCertificateId'] = pendingManagedCertificateId; - } - if (sslManagementType != null) { - _json['sslManagementType'] = sslManagementType; - } - return _json; - } -} - -/// Scheduler settings for standard environment. -class StandardSchedulerSettings { - /// Maximum number of instances to run for this version. - /// - /// Set to zero to disable max_instances configuration. - core.int maxInstances; - - /// Minimum number of instances to run for this version. - /// - /// Set to zero to disable min_instances configuration. - core.int minInstances; - - /// Target CPU utilization ratio to maintain when scaling. - core.double targetCpuUtilization; - - /// Target throughput utilization ratio to maintain when scaling - core.double targetThroughputUtilization; - - StandardSchedulerSettings(); - - StandardSchedulerSettings.fromJson(core.Map _json) { - if (_json.containsKey('maxInstances')) { - maxInstances = _json['maxInstances'] as core.int; - } - if (_json.containsKey('minInstances')) { - minInstances = _json['minInstances'] as core.int; - } - if (_json.containsKey('targetCpuUtilization')) { - targetCpuUtilization = - (_json['targetCpuUtilization'] as core.num).toDouble(); - } - if (_json.containsKey('targetThroughputUtilization')) { - targetThroughputUtilization = - (_json['targetThroughputUtilization'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (maxInstances != null) { - _json['maxInstances'] = maxInstances; - } - if (minInstances != null) { - _json['minInstances'] = minInstances; - } - if (targetCpuUtilization != null) { - _json['targetCpuUtilization'] = targetCpuUtilization; - } - if (targetThroughputUtilization != null) { - _json['targetThroughputUtilization'] = targetThroughputUtilization; - } - return _json; - } -} - -/// Files served directly to the user for a given URL, such as images, CSS -/// stylesheets, or JavaScript source files. -/// -/// Static file handlers describe which files in the application directory are -/// static files, and which URLs serve them. -class StaticFilesHandler { - /// Whether files should also be uploaded as code data. - /// - /// By default, files declared in static file handlers are uploaded as static - /// data and are only served to end users; they cannot be read by the - /// application. If enabled, uploads are charged against both your code and - /// static data storage resource quotas. - core.bool applicationReadable; - - /// Time a static file served by this handler should be cached by web proxies - /// and browsers. - core.String expiration; - - /// HTTP headers to use for all responses from these URLs. - core.Map<core.String, core.String> httpHeaders; - - /// MIME type used to serve all files served by this handler.Defaults to - /// file-specific MIME types, which are derived from each file's filename - /// extension. - core.String mimeType; - - /// Path to the static files matched by the URL pattern, from the application - /// root directory. - /// - /// The path can refer to text matched in groupings in the URL pattern. - core.String path; - - /// Whether this handler should match the request if the file referenced by - /// the handler does not exist. - core.bool requireMatchingFile; - - /// Regular expression that matches the file paths for all files that should - /// be referenced by this handler. - core.String uploadPathRegex; - - StaticFilesHandler(); - - StaticFilesHandler.fromJson(core.Map _json) { - if (_json.containsKey('applicationReadable')) { - applicationReadable = _json['applicationReadable'] as core.bool; - } - if (_json.containsKey('expiration')) { - expiration = _json['expiration'] as core.String; - } - if (_json.containsKey('httpHeaders')) { - httpHeaders = (_json['httpHeaders'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('mimeType')) { - mimeType = _json['mimeType'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('requireMatchingFile')) { - requireMatchingFile = _json['requireMatchingFile'] as core.bool; - } - if (_json.containsKey('uploadPathRegex')) { - uploadPathRegex = _json['uploadPathRegex'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (applicationReadable != null) { - _json['applicationReadable'] = applicationReadable; - } - if (expiration != null) { - _json['expiration'] = expiration; - } - if (httpHeaders != null) { - _json['httpHeaders'] = httpHeaders; - } - if (mimeType != null) { - _json['mimeType'] = mimeType; - } - if (path != null) { - _json['path'] = path; - } - if (requireMatchingFile != null) { - _json['requireMatchingFile'] = requireMatchingFile; - } - if (uploadPathRegex != null) { - _json['uploadPathRegex'] = uploadPathRegex; - } - return _json; - } -} - -/// The Status type defines a logical error model that is suitable for different -/// programming environments, including REST APIs and RPC APIs. -/// -/// It is used by gRPC (https://github.com/grpc). Each Status message contains -/// three pieces of data: error code, error message, and error details.You can -/// find out more about this error model and how to work with it in the API -/// Design Guide (https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Traffic routing configuration for versions within a single service. -/// -/// Traffic splits define how traffic directed to the service is assigned to -/// versions. -class TrafficSplit { - /// Mapping from version IDs within the service to fractional (0.000, 1\] - /// allocations of traffic for that version. - /// - /// Each version can be specified only once, but some versions in the service - /// may not have any traffic allocation. Services that have traffic allocated - /// cannot be deleted until either the service is deleted or their traffic - /// allocation is removed. Allocations must sum to 1. Up to two decimal place - /// precision is supported for IP-based splits and up to three decimal places - /// is supported for cookie-based splits. - core.Map<core.String, core.double> allocations; - - /// Mechanism used to determine which version a request is sent to. - /// - /// The traffic selection algorithm will be stable for either type until - /// allocations are changed. - /// Possible string values are: - /// - "UNSPECIFIED" : Diversion method unspecified. - /// - "COOKIE" : Diversion based on a specially named cookie, "GOOGAPPUID." - /// The cookie must be set by the application itself or no diversion will - /// occur. - /// - "IP" : Diversion based on applying the modulus operation to a - /// fingerprint of the IP address. - /// - "RANDOM" : Diversion based on weighted random assignment. An incoming - /// request is randomly routed to a version in the traffic split, with - /// probability proportional to the version's traffic share. - core.String shardBy; - - TrafficSplit(); - - TrafficSplit.fromJson(core.Map _json) { - if (_json.containsKey('allocations')) { - allocations = - (_json['allocations'] as core.Map).cast<core.String, core.num>().map( - (key, item) => core.MapEntry( - key, - (item as core.num).toDouble(), - ), - ); - } - if (_json.containsKey('shardBy')) { - shardBy = _json['shardBy'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allocations != null) { - _json['allocations'] = allocations; - } - if (shardBy != null) { - _json['shardBy'] = shardBy; - } - return _json; - } -} - -/// Rules to match an HTTP request and dispatch that request to a service. -class UrlDispatchRule { - /// Domain name to match against. - /// - /// The wildcard "*" is supported if specified before a period: "*.".Defaults - /// to matching all domains: "*". - core.String domain; - - /// Pathname within the host. - /// - /// Must start with a "/". A single "*" can be included at the end of the - /// path.The sum of the lengths of the domain and path may not exceed 100 - /// characters. - core.String path; - - /// Resource ID of a service in this application that should serve the matched - /// request. - /// - /// The service must already exist. Example: default. - core.String service; - - UrlDispatchRule(); - - UrlDispatchRule.fromJson(core.Map _json) { - if (_json.containsKey('domain')) { - domain = _json['domain'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('service')) { - service = _json['service'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domain != null) { - _json['domain'] = domain; - } - if (path != null) { - _json['path'] = path; - } - if (service != null) { - _json['service'] = service; - } - return _json; - } -} - -/// URL pattern and description of how the URL should be handled. -/// -/// App Engine can handle URLs by executing application code or by serving -/// static files uploaded with the version, such as images, CSS, or JavaScript. -class UrlMap { - /// Uses API Endpoints to handle requests. - ApiEndpointHandler apiEndpoint; - - /// Action to take when users access resources that require authentication. - /// - /// Defaults to redirect. - /// Possible string values are: - /// - "AUTH_FAIL_ACTION_UNSPECIFIED" : Not specified. - /// AUTH_FAIL_ACTION_REDIRECT is assumed. - /// - "AUTH_FAIL_ACTION_REDIRECT" : Redirects user to "accounts.google.com". - /// The user is redirected back to the application URL after signing in or - /// creating an account. - /// - "AUTH_FAIL_ACTION_UNAUTHORIZED" : Rejects request with a 401 HTTP status - /// code and an error message. - core.String authFailAction; - - /// Level of login required to access this resource. - /// - /// Not supported for Node.js in the App Engine standard environment. - /// Possible string values are: - /// - "LOGIN_UNSPECIFIED" : Not specified. LOGIN_OPTIONAL is assumed. - /// - "LOGIN_OPTIONAL" : Does not require that the user is signed in. - /// - "LOGIN_ADMIN" : If the user is not signed in, the auth_fail_action is - /// taken. In addition, if the user is not an administrator for the - /// application, they are given an error message regardless of - /// auth_fail_action. If the user is an administrator, the handler proceeds. - /// - "LOGIN_REQUIRED" : If the user has signed in, the handler proceeds - /// normally. Otherwise, the auth_fail_action is taken. - core.String login; - - /// 30x code to use when performing redirects for the secure field. - /// - /// Defaults to 302. - /// Possible string values are: - /// - "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" : Not specified. 302 is - /// assumed. - /// - "REDIRECT_HTTP_RESPONSE_CODE_301" : 301 Moved Permanently code. - /// - "REDIRECT_HTTP_RESPONSE_CODE_302" : 302 Moved Temporarily code. - /// - "REDIRECT_HTTP_RESPONSE_CODE_303" : 303 See Other code. - /// - "REDIRECT_HTTP_RESPONSE_CODE_307" : 307 Temporary Redirect code. - core.String redirectHttpResponseCode; - - /// Executes a script to handle the requests that match this URL pattern. - /// - /// Only the auto value is supported for Node.js in the App Engine standard - /// environment, for example "script": "auto". - ScriptHandler script; - - /// Security (HTTPS) enforcement for this URL. - /// Possible string values are: - /// - "SECURE_UNSPECIFIED" : Not specified. - /// - "SECURE_DEFAULT" : Both HTTP and HTTPS requests with URLs that match the - /// handler succeed without redirects. The application can examine the request - /// to determine which protocol was used, and respond accordingly. - /// - "SECURE_NEVER" : Requests for a URL that match this handler that use - /// HTTPS are automatically redirected to the HTTP equivalent URL. - /// - "SECURE_OPTIONAL" : Both HTTP and HTTPS requests with URLs that match - /// the handler succeed without redirects. The application can examine the - /// request to determine which protocol was used and respond accordingly. - /// - "SECURE_ALWAYS" : Requests for a URL that match this handler that do not - /// use HTTPS are automatically redirected to the HTTPS URL with the same - /// path. Query parameters are reserved for the redirect. - core.String securityLevel; - - /// Returns the contents of a file, such as an image, as the response. - StaticFilesHandler staticFiles; - - /// URL prefix. - /// - /// Uses regular expression syntax, which means regexp special characters must - /// be escaped, but should not contain groupings. All URLs that begin with - /// this prefix are handled by this handler, using the portion of the URL - /// after the prefix as part of the file path. - core.String urlRegex; - - UrlMap(); - - UrlMap.fromJson(core.Map _json) { - if (_json.containsKey('apiEndpoint')) { - apiEndpoint = ApiEndpointHandler.fromJson( - _json['apiEndpoint'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('authFailAction')) { - authFailAction = _json['authFailAction'] as core.String; - } - if (_json.containsKey('login')) { - login = _json['login'] as core.String; - } - if (_json.containsKey('redirectHttpResponseCode')) { - redirectHttpResponseCode = - _json['redirectHttpResponseCode'] as core.String; - } - if (_json.containsKey('script')) { - script = ScriptHandler.fromJson( - _json['script'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('securityLevel')) { - securityLevel = _json['securityLevel'] as core.String; - } - if (_json.containsKey('staticFiles')) { - staticFiles = StaticFilesHandler.fromJson( - _json['staticFiles'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('urlRegex')) { - urlRegex = _json['urlRegex'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiEndpoint != null) { - _json['apiEndpoint'] = apiEndpoint.toJson(); - } - if (authFailAction != null) { - _json['authFailAction'] = authFailAction; - } - if (login != null) { - _json['login'] = login; - } - if (redirectHttpResponseCode != null) { - _json['redirectHttpResponseCode'] = redirectHttpResponseCode; - } - if (script != null) { - _json['script'] = script.toJson(); - } - if (securityLevel != null) { - _json['securityLevel'] = securityLevel; - } - if (staticFiles != null) { - _json['staticFiles'] = staticFiles.toJson(); - } - if (urlRegex != null) { - _json['urlRegex'] = urlRegex; - } - return _json; - } -} - -/// A Version resource is a specific set of source code and configuration files -/// that are deployed into a service. -class Version { - /// Serving configuration for Google Cloud Endpoints - /// (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned - /// in GET requests if view=FULL is set. - ApiConfigHandler apiConfig; - - /// Automatic scaling is based on request rate, response latencies, and other - /// application metrics. - /// - /// Instances are dynamically created and destroyed as needed in order to - /// handle traffic. - AutomaticScaling automaticScaling; - - /// A service with basic scaling will create an instance when the application - /// receives a request. - /// - /// The instance will be turned down when the app becomes idle. Basic scaling - /// is ideal for work that is intermittent or driven by user activity. - BasicScaling basicScaling; - - /// Metadata settings that are supplied to this version to enable beta runtime - /// features. - core.Map<core.String, core.String> betaSettings; - - /// Environment variables available to the build environment.Only returned in - /// GET requests if view=FULL is set. - core.Map<core.String, core.String> buildEnvVariables; - - /// Time that this version was created.@OutputOnly - core.String createTime; - - /// Email address of the user who created this version.@OutputOnly - core.String createdBy; - - /// Duration that static files should be cached by web proxies and browsers. - /// - /// Only applicable if the corresponding StaticFilesHandler - /// (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StaticFilesHandler) - /// does not specify its own expiration time.Only returned in GET requests if - /// view=FULL is set. - core.String defaultExpiration; - - /// Code and application artifacts that make up this version.Only returned in - /// GET requests if view=FULL is set. - Deployment deployment; - - /// Total size in bytes of all the files that are included in this version and - /// currently hosted on the App Engine disk.@OutputOnly - core.String diskUsageBytes; - - /// Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud - /// Endpoints Extensible Service Proxy will be provided to serve the API - /// implemented by the app. - EndpointsApiService endpointsApiService; - - /// The entrypoint for the application. - Entrypoint entrypoint; - - /// App Engine execution environment for this version.Defaults to standard. - core.String env; - - /// Environment variables available to the application.Only returned in GET - /// requests if view=FULL is set. - core.Map<core.String, core.String> envVariables; - - /// Custom static error pages. - /// - /// Limited to 10KB per page.Only returned in GET requests if view=FULL is - /// set. - core.List<ErrorHandler> errorHandlers; - - /// An ordered list of URL-matching patterns that should be applied to - /// incoming requests. - /// - /// The first matching URL handles the request and other request handlers are - /// not attempted.Only returned in GET requests if view=FULL is set. - core.List<UrlMap> handlers; - - /// Configures health checking for instances. - /// - /// Unhealthy instances are stopped and replaced with new instances. Only - /// applicable in the App Engine flexible environment.Only returned in GET - /// requests if view=FULL is set. - HealthCheck healthCheck; - - /// Relative name of the version within the service. - /// - /// Example: v1. Version names can contain only lowercase letters, numbers, or - /// hyphens. Reserved names: "default", "latest", and any name with the prefix - /// "ah-". - core.String id; - - /// Before an application can receive email or XMPP messages, the application - /// must be configured to enable the service. - core.List<core.String> inboundServices; - - /// Instance class that is used to run this version. - /// - /// Valid values are: AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or - /// BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and - /// B1 for ManualScaling or BasicScaling. - core.String instanceClass; - - /// Configuration for third-party Python runtime libraries that are required - /// by the application.Only returned in GET requests if view=FULL is set. - core.List<Library> libraries; - - /// Configures liveness health checking for instances. - /// - /// Unhealthy instances are stopped and replaced with new instancesOnly - /// returned in GET requests if view=FULL is set. - LivenessCheck livenessCheck; - - /// A service with manual scaling runs continuously, allowing you to perform - /// complex initialization and rely on the state of its memory over time. - /// - /// Manually scaled versions are sometimes referred to as "backends". - ManualScaling manualScaling; - - /// Full path to the Version resource in the API. - /// - /// Example: apps/myapp/services/default/versions/v1.@OutputOnly - core.String name; - - /// Extra network settings. - /// - /// Only applicable in the App Engine flexible environment. - Network network; - - /// Files that match this pattern will not be built into this version. - /// - /// Only applicable for Go runtimes.Only returned in GET requests if view=FULL - /// is set. - core.String nobuildFilesRegex; - - /// Configures readiness health checking for instances. - /// - /// Unhealthy instances are not put into the backend traffic rotation.Only - /// returned in GET requests if view=FULL is set. - ReadinessCheck readinessCheck; - - /// Machine resources for this version. - /// - /// Only applicable in the App Engine flexible environment. - Resources resources; - - /// Desired runtime. - /// - /// Example: python27. - core.String runtime; - - /// The version of the API in the given runtime environment. - /// - /// Please see the app.yaml reference for valid values at - /// https://cloud.google.com/appengine/docs/standard//config/appref - core.String runtimeApiVersion; - - /// The channel of the runtime to use. - /// - /// Only available for some runtimes. Defaults to the default channel. - core.String runtimeChannel; - - /// The path or name of the app's main executable. - core.String runtimeMainExecutablePath; - - /// Current serving status of this version. - /// - /// Only the versions with a SERVING status create instances and can be - /// billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to - /// SERVING. - /// Possible string values are: - /// - "SERVING_STATUS_UNSPECIFIED" : Not specified. - /// - "SERVING" : Currently serving. Instances are created according to the - /// scaling settings of the version. - /// - "STOPPED" : Disabled. No instances will be created and the scaling - /// settings are ignored until the state of the version changes to SERVING. - core.String servingStatus; - - /// Whether multiple requests can be dispatched to this version at once. - core.bool threadsafe; - - /// Serving URL for this version. - /// - /// Example: - /// "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly - core.String versionUrl; - - /// Whether to deploy this version in a container on a virtual machine. - core.bool vm; - - /// Enables VPC connectivity for standard apps. - VpcAccessConnector vpcAccessConnector; - - /// The Google Compute Engine zones that are supported by this version in the - /// App Engine flexible environment. - /// - /// Deprecated. - core.List<core.String> zones; - - Version(); - - Version.fromJson(core.Map _json) { - if (_json.containsKey('apiConfig')) { - apiConfig = ApiConfigHandler.fromJson( - _json['apiConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('automaticScaling')) { - automaticScaling = AutomaticScaling.fromJson( - _json['automaticScaling'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('basicScaling')) { - basicScaling = BasicScaling.fromJson( - _json['basicScaling'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('betaSettings')) { - betaSettings = (_json['betaSettings'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('buildEnvVariables')) { - buildEnvVariables = (_json['buildEnvVariables'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('createdBy')) { - createdBy = _json['createdBy'] as core.String; - } - if (_json.containsKey('defaultExpiration')) { - defaultExpiration = _json['defaultExpiration'] as core.String; - } - if (_json.containsKey('deployment')) { - deployment = Deployment.fromJson( - _json['deployment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('diskUsageBytes')) { - diskUsageBytes = _json['diskUsageBytes'] as core.String; - } - if (_json.containsKey('endpointsApiService')) { - endpointsApiService = EndpointsApiService.fromJson( - _json['endpointsApiService'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('entrypoint')) { - entrypoint = Entrypoint.fromJson( - _json['entrypoint'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('env')) { - env = _json['env'] as core.String; - } - if (_json.containsKey('envVariables')) { - envVariables = (_json['envVariables'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('errorHandlers')) { - errorHandlers = (_json['errorHandlers'] as core.List) - .map<ErrorHandler>((value) => ErrorHandler.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('handlers')) { - handlers = (_json['handlers'] as core.List) - .map<UrlMap>((value) => - UrlMap.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('healthCheck')) { - healthCheck = HealthCheck.fromJson( - _json['healthCheck'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('inboundServices')) { - inboundServices = (_json['inboundServices'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('instanceClass')) { - instanceClass = _json['instanceClass'] as core.String; - } - if (_json.containsKey('libraries')) { - libraries = (_json['libraries'] as core.List) - .map<Library>((value) => - Library.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('livenessCheck')) { - livenessCheck = LivenessCheck.fromJson( - _json['livenessCheck'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('manualScaling')) { - manualScaling = ManualScaling.fromJson( - _json['manualScaling'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('network')) { - network = Network.fromJson( - _json['network'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('nobuildFilesRegex')) { - nobuildFilesRegex = _json['nobuildFilesRegex'] as core.String; - } - if (_json.containsKey('readinessCheck')) { - readinessCheck = ReadinessCheck.fromJson( - _json['readinessCheck'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('resources')) { - resources = Resources.fromJson( - _json['resources'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('runtime')) { - runtime = _json['runtime'] as core.String; - } - if (_json.containsKey('runtimeApiVersion')) { - runtimeApiVersion = _json['runtimeApiVersion'] as core.String; - } - if (_json.containsKey('runtimeChannel')) { - runtimeChannel = _json['runtimeChannel'] as core.String; - } - if (_json.containsKey('runtimeMainExecutablePath')) { - runtimeMainExecutablePath = - _json['runtimeMainExecutablePath'] as core.String; - } - if (_json.containsKey('servingStatus')) { - servingStatus = _json['servingStatus'] as core.String; - } - if (_json.containsKey('threadsafe')) { - threadsafe = _json['threadsafe'] as core.bool; - } - if (_json.containsKey('versionUrl')) { - versionUrl = _json['versionUrl'] as core.String; - } - if (_json.containsKey('vm')) { - vm = _json['vm'] as core.bool; - } - if (_json.containsKey('vpcAccessConnector')) { - vpcAccessConnector = VpcAccessConnector.fromJson( - _json['vpcAccessConnector'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('zones')) { - zones = (_json['zones'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiConfig != null) { - _json['apiConfig'] = apiConfig.toJson(); - } - if (automaticScaling != null) { - _json['automaticScaling'] = automaticScaling.toJson(); - } - if (basicScaling != null) { - _json['basicScaling'] = basicScaling.toJson(); - } - if (betaSettings != null) { - _json['betaSettings'] = betaSettings; - } - if (buildEnvVariables != null) { - _json['buildEnvVariables'] = buildEnvVariables; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (createdBy != null) { - _json['createdBy'] = createdBy; - } - if (defaultExpiration != null) { - _json['defaultExpiration'] = defaultExpiration; - } - if (deployment != null) { - _json['deployment'] = deployment.toJson(); - } - if (diskUsageBytes != null) { - _json['diskUsageBytes'] = diskUsageBytes; - } - if (endpointsApiService != null) { - _json['endpointsApiService'] = endpointsApiService.toJson(); - } - if (entrypoint != null) { - _json['entrypoint'] = entrypoint.toJson(); - } - if (env != null) { - _json['env'] = env; - } - if (envVariables != null) { - _json['envVariables'] = envVariables; - } - if (errorHandlers != null) { - _json['errorHandlers'] = - errorHandlers.map((value) => value.toJson()).toList(); - } - if (handlers != null) { - _json['handlers'] = handlers.map((value) => value.toJson()).toList(); - } - if (healthCheck != null) { - _json['healthCheck'] = healthCheck.toJson(); - } - if (id != null) { - _json['id'] = id; - } - if (inboundServices != null) { - _json['inboundServices'] = inboundServices; - } - if (instanceClass != null) { - _json['instanceClass'] = instanceClass; - } - if (libraries != null) { - _json['libraries'] = libraries.map((value) => value.toJson()).toList(); - } - if (livenessCheck != null) { - _json['livenessCheck'] = livenessCheck.toJson(); - } - if (manualScaling != null) { - _json['manualScaling'] = manualScaling.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (network != null) { - _json['network'] = network.toJson(); - } - if (nobuildFilesRegex != null) { - _json['nobuildFilesRegex'] = nobuildFilesRegex; - } - if (readinessCheck != null) { - _json['readinessCheck'] = readinessCheck.toJson(); - } - if (resources != null) { - _json['resources'] = resources.toJson(); - } - if (runtime != null) { - _json['runtime'] = runtime; - } - if (runtimeApiVersion != null) { - _json['runtimeApiVersion'] = runtimeApiVersion; - } - if (runtimeChannel != null) { - _json['runtimeChannel'] = runtimeChannel; - } - if (runtimeMainExecutablePath != null) { - _json['runtimeMainExecutablePath'] = runtimeMainExecutablePath; - } - if (servingStatus != null) { - _json['servingStatus'] = servingStatus; - } - if (threadsafe != null) { - _json['threadsafe'] = threadsafe; - } - if (versionUrl != null) { - _json['versionUrl'] = versionUrl; - } - if (vm != null) { - _json['vm'] = vm; - } - if (vpcAccessConnector != null) { - _json['vpcAccessConnector'] = vpcAccessConnector.toJson(); - } - if (zones != null) { - _json['zones'] = zones; - } - return _json; - } -} - -/// Volumes mounted within the app container. -/// -/// Only applicable in the App Engine flexible environment. -class Volume { - /// Unique name for the volume. - core.String name; - - /// Volume size in gigabytes. - core.double sizeGb; - - /// Underlying volume type, e.g. 'tmpfs'. - core.String volumeType; - - Volume(); - - Volume.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('sizeGb')) { - sizeGb = (_json['sizeGb'] as core.num).toDouble(); - } - if (_json.containsKey('volumeType')) { - volumeType = _json['volumeType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (sizeGb != null) { - _json['sizeGb'] = sizeGb; - } - if (volumeType != null) { - _json['volumeType'] = volumeType; - } - return _json; - } -} - -/// VPC access connector specification. -class VpcAccessConnector { - /// Full Serverless VPC Access Connector name e.g. - /// /projects/my-project/locations/us-central1/connectors/c1. - core.String name; - - VpcAccessConnector(); - - VpcAccessConnector.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The zip file information for a zip deployment. -class ZipInfo { - /// An estimate of the number of files in a zip for a zip deployment. - /// - /// If set, must be greater than or equal to the actual number of files. Used - /// for optimizing performance; if not provided, deployment may be slow. - core.int filesCount; - - /// URL of the zip file to deploy from. - /// - /// Must be a URL to a resource in Google Cloud Storage in the form - /// 'http(s)://storage.googleapis.com//'. - core.String sourceUrl; - - ZipInfo(); - - ZipInfo.fromJson(core.Map _json) { - if (_json.containsKey('filesCount')) { - filesCount = _json['filesCount'] as core.int; - } - if (_json.containsKey('sourceUrl')) { - sourceUrl = _json['sourceUrl'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (filesCount != null) { - _json['filesCount'] = filesCount; - } - if (sourceUrl != null) { - _json['sourceUrl'] = sourceUrl; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/area120tables/v1alpha1.dart b/generated/googleapis_beta/lib/area120tables/v1alpha1.dart new file mode 100644 index 0000000..f86a0fb --- /dev/null +++ b/generated/googleapis_beta/lib/area120tables/v1alpha1.dart
@@ -0,0 +1,1543 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Area120 Tables API - v1alpha1 +/// +/// For more information, see +/// <https://support.google.com/area120-tables/answer/10011390> +/// +/// Create an instance of [Area120TablesApi] to access these resources: +/// +/// - [TablesResource] +/// - [TablesRowsResource] +/// - [WorkspacesResource] +library area120tables.v1alpha1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +class Area120TablesApi { + /// See, edit, create, and delete all of your Google Drive files + static const driveScope = 'https://www.googleapis.com/auth/drive'; + + /// View and manage Google Drive files and folders that you have opened or + /// created with this app + static const driveFileScope = 'https://www.googleapis.com/auth/drive.file'; + + /// See and download all your Google Drive files + static const driveReadonlyScope = + 'https://www.googleapis.com/auth/drive.readonly'; + + /// See, edit, create, and delete your spreadsheets in Google Drive + static const spreadsheetsScope = + 'https://www.googleapis.com/auth/spreadsheets'; + + /// View your Google Spreadsheets + static const spreadsheetsReadonlyScope = + 'https://www.googleapis.com/auth/spreadsheets.readonly'; + + /// See, edit, create, and delete your tables in Tables by Area 120 + static const tablesScope = 'https://www.googleapis.com/auth/tables'; + + final commons.ApiRequester _requester; + + TablesResource get tables => TablesResource(_requester); + WorkspacesResource get workspaces => WorkspacesResource(_requester); + + Area120TablesApi(http.Client client, + {core.String rootUrl = 'https://area120tables.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class TablesResource { + final commons.ApiRequester _requester; + + TablesRowsResource get rows => TablesRowsResource(_requester); + + TablesResource(commons.ApiRequester client) : _requester = client; + + /// Gets a table. + /// + /// Returns NOT_FOUND if the table does not exist. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the table to retrieve. Format: + /// tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Table]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Table> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Table.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists tables for the user. + /// + /// Request parameters: + /// + /// [pageSize] - The maximum number of tables to return. The service may + /// return fewer than this value. If unspecified, at most 20 tables are + /// returned. The maximum value is 100; values above 100 are coerced to 100. + /// + /// [pageToken] - A page token, received from a previous `ListTables` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListTables` must match the call that provided the + /// page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListTablesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListTablesResponse> list({ + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/tables'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListTablesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class TablesRowsResource { + final commons.ApiRequester _requester; + + TablesRowsResource(commons.ApiRequester client) : _requester = client; + + /// Creates multiple rows. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent table where the rows will be created. + /// Format: tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [BatchCreateRowsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<BatchCreateRowsResponse> batchCreate( + BatchCreateRowsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/rows:batchCreate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => BatchCreateRowsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes multiple rows. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent table shared by all rows being deleted. + /// Format: tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> batchDelete( + BatchDeleteRowsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/rows:batchDelete'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates multiple rows. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent table shared by all rows being updated. + /// Format: tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [BatchUpdateRowsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<BatchUpdateRowsResponse> batchUpdate( + BatchUpdateRowsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/rows:batchUpdate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => BatchUpdateRowsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a row. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent table where this row will be created. + /// Format: tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [view] - Optional. Column key to use for values in the row. Defaults to + /// user entered name. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Row]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Row> create( + Row request, + core.String parent, { + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/rows'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Row.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a row. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the row to delete. Format: + /// tables/{table}/rows/{row} + /// Value must have pattern `^tables/\[^/\]+/rows/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets a row. + /// + /// Returns NOT_FOUND if the row does not exist in the table. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the row to retrieve. Format: + /// tables/{table}/rows/{row} + /// Value must have pattern `^tables/\[^/\]+/rows/\[^/\]+$`. + /// + /// [view] - Optional. Column key to use for values in the row. Defaults to + /// user entered name. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Row]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Row> get( + core.String name, { + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Row.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists rows in a table. + /// + /// Returns NOT_FOUND if the table does not exist. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent table. Format: tables/{table} + /// Value must have pattern `^tables/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of rows to return. The service may return + /// fewer than this value. If unspecified, at most 50 rows are returned. The + /// maximum value is 1,000; values above 1,000 are coerced to 1,000. + /// + /// [pageToken] - A page token, received from a previous `ListRows` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListRows` must match the call that provided the + /// page token. + /// + /// [view] - Optional. Column key to use for values in the row. Defaults to + /// user entered name. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListRowsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListRowsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/rows'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListRowsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a row. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The resource name of the row. Row names have the form + /// `tables/{table}/rows/{row}`. The name is ignored when creating a row. + /// Value must have pattern `^tables/\[^/\]+/rows/\[^/\]+$`. + /// + /// [updateMask] - The list of fields to update. + /// + /// [view] - Optional. Column key to use for values in the row. Defaults to + /// user entered name. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Row]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Row> patch( + Row request, + core.String name, { + core.String updateMask, + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Row.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +class WorkspacesResource { + final commons.ApiRequester _requester; + + WorkspacesResource(commons.ApiRequester client) : _requester = client; + + /// Gets a workspace. + /// + /// Returns NOT_FOUND if the workspace does not exist. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the workspace to retrieve. Format: + /// workspaces/{workspace} + /// Value must have pattern `^workspaces/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Workspace]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Workspace> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Workspace.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists workspaces for the user. + /// + /// Request parameters: + /// + /// [pageSize] - The maximum number of workspaces to return. The service may + /// return fewer than this value. If unspecified, at most 10 workspaces are + /// returned. The maximum value is 25; values above 25 are coerced to 25. + /// + /// [pageToken] - A page token, received from a previous `ListWorkspaces` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListWorkspaces` must match the call that + /// provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListWorkspacesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListWorkspacesResponse> list({ + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/workspaces'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListWorkspacesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Request message for TablesService.BatchCreateRows. +class BatchCreateRowsRequest { + /// The request message specifying the rows to create. + /// + /// A maximum of 500 rows can be created in a single batch. + /// + /// Required. + core.List<CreateRowRequest> requests; + + BatchCreateRowsRequest(); + + BatchCreateRowsRequest.fromJson(core.Map _json) { + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<CreateRowRequest>((value) => CreateRowRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for TablesService.BatchCreateRows. +class BatchCreateRowsResponse { + /// The created rows. + core.List<Row> rows; + + BatchCreateRowsResponse(); + + BatchCreateRowsResponse.fromJson(core.Map _json) { + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for TablesService.BatchDeleteRows +class BatchDeleteRowsRequest { + /// The names of the rows to delete. + /// + /// All rows must belong to the parent table or else the entire batch will + /// fail. A maximum of 500 rows can be deleted in a batch. Format: + /// tables/{table}/rows/{row} + /// + /// Required. + core.List<core.String> names; + + BatchDeleteRowsRequest(); + + BatchDeleteRowsRequest.fromJson(core.Map _json) { + if (_json.containsKey('names')) { + names = (_json['names'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (names != null) { + _json['names'] = names; + } + return _json; + } +} + +/// Request message for TablesService.BatchUpdateRows. +class BatchUpdateRowsRequest { + /// The request messages specifying the rows to update. + /// + /// A maximum of 500 rows can be modified in a single batch. + /// + /// Required. + core.List<UpdateRowRequest> requests; + + BatchUpdateRowsRequest(); + + BatchUpdateRowsRequest.fromJson(core.Map _json) { + if (_json.containsKey('requests')) { + requests = (_json['requests'] as core.List) + .map<UpdateRowRequest>((value) => UpdateRowRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requests != null) { + _json['requests'] = requests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for TablesService.BatchUpdateRows. +class BatchUpdateRowsResponse { + /// The updated rows. + core.List<Row> rows; + + BatchUpdateRowsResponse(); + + BatchUpdateRowsResponse.fromJson(core.Map _json) { + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Details on a column in the table. +class ColumnDescription { + /// Data type of the column Supported types are auto_id, boolean, + /// boolean_list, creator, create_timestamp, date, dropdown, location, + /// integer, integer_list, number, number_list, person, person_list, tags, + /// check_list, text, text_list, update_timestamp, updater, relationship, + /// file_attachment_list. + /// + /// These types directly map to the column types supported on Tables website. + core.String dataType; + + /// Internal id for a column. + core.String id; + + /// Range of labeled values for the column. + /// + /// Some columns like tags and drop-downs limit the values to a set of + /// possible values. We return the range of values in such cases to help + /// clients implement better user data validation. + /// + /// Optional. + core.List<LabeledItem> labels; + + /// Indicates that this is a lookup column whose value is derived from the + /// relationship column specified in the details. + /// + /// Lookup columns can not be updated directly. To change the value you must + /// update the associated relationship column. + /// + /// Optional. + LookupDetails lookupDetails; + + /// column name + core.String name; + + /// Additional details about a relationship column. + /// + /// Specified when data_type is relationship. + /// + /// Optional. + RelationshipDetails relationshipDetails; + + ColumnDescription(); + + ColumnDescription.fromJson(core.Map _json) { + if (_json.containsKey('dataType')) { + dataType = _json['dataType'] as core.String; + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('labels')) { + labels = (_json['labels'] as core.List) + .map<LabeledItem>((value) => LabeledItem.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('lookupDetails')) { + lookupDetails = LookupDetails.fromJson( + _json['lookupDetails'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('relationshipDetails')) { + relationshipDetails = RelationshipDetails.fromJson( + _json['relationshipDetails'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataType != null) { + _json['dataType'] = dataType; + } + if (id != null) { + _json['id'] = id; + } + if (labels != null) { + _json['labels'] = labels.map((value) => value.toJson()).toList(); + } + if (lookupDetails != null) { + _json['lookupDetails'] = lookupDetails.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (relationshipDetails != null) { + _json['relationshipDetails'] = relationshipDetails.toJson(); + } + return _json; + } +} + +/// Request message for TablesService.CreateRow. +class CreateRowRequest { + /// The parent table where this row will be created. + /// + /// Format: tables/{table} + /// + /// Required. + core.String parent; + + /// The row to create. + /// + /// Required. + Row row; + + /// Column key to use for values in the row. + /// + /// Defaults to user entered name. + /// + /// Optional. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + core.String view; + + CreateRowRequest(); + + CreateRowRequest.fromJson(core.Map _json) { + if (_json.containsKey('parent')) { + parent = _json['parent'] as core.String; + } + if (_json.containsKey('row')) { + row = Row.fromJson(_json['row'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('view')) { + view = _json['view'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (parent != null) { + _json['parent'] = parent; + } + if (row != null) { + _json['row'] = row.toJson(); + } + if (view != null) { + _json['view'] = view; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// A single item in a labeled column. +class LabeledItem { + /// Internal id associated with the item. + core.String id; + + /// Display string as entered by user. + core.String name; + + LabeledItem(); + + LabeledItem.fromJson(core.Map _json) { + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (id != null) { + _json['id'] = id; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Response message for TablesService.ListRows. +class ListRowsResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is empty, there are no subsequent pages. + core.String nextPageToken; + + /// The rows from the specified table. + core.List<Row> rows; + + ListRowsResponse(); + + ListRowsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('rows')) { + rows = (_json['rows'] as core.List) + .map<Row>((value) => + Row.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (rows != null) { + _json['rows'] = rows.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for TablesService.ListTables. +class ListTablesResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is empty, there are no subsequent pages. + core.String nextPageToken; + + /// The list of tables. + core.List<Table> tables; + + ListTablesResponse(); + + ListTablesResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('tables')) { + tables = (_json['tables'] as core.List) + .map<Table>((value) => + Table.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (tables != null) { + _json['tables'] = tables.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for TablesService.ListWorkspaces. +class ListWorkspacesResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is empty, there are no subsequent pages. + core.String nextPageToken; + + /// The list of workspaces. + core.List<Workspace> workspaces; + + ListWorkspacesResponse(); + + ListWorkspacesResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('workspaces')) { + workspaces = (_json['workspaces'] as core.List) + .map<Workspace>((value) => + Workspace.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (workspaces != null) { + _json['workspaces'] = workspaces.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Details about a lookup column whose value comes from the associated +/// relationship. +class LookupDetails { + /// The name of the relationship column associated with the lookup. + core.String relationshipColumn; + + /// The id of the relationship column. + core.String relationshipColumnId; + + LookupDetails(); + + LookupDetails.fromJson(core.Map _json) { + if (_json.containsKey('relationshipColumn')) { + relationshipColumn = _json['relationshipColumn'] as core.String; + } + if (_json.containsKey('relationshipColumnId')) { + relationshipColumnId = _json['relationshipColumnId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (relationshipColumn != null) { + _json['relationshipColumn'] = relationshipColumn; + } + if (relationshipColumnId != null) { + _json['relationshipColumnId'] = relationshipColumnId; + } + return _json; + } +} + +/// Details about a relationship column. +class RelationshipDetails { + /// The name of the table this relationship is linked to. + core.String linkedTable; + + RelationshipDetails(); + + RelationshipDetails.fromJson(core.Map _json) { + if (_json.containsKey('linkedTable')) { + linkedTable = _json['linkedTable'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (linkedTable != null) { + _json['linkedTable'] = linkedTable; + } + return _json; + } +} + +/// A single row in a table. +class Row { + /// The resource name of the row. + /// + /// Row names have the form `tables/{table}/rows/{row}`. The name is ignored + /// when creating a row. + core.String name; + + /// The values of the row. + /// + /// This is a map of column key to value. Key is user entered name(default) or + /// the internal column id based on the view in the request. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> values; + + Row(); + + Row.fromJson(core.Map _json) { + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('values')) { + values = + (_json['values'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (name != null) { + _json['name'] = name; + } + if (values != null) { + _json['values'] = values; + } + return _json; + } +} + +/// A single table. +class Table { + /// List of columns in this table. + /// + /// Order of columns matches the display order. + core.List<ColumnDescription> columns; + + /// The human readable title of the table. + core.String displayName; + + /// The resource name of the table. + /// + /// Table names have the form `tables/{table}`. + core.String name; + + Table(); + + Table.fromJson(core.Map _json) { + if (_json.containsKey('columns')) { + columns = (_json['columns'] as core.List) + .map<ColumnDescription>((value) => ColumnDescription.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (columns != null) { + _json['columns'] = columns.map((value) => value.toJson()).toList(); + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Request message for TablesService.UpdateRow. +class UpdateRowRequest { + /// The row to update. + /// + /// Required. + Row row; + + /// The list of fields to update. + core.String updateMask; + + /// Column key to use for values in the row. + /// + /// Defaults to user entered name. + /// + /// Optional. + /// Possible string values are: + /// - "VIEW_UNSPECIFIED" : Defaults to user entered text. + /// - "COLUMN_ID_VIEW" : Uses internally generated column id to identify + /// values. + core.String view; + + UpdateRowRequest(); + + UpdateRowRequest.fromJson(core.Map _json) { + if (_json.containsKey('row')) { + row = Row.fromJson(_json['row'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + if (_json.containsKey('view')) { + view = _json['view'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (row != null) { + _json['row'] = row.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + if (view != null) { + _json['view'] = view; + } + return _json; + } +} + +/// A single workspace. +class Workspace { + /// The human readable title of the workspace. + core.String displayName; + + /// The resource name of the workspace. + /// + /// Workspace names have the form `workspaces/{workspace}`. + core.String name; + + /// The list of tables in the workspace. + core.List<Table> tables; + + Workspace(); + + Workspace.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('tables')) { + tables = (_json['tables'] as core.List) + .map<Table>((value) => + Table.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (tables != null) { + _json['tables'] = tables.map((value) => value.toJson()).toList(); + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/artifactregistry/v1beta1.dart b/generated/googleapis_beta/lib/artifactregistry/v1beta1.dart deleted file mode 100644 index 74744ed..0000000 --- a/generated/googleapis_beta/lib/artifactregistry/v1beta1.dart +++ /dev/null
@@ -1,3120 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Artifact Registry API - v1beta1 -/// -/// Store and manage build artifacts in a scalable and integrated service built -/// on Google infrastructure. -/// -/// For more information, see <https://cloud.google.com/artifacts/docs/> -/// -/// Create an instance of [ArtifactRegistryApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsOperationsResource] -/// - [ProjectsLocationsRepositoriesResource] -/// - [ProjectsLocationsRepositoriesFilesResource] -/// - [ProjectsLocationsRepositoriesPackagesResource] -/// - [ProjectsLocationsRepositoriesPackagesTagsResource] -/// - [ProjectsLocationsRepositoriesPackagesVersionsResource] -library artifactregistry.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Store and manage build artifacts in a scalable and integrated service built -/// on Google infrastructure. -class ArtifactRegistryApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - ArtifactRegistryApi(http.Client client, - {core.String rootUrl = 'https://artifactregistry.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - ProjectsLocationsRepositoriesResource get repositories => - ProjectsLocationsRepositoriesResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRepositoriesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRepositoriesFilesResource get files => - ProjectsLocationsRepositoriesFilesResource(_requester); - ProjectsLocationsRepositoriesPackagesResource get packages => - ProjectsLocationsRepositoriesPackagesResource(_requester); - - ProjectsLocationsRepositoriesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a repository. - /// - /// The returned Operation will finish once the repository has been created. - /// Its response will be the created Repository. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource where the repository will be - /// created. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [repositoryId] - The repository id to use for this repository. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Repository request, - core.String parent, { - core.String repositoryId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (repositoryId != null) { - _queryParams['repositoryId'] = [repositoryId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/repositories'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a repository and all of its contents. - /// - /// The returned Operation will finish once the repository has been deleted. - /// It will not have any Operation metadata and will return a - /// google.protobuf.Empty response. - /// - /// Request parameters: - /// - /// [name] - The name of the repository to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a repository. - /// - /// Request parameters: - /// - /// [name] - The name of the repository to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Repository]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Repository> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Repository.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the IAM policy for a given resource. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists repositories. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource whose repositories will be - /// listed. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of repositories to return. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListRepositoriesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListRepositoriesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/repositories'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListRepositoriesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a repository. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the repository, for example: - /// "projects/p1/locations/us-central1/repositories/repo1". - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [updateMask] - The update mask applies to the resource. For the - /// `FieldMask` definition, see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Repository]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Repository> patch( - Repository request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Repository.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the IAM policy for a given resource. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Tests if the caller has a list of permissions on a resource. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRepositoriesFilesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRepositoriesFilesResource(commons.ApiRequester client) - : _requester = client; - - /// Gets a file. - /// - /// Request parameters: - /// - /// [name] - The name of the file to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/files/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [File]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<File> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => File.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists files. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource whose files will be listed. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [filter] - An expression for filtering the results of the request. Filter - /// rules are case insensitive. The fields eligible for filtering are: * - /// `name` * `owner` An example of using a filter: * - /// `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b / * - /// "` --> Files with an ID starting with "a/b/". * - /// `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - /// --> Files owned by the version `1.0` in package `pkg1`. - /// - /// [pageSize] - The maximum number of files to return. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListFilesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListFilesResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/files'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListFilesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRepositoriesPackagesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRepositoriesPackagesTagsResource get tags => - ProjectsLocationsRepositoriesPackagesTagsResource(_requester); - ProjectsLocationsRepositoriesPackagesVersionsResource get versions => - ProjectsLocationsRepositoriesPackagesVersionsResource(_requester); - - ProjectsLocationsRepositoriesPackagesResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes a package and all of its versions and tags. - /// - /// The returned operation will complete once the package has been deleted. - /// - /// Request parameters: - /// - /// [name] - The name of the package to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a package. - /// - /// Request parameters: - /// - /// [name] - The name of the package to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Package]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Package> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Package.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists packages. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource whose packages will be listed. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of packages to return. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListPackagesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListPackagesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/packages'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListPackagesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRepositoriesPackagesTagsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRepositoriesPackagesTagsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a tag. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource where the tag will be created. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`. - /// - /// [tagId] - The tag id to use for this repository. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Tag]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Tag> create( - Tag request, - core.String parent, { - core.String tagId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (tagId != null) { - _queryParams['tagId'] = [tagId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/tags'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Tag.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a tag. - /// - /// Request parameters: - /// - /// [name] - The name of the tag to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a tag. - /// - /// Request parameters: - /// - /// [name] - The name of the tag to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Tag]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Tag> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Tag.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists tags. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource whose tags will be listed. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`. - /// - /// [filter] - An expression for filtering the results of the request. Filter - /// rules are case insensitive. The fields eligible for filtering are: * - /// `version` An example of using a filter: * - /// `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - /// --> Tags that are applied to the version `1.0` in package `pkg1`. - /// - /// [pageSize] - The maximum number of tags to return. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListTagsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListTagsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/tags'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListTagsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a tag. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the tag, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`. - /// - /// [updateMask] - The update mask applies to the resource. For the - /// `FieldMask` definition, see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Tag]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Tag> patch( - Tag request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Tag.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRepositoriesPackagesVersionsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRepositoriesPackagesVersionsResource( - commons.ApiRequester client) - : _requester = client; - - /// Deletes a version and all of its content. - /// - /// The returned operation will complete once the version has been deleted. - /// - /// Request parameters: - /// - /// [name] - The name of the version to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/versions/\[^/\]+$`. - /// - /// [force] - By default, a version that is tagged may not be deleted. If - /// force=true, the version and any tags pointing to the version are deleted. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.bool force, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (force != null) { - _queryParams['force'] = ['${force}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a version - /// - /// Request parameters: - /// - /// [name] - The name of the version to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/versions/\[^/\]+$`. - /// - /// [view] - The view that should be returned in the response. - /// Possible string values are: - /// - "VERSION_VIEW_UNSPECIFIED" : The default / unset value. The API will - /// default to the BASIC view. - /// - "BASIC" : Includes basic information about the version, but not any - /// related tags. - /// - "FULL" : Include everything. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> get( - core.String name, { - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists versions. - /// - /// Request parameters: - /// - /// [parent] - The name of the parent resource whose versions will be listed. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of versions to return. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request, if any. - /// - /// [view] - The view that should be returned in the response. - /// Possible string values are: - /// - "VERSION_VIEW_UNSPECIFIED" : The default / unset value. The API will - /// default to the BASIC view. - /// - "BASIC" : Includes basic information about the version, but not any - /// related tags. - /// - "FULL" : Include everything. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String view, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (view != null) { - _queryParams['view'] = [view]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Files store content that is potentially associated with Packages or -/// Versions. -class File { - /// The time when the File was created. - core.String createTime; - - /// The hashes of the file content. - core.List<Hash> hashes; - - /// The name of the file, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/files/a/b/c.txt". - core.String name; - - /// The name of the Package or Version that owns this file, if any. - core.String owner; - - /// The size of the File in bytes. - core.String sizeBytes; - - /// The time when the File was last updated. - core.String updateTime; - - File(); - - File.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('hashes')) { - hashes = (_json['hashes'] as core.List) - .map<Hash>((value) => - Hash.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('owner')) { - owner = _json['owner'] as core.String; - } - if (_json.containsKey('sizeBytes')) { - sizeBytes = _json['sizeBytes'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (hashes != null) { - _json['hashes'] = hashes.map((value) => value.toJson()).toList(); - } - if (name != null) { - _json['name'] = name; - } - if (owner != null) { - _json['owner'] = owner; - } - if (sizeBytes != null) { - _json['sizeBytes'] = sizeBytes; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// Error information explaining why a package was not imported. -class GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo { - /// The detailed error status. - Status error; - - /// Google Cloud Storage location requested. - GoogleDevtoolsArtifactregistryV1alpha1GcsSource gcsSource; - - GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo(); - - GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo.fromJson(core.Map _json) { - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('gcsSource')) { - gcsSource = GoogleDevtoolsArtifactregistryV1alpha1GcsSource.fromJson( - _json['gcsSource'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (error != null) { - _json['error'] = error.toJson(); - } - if (gcsSource != null) { - _json['gcsSource'] = gcsSource.toJson(); - } - return _json; - } -} - -/// Google Cloud Storage location for the input content. -class GoogleDevtoolsArtifactregistryV1alpha1GcsSource { - /// Cloud Storage paths URI (e.g., gs://my_bucket//my_object). - core.List<core.String> uris; - - GoogleDevtoolsArtifactregistryV1alpha1GcsSource(); - - GoogleDevtoolsArtifactregistryV1alpha1GcsSource.fromJson(core.Map _json) { - if (_json.containsKey('uris')) { - uris = (_json['uris'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uris != null) { - _json['uris'] = uris; - } - return _json; - } -} - -/// The response message from importing artifacts. -class GoogleDevtoolsArtifactregistryV1alpha1ImportArtifactsResponse { - /// Detailed error info for packages that were not imported. - core.List<GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo> errors; - - /// The packages updated. - core.List<GoogleDevtoolsArtifactregistryV1alpha1Package> packages; - - GoogleDevtoolsArtifactregistryV1alpha1ImportArtifactsResponse(); - - GoogleDevtoolsArtifactregistryV1alpha1ImportArtifactsResponse.fromJson( - core.Map _json) { - if (_json.containsKey('errors')) { - errors = (_json['errors'] as core.List) - .map<GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo>((value) => - GoogleDevtoolsArtifactregistryV1alpha1ErrorInfo.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('packages')) { - packages = (_json['packages'] as core.List) - .map<GoogleDevtoolsArtifactregistryV1alpha1Package>((value) => - GoogleDevtoolsArtifactregistryV1alpha1Package.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (errors != null) { - _json['errors'] = errors.map((value) => value.toJson()).toList(); - } - if (packages != null) { - _json['packages'] = packages.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Packages are named collections of versions. -class GoogleDevtoolsArtifactregistryV1alpha1Package { - /// The time when the package was created. - core.String createTime; - - /// The display name of the package. - core.String displayName; - - /// The name of the package, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - core.String name; - - /// The time when the package was last updated. - /// - /// This includes publishing a new version of the package. - core.String updateTime; - - GoogleDevtoolsArtifactregistryV1alpha1Package(); - - GoogleDevtoolsArtifactregistryV1alpha1Package.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// A hash of file content. -class Hash { - /// The algorithm used to compute the hash value. - /// Possible string values are: - /// - "HASH_TYPE_UNSPECIFIED" : Unspecified. - /// - "SHA256" : SHA256 hash. - core.String type; - - /// The hash value. - core.String value; - core.List<core.int> get valueAsBytes => convert.base64.decode(value); - - set valueAsBytes(core.List<core.int> _bytes) { - value = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - Hash(); - - Hash.fromJson(core.Map _json) { - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (type != null) { - _json['type'] = type; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// The response from listing files. -class ListFilesResponse { - /// The files returned. - core.List<File> files; - - /// The token to retrieve the next page of files, or empty if there are no - /// more files to return. - core.String nextPageToken; - - ListFilesResponse(); - - ListFilesResponse.fromJson(core.Map _json) { - if (_json.containsKey('files')) { - files = (_json['files'] as core.List) - .map<File>((value) => - File.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (files != null) { - _json['files'] = files.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The response from listing packages. -class ListPackagesResponse { - /// The token to retrieve the next page of packages, or empty if there are no - /// more packages to return. - core.String nextPageToken; - - /// The packages returned. - core.List<Package> packages; - - ListPackagesResponse(); - - ListPackagesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('packages')) { - packages = (_json['packages'] as core.List) - .map<Package>((value) => - Package.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (packages != null) { - _json['packages'] = packages.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The response from listing repositories. -class ListRepositoriesResponse { - /// The token to retrieve the next page of repositories, or empty if there are - /// no more repositories to return. - core.String nextPageToken; - - /// The repositories returned. - core.List<Repository> repositories; - - ListRepositoriesResponse(); - - ListRepositoriesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('repositories')) { - repositories = (_json['repositories'] as core.List) - .map<Repository>((value) => - Repository.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (repositories != null) { - _json['repositories'] = - repositories.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The response from listing tags. -class ListTagsResponse { - /// The token to retrieve the next page of tags, or empty if there are no more - /// tags to return. - core.String nextPageToken; - - /// The tags returned. - core.List<Tag> tags; - - ListTagsResponse(); - - ListTagsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('tags')) { - tags = (_json['tags'] as core.List) - .map<Tag>((value) => - Tag.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (tags != null) { - _json['tags'] = tags.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The response from listing versions. -class ListVersionsResponse { - /// The token to retrieve the next page of versions, or empty if there are no - /// more versions to return. - core.String nextPageToken; - - /// The versions returned. - core.List<Version> versions; - - ListVersionsResponse(); - - ListVersionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('versions')) { - versions = (_json['versions'] as core.List) - .map<Version>((value) => - Version.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (versions != null) { - _json['versions'] = versions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Packages are named collections of versions. -class Package { - /// The time when the package was created. - core.String createTime; - - /// The display name of the package. - core.String displayName; - - /// The name of the package, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1". - core.String name; - - /// The time when the package was last updated. - /// - /// This includes publishing a new version of the package. - core.String updateTime; - - Package(); - - Package.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// A Repository for storing artifacts with a specific format. -class Repository { - /// The time when the repository was created. - core.String createTime; - - /// The user-provided description of the repository. - core.String description; - - /// The format of packages that are stored in the repository. - /// Possible string values are: - /// - "FORMAT_UNSPECIFIED" : Unspecified package format. - /// - "DOCKER" : Docker package format. - /// - "MAVEN" : Maven package format. - /// - "NPM" : NPM package format. - /// - "APT" : APT package format. - core.String format; - - /// The Cloud KMS resource name of the customer managed encryption key that’s - /// used to encrypt the contents of the Repository. - /// - /// Has the form: - /// `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - /// This value may not be changed after the Repository has been created. - core.String kmsKeyName; - - /// Labels with user-defined metadata. - /// - /// This field may contain up to 64 entries. Label keys and values may be no - /// longer than 63 characters. Label keys must begin with a lowercase letter - /// and may only contain lowercase letters, numeric characters, underscores, - /// and dashes. - core.Map<core.String, core.String> labels; - - /// The name of the repository, for example: - /// "projects/p1/locations/us-central1/repositories/repo1". - core.String name; - - /// The time when the repository was last updated. - core.String updateTime; - - Repository(); - - Repository.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('format')) { - format = _json['format'] as core.String; - } - if (_json.containsKey('kmsKeyName')) { - kmsKeyName = _json['kmsKeyName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (format != null) { - _json['format'] = format; - } - if (kmsKeyName != null) { - _json['kmsKeyName'] = kmsKeyName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Tags point to a version and represent an alternative name that can be used -/// to access the version. -class Tag { - /// The name of the tag, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". - core.String name; - - /// The name of the version the tag refers to, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" - core.String version; - - Tag(); - - Tag.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// The body of a version resource. -/// -/// A version resource represents a collection of components, such as files and -/// other data. This may correspond to a version in many package management -/// schemes. -class Version { - /// The time when the version was created. - core.String createTime; - - /// Description of the version, as specified in its metadata. - /// - /// Optional. - core.String description; - - /// The name of the version, for example: - /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". - core.String name; - - /// A list of related tags. - /// - /// Will contain up to 100 tags that reference this version. - /// - /// Output only. - core.List<Tag> relatedTags; - - /// The time when the version was last updated. - core.String updateTime; - - Version(); - - Version.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('relatedTags')) { - relatedTags = (_json['relatedTags'] as core.List) - .map<Tag>((value) => - Tag.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (name != null) { - _json['name'] = name; - } - if (relatedTags != null) { - _json['relatedTags'] = - relatedTags.map((value) => value.toJson()).toList(); - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/billingbudgets/v1beta1.dart b/generated/googleapis_beta/lib/billingbudgets/v1beta1.dart deleted file mode 100644 index 433753c..0000000 --- a/generated/googleapis_beta/lib/billingbudgets/v1beta1.dart +++ /dev/null
@@ -1,987 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Billing Budget API - v1beta1 -/// -/// The Cloud Billing Budget API stores Cloud Billing budgets, which define a -/// budget plan and the rules to execute as spend is tracked against that plan. -/// -/// For more information, see -/// <https://cloud.google.com/billing/docs/how-to/budget-api-overview> -/// -/// Create an instance of [CloudBillingBudgetApi] to access these resources: -/// -/// - [BillingAccountsResource] -/// - [BillingAccountsBudgetsResource] -library billingbudgets.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// The Cloud Billing Budget API stores Cloud Billing budgets, which define a -/// budget plan and the rules to execute as spend is tracked against that plan. -class CloudBillingBudgetApi { - /// View and manage your Google Cloud Platform billing accounts - static const cloudBillingScope = - 'https://www.googleapis.com/auth/cloud-billing'; - - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - BillingAccountsResource get billingAccounts => - BillingAccountsResource(_requester); - - CloudBillingBudgetApi(http.Client client, - {core.String rootUrl = 'https://billingbudgets.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class BillingAccountsResource { - final commons.ApiRequester _requester; - - BillingAccountsBudgetsResource get budgets => - BillingAccountsBudgetsResource(_requester); - - BillingAccountsResource(commons.ApiRequester client) : _requester = client; -} - -class BillingAccountsBudgetsResource { - final commons.ApiRequester _requester; - - BillingAccountsBudgetsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new budget. - /// - /// See Quotas and limits for more information on the limits of the number of - /// budgets you can create. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the billing account to create the budget - /// in. Values are of the form `billingAccounts/{billingAccountId}`. - /// Value must have pattern `^billingAccounts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudBillingBudgetsV1beta1Budget]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudBillingBudgetsV1beta1Budget> create( - GoogleCloudBillingBudgetsV1beta1CreateBudgetRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/budgets'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a budget. - /// - /// Returns successfully if already deleted. - /// - /// Request parameters: - /// - /// [name] - Required. Name of the budget to delete. Values are of the form - /// `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - /// Value must have pattern `^billingAccounts/\[^/\]+/budgets/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns a budget. - /// - /// WARNING: There are some fields exposed on the Google Cloud Console that - /// aren't available on this API. When reading from the API, you will not see - /// these fields in the return value, though they may have been set in the - /// Cloud Console. - /// - /// Request parameters: - /// - /// [name] - Required. Name of budget to get. Values are of the form - /// `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - /// Value must have pattern `^billingAccounts/\[^/\]+/budgets/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudBillingBudgetsV1beta1Budget]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudBillingBudgetsV1beta1Budget> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns a list of budgets for a billing account. - /// - /// WARNING: There are some fields exposed on the Google Cloud Console that - /// aren't available on this API. When reading from the API, you will not see - /// these fields in the return value, though they may have been set in the - /// Cloud Console. - /// - /// Request parameters: - /// - /// [parent] - Required. Name of billing account to list budgets under. Values - /// are of the form `billingAccounts/{billingAccountId}`. - /// Value must have pattern `^billingAccounts/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of budgets to return per page. - /// The default and maximum value are 100. - /// - /// [pageToken] - Optional. The value returned by the last - /// `ListBudgetsResponse` which indicates that this is a continuation of a - /// prior `ListBudgets` call, and that the system should return the next page - /// of data. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/budgets'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a budget and returns the updated budget. - /// - /// WARNING: There are some fields exposed on the Google Cloud Console that - /// aren't available on this API. Budget fields that are not exposed in this - /// API will not be changed by this method. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Output only. Resource name of the budget. The resource name - /// implies the scope of a budget. Values are of the form - /// `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - /// Value must have pattern `^billingAccounts/\[^/\]+/budgets/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudBillingBudgetsV1beta1Budget]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudBillingBudgetsV1beta1Budget> patch( - GoogleCloudBillingBudgetsV1beta1UpdateBudgetRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// AllUpdatesRule defines notifications that are sent based on budget spend and -/// thresholds. -class GoogleCloudBillingBudgetsV1beta1AllUpdatesRule { - /// When set to true, disables default notifications sent when a threshold is - /// exceeded. - /// - /// Default notifications are sent to those with Billing Account Administrator - /// and Billing Account User IAM roles for the target account. - /// - /// Optional. - core.bool disableDefaultIamRecipients; - - /// Targets to send notifications to when a threshold is exceeded. - /// - /// This is in addition to default recipients who have billing account IAM - /// roles. The value is the full REST resource name of a monitoring - /// notification channel with the form - /// `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 - /// channels are allowed. See - /// https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients - /// for more details. - /// - /// Optional. - core.List<core.String> monitoringNotificationChannels; - - /// The name of the Pub/Sub topic where budget related messages will be - /// published, in the form `projects/{project_id}/topics/{topic_id}`. - /// - /// Updates are sent at regular intervals to the topic. The topic needs to be - /// created before the budget is created; see - /// https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications - /// for more details. Caller is expected to have `pubsub.topics.setIamPolicy` - /// permission on the topic when it's set for a budget, otherwise, the API - /// call will fail with PERMISSION_DENIED. See - /// https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications - /// for more details on Pub/Sub roles and permissions. - /// - /// Optional. - core.String pubsubTopic; - - /// The schema version of the notification sent to `pubsub_topic`. - /// - /// Only "1.0" is accepted. It represents the JSON schema as defined in - /// https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format - /// - /// Optional. - core.String schemaVersion; - - GoogleCloudBillingBudgetsV1beta1AllUpdatesRule(); - - GoogleCloudBillingBudgetsV1beta1AllUpdatesRule.fromJson(core.Map _json) { - if (_json.containsKey('disableDefaultIamRecipients')) { - disableDefaultIamRecipients = - _json['disableDefaultIamRecipients'] as core.bool; - } - if (_json.containsKey('monitoringNotificationChannels')) { - monitoringNotificationChannels = - (_json['monitoringNotificationChannels'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('pubsubTopic')) { - pubsubTopic = _json['pubsubTopic'] as core.String; - } - if (_json.containsKey('schemaVersion')) { - schemaVersion = _json['schemaVersion'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (disableDefaultIamRecipients != null) { - _json['disableDefaultIamRecipients'] = disableDefaultIamRecipients; - } - if (monitoringNotificationChannels != null) { - _json['monitoringNotificationChannels'] = monitoringNotificationChannels; - } - if (pubsubTopic != null) { - _json['pubsubTopic'] = pubsubTopic; - } - if (schemaVersion != null) { - _json['schemaVersion'] = schemaVersion; - } - return _json; - } -} - -/// A budget is a plan that describes what you expect to spend on Cloud -/// projects, plus the rules to execute as spend is tracked against that plan, -/// (for example, send an alert when 90% of the target spend is met). -/// -/// Currently all plans are monthly budgets so the usage period(s) tracked are -/// implied (calendar months of usage back-to-back). -class GoogleCloudBillingBudgetsV1beta1Budget { - /// Rules to apply to notifications sent based on budget spend and thresholds. - /// - /// Optional. - GoogleCloudBillingBudgetsV1beta1AllUpdatesRule allUpdatesRule; - - /// Budgeted amount. - /// - /// Required. - GoogleCloudBillingBudgetsV1beta1BudgetAmount amount; - - /// Filters that define which resources are used to compute the actual spend - /// against the budget. - /// - /// Optional. - GoogleCloudBillingBudgetsV1beta1Filter budgetFilter; - - /// User data for display name in UI. - /// - /// Validation: <= 60 chars. - core.String displayName; - - /// Etag to validate that the object is unchanged for a read-modify-write - /// operation. - /// - /// An empty etag will cause an update to overwrite other changes. - /// - /// Optional. - core.String etag; - - /// Resource name of the budget. - /// - /// The resource name implies the scope of a budget. Values are of the form - /// `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - /// - /// Output only. - core.String name; - - /// Rules that trigger alerts (notifications of thresholds being crossed) when - /// spend exceeds the specified percentages of the budget. - /// - /// Optional. - core.List<GoogleCloudBillingBudgetsV1beta1ThresholdRule> thresholdRules; - - GoogleCloudBillingBudgetsV1beta1Budget(); - - GoogleCloudBillingBudgetsV1beta1Budget.fromJson(core.Map _json) { - if (_json.containsKey('allUpdatesRule')) { - allUpdatesRule = GoogleCloudBillingBudgetsV1beta1AllUpdatesRule.fromJson( - _json['allUpdatesRule'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('amount')) { - amount = GoogleCloudBillingBudgetsV1beta1BudgetAmount.fromJson( - _json['amount'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('budgetFilter')) { - budgetFilter = GoogleCloudBillingBudgetsV1beta1Filter.fromJson( - _json['budgetFilter'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('thresholdRules')) { - thresholdRules = (_json['thresholdRules'] as core.List) - .map<GoogleCloudBillingBudgetsV1beta1ThresholdRule>((value) => - GoogleCloudBillingBudgetsV1beta1ThresholdRule.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allUpdatesRule != null) { - _json['allUpdatesRule'] = allUpdatesRule.toJson(); - } - if (amount != null) { - _json['amount'] = amount.toJson(); - } - if (budgetFilter != null) { - _json['budgetFilter'] = budgetFilter.toJson(); - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (etag != null) { - _json['etag'] = etag; - } - if (name != null) { - _json['name'] = name; - } - if (thresholdRules != null) { - _json['thresholdRules'] = - thresholdRules.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The budgeted amount for each usage period. -class GoogleCloudBillingBudgetsV1beta1BudgetAmount { - /// Use the last period's actual spend as the budget for the present period. - GoogleCloudBillingBudgetsV1beta1LastPeriodAmount lastPeriodAmount; - - /// A specified amount to use as the budget. - /// - /// `currency_code` is optional. If specified, it must match the currency of - /// the billing account. The `currency_code` is provided on output. - GoogleTypeMoney specifiedAmount; - - GoogleCloudBillingBudgetsV1beta1BudgetAmount(); - - GoogleCloudBillingBudgetsV1beta1BudgetAmount.fromJson(core.Map _json) { - if (_json.containsKey('lastPeriodAmount')) { - lastPeriodAmount = - GoogleCloudBillingBudgetsV1beta1LastPeriodAmount.fromJson( - _json['lastPeriodAmount'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('specifiedAmount')) { - specifiedAmount = GoogleTypeMoney.fromJson( - _json['specifiedAmount'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lastPeriodAmount != null) { - _json['lastPeriodAmount'] = lastPeriodAmount.toJson(); - } - if (specifiedAmount != null) { - _json['specifiedAmount'] = specifiedAmount.toJson(); - } - return _json; - } -} - -/// Request for CreateBudget -class GoogleCloudBillingBudgetsV1beta1CreateBudgetRequest { - /// Budget to create. - /// - /// Required. - GoogleCloudBillingBudgetsV1beta1Budget budget; - - GoogleCloudBillingBudgetsV1beta1CreateBudgetRequest(); - - GoogleCloudBillingBudgetsV1beta1CreateBudgetRequest.fromJson(core.Map _json) { - if (_json.containsKey('budget')) { - budget = GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - _json['budget'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (budget != null) { - _json['budget'] = budget.toJson(); - } - return _json; - } -} - -/// A filter for a budget, limiting the scope of the cost to calculate. -class GoogleCloudBillingBudgetsV1beta1Filter { - /// If not set, default behavior is `INCLUDE_ALL_CREDITS`. - /// - /// Optional. - /// Possible string values are: - /// - "CREDIT_TYPES_TREATMENT_UNSPECIFIED" - /// - "INCLUDE_ALL_CREDITS" : All types of credit are subtracted from the - /// gross cost to determine the spend for threshold calculations. - /// - "EXCLUDE_ALL_CREDITS" : All types of credit are added to the net cost to - /// determine the spend for threshold calculations. - core.String creditTypesTreatment; - - /// A single label and value pair specifying that usage from only this set of - /// labeled resources should be included in the budget. - /// - /// Currently, multiple entries or multiple values per entry are not allowed. - /// If omitted, the report will include all labeled and unlabeled usage. - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.List<core.Object>> labels; - - /// A set of projects of the form `projects/{project}`, specifying that usage - /// from only this set of projects should be included in the budget. - /// - /// If omitted, the report will include all usage for the billing account, - /// regardless of which project the usage occurred on. Only zero or one - /// project can be specified currently. - /// - /// Optional. - core.List<core.String> projects; - - /// A set of services of the form `services/{service_id}`, specifying that - /// usage from only this set of services should be included in the budget. - /// - /// If omitted, the report will include usage for all the services. The - /// service names are available through the Catalog API: - /// https://cloud.google.com/billing/v1/how-tos/catalog-api. - /// - /// Optional. - core.List<core.String> services; - - /// A set of subaccounts of the form `billingAccounts/{account_id}`, - /// specifying that usage from only this set of subaccounts should be included - /// in the budget. - /// - /// If a subaccount is set to the name of the parent account, usage from the - /// parent account will be included. If omitted, the report will include usage - /// from the parent account and all subaccounts, if they exist. - /// - /// Optional. - core.List<core.String> subaccounts; - - GoogleCloudBillingBudgetsV1beta1Filter(); - - GoogleCloudBillingBudgetsV1beta1Filter.fromJson(core.Map _json) { - if (_json.containsKey('creditTypesTreatment')) { - creditTypesTreatment = _json['creditTypesTreatment'] as core.String; - } - if (_json.containsKey('labels')) { - labels = (_json['labels'] as core.Map).cast<core.String, core.List>().map( - (key, item) => core.MapEntry( - key, - (item as core.List) - .map<core.Object>((value) => value as core.Object) - .toList(), - ), - ); - } - if (_json.containsKey('projects')) { - projects = (_json['projects'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('services')) { - services = (_json['services'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('subaccounts')) { - subaccounts = (_json['subaccounts'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (creditTypesTreatment != null) { - _json['creditTypesTreatment'] = creditTypesTreatment; - } - if (labels != null) { - _json['labels'] = labels; - } - if (projects != null) { - _json['projects'] = projects; - } - if (services != null) { - _json['services'] = services; - } - if (subaccounts != null) { - _json['subaccounts'] = subaccounts; - } - return _json; - } -} - -/// Describes a budget amount targeted to last period's spend. -/// -/// At this time, the amount is automatically 100% of last period's spend; that -/// is, there are no other options yet. Future configuration will be described -/// here (for example, configuring a percentage of last period's spend). -class GoogleCloudBillingBudgetsV1beta1LastPeriodAmount { - GoogleCloudBillingBudgetsV1beta1LastPeriodAmount(); - - GoogleCloudBillingBudgetsV1beta1LastPeriodAmount.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Response for ListBudgets -class GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse { - /// List of the budgets owned by the requested billing account. - core.List<GoogleCloudBillingBudgetsV1beta1Budget> budgets; - - /// If not empty, indicates that there may be more budgets that match the - /// request; this value should be passed in a new `ListBudgetsRequest`. - core.String nextPageToken; - - GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse(); - - GoogleCloudBillingBudgetsV1beta1ListBudgetsResponse.fromJson(core.Map _json) { - if (_json.containsKey('budgets')) { - budgets = (_json['budgets'] as core.List) - .map<GoogleCloudBillingBudgetsV1beta1Budget>((value) => - GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (budgets != null) { - _json['budgets'] = budgets.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// ThresholdRule contains a definition of a threshold which triggers an alert -/// (a notification of a threshold being crossed) to be sent when spend goes -/// above the specified amount. -/// -/// Alerts are automatically e-mailed to users with the Billing Account -/// Administrator role or the Billing Account User role. The thresholds here -/// have no effect on notifications sent to anything configured under -/// `Budget.all_updates_rule`. -class GoogleCloudBillingBudgetsV1beta1ThresholdRule { - /// The type of basis used to determine if spend has passed the threshold. - /// - /// Behavior defaults to CURRENT_SPEND if not set. - /// - /// Optional. - /// Possible string values are: - /// - "BASIS_UNSPECIFIED" : Unspecified threshold basis. - /// - "CURRENT_SPEND" : Use current spend as the basis for comparison against - /// the threshold. - /// - "FORECASTED_SPEND" : Use forecasted spend for the period as the basis - /// for comparison against the threshold. - core.String spendBasis; - - /// Send an alert when this threshold is exceeded. - /// - /// This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative - /// number. - /// - /// Required. - core.double thresholdPercent; - - GoogleCloudBillingBudgetsV1beta1ThresholdRule(); - - GoogleCloudBillingBudgetsV1beta1ThresholdRule.fromJson(core.Map _json) { - if (_json.containsKey('spendBasis')) { - spendBasis = _json['spendBasis'] as core.String; - } - if (_json.containsKey('thresholdPercent')) { - thresholdPercent = (_json['thresholdPercent'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (spendBasis != null) { - _json['spendBasis'] = spendBasis; - } - if (thresholdPercent != null) { - _json['thresholdPercent'] = thresholdPercent; - } - return _json; - } -} - -/// Request for UpdateBudget -class GoogleCloudBillingBudgetsV1beta1UpdateBudgetRequest { - /// The updated budget object. - /// - /// The budget to update is specified by the budget name in the budget. - /// - /// Required. - GoogleCloudBillingBudgetsV1beta1Budget budget; - - /// Indicates which fields in the provided budget to update. - /// - /// Read-only fields (such as `name`) cannot be changed. If this is not - /// provided, then only fields with non-default values from the request are - /// updated. See - /// https://developers.google.com/protocol-buffers/docs/proto3#default for - /// more details about default values. - /// - /// Optional. - core.String updateMask; - - GoogleCloudBillingBudgetsV1beta1UpdateBudgetRequest(); - - GoogleCloudBillingBudgetsV1beta1UpdateBudgetRequest.fromJson(core.Map _json) { - if (_json.containsKey('budget')) { - budget = GoogleCloudBillingBudgetsV1beta1Budget.fromJson( - _json['budget'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (budget != null) { - _json['budget'] = budget.toJson(); - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class GoogleProtobufEmpty { - GoogleProtobufEmpty(); - - GoogleProtobufEmpty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents an amount of money with its currency type. -class GoogleTypeMoney { - /// The 3-letter currency code defined in ISO 4217. - core.String currencyCode; - - /// Number of nano (10^-9) units of the amount. - /// - /// The value must be between -999,999,999 and +999,999,999 inclusive. If - /// `units` is positive, `nanos` must be positive or zero. If `units` is zero, - /// `nanos` can be positive, zero, or negative. If `units` is negative, - /// `nanos` must be negative or zero. For example $-1.75 is represented as - /// `units`=-1 and `nanos`=-750,000,000. - core.int nanos; - - /// The whole units of the amount. - /// - /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - core.String units; - - GoogleTypeMoney(); - - GoogleTypeMoney.fromJson(core.Map _json) { - if (_json.containsKey('currencyCode')) { - currencyCode = _json['currencyCode'] as core.String; - } - if (_json.containsKey('nanos')) { - nanos = _json['nanos'] as core.int; - } - if (_json.containsKey('units')) { - units = _json['units'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (currencyCode != null) { - _json['currencyCode'] = currencyCode; - } - if (nanos != null) { - _json['nanos'] = nanos; - } - if (units != null) { - _json['units'] = units; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/cloudresourcemanager/v1beta1.dart b/generated/googleapis_beta/lib/cloudresourcemanager/v1beta1.dart deleted file mode 100644 index 232f8f7..0000000 --- a/generated/googleapis_beta/lib/cloudresourcemanager/v1beta1.dart +++ /dev/null
@@ -1,2303 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Resource Manager API - v1beta1 -/// -/// Creates, reads, and updates metadata for Google Cloud Platform resource -/// containers. -/// -/// For more information, see <https://cloud.google.com/resource-manager> -/// -/// Create an instance of [CloudResourceManagerApi] to access these resources: -/// -/// - [OrganizationsResource] -/// - [ProjectsResource] -library cloudresourcemanager.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Creates, reads, and updates metadata for Google Cloud Platform resource -/// containers. -class CloudResourceManagerApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - final commons.ApiRequester _requester; - - OrganizationsResource get organizations => OrganizationsResource(_requester); - ProjectsResource get projects => ProjectsResource(_requester); - - CloudResourceManagerApi(http.Client client, - {core.String rootUrl = 'https://cloudresourcemanager.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class OrganizationsResource { - final commons.ApiRequester _requester; - - OrganizationsResource(commons.ApiRequester client) : _requester = client; - - /// Fetches an Organization resource identified by the specified resource - /// name. - /// - /// Request parameters: - /// - /// [name] - The resource name of the Organization to fetch. This is the - /// organization's relative path in the API, formatted as - /// "organizations/\[organizationId\]". For example, "organizations/1234". - /// Value must have pattern `^organizations/\[^/\]+$`. - /// - /// [organizationId] - The id of the Organization resource to fetch. This - /// field is deprecated and will be removed in v1. Use name instead. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Organization]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Organization> get( - core.String name, { - core.String organizationId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (organizationId != null) { - _queryParams['organizationId'] = [organizationId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Organization.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for an Organization resource. - /// - /// May be empty if no such policy or resource exists. The `resource` field - /// should be the organization's resource name, e.g. "organizations/123". - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^organizations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - GetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists Organization resources that are visible to the user and satisfy the - /// specified filter. - /// - /// This method returns Organizations in an unspecified order. New - /// Organizations do not necessarily appear at the end of the list. - /// - /// Request parameters: - /// - /// [filter] - An optional query string used to filter the Organizations to - /// return in the response. Filter rules are case-insensitive. Organizations - /// may be filtered by `owner.directoryCustomerId` or by `domain`, where the - /// domain is a G Suite domain, for example: * Filter - /// `owner.directorycustomerid:123456789` returns Organization resources with - /// `owner.directory_customer_id` equal to `123456789`. * Filter - /// `domain:google.com` returns Organization resources corresponding to the - /// domain `google.com`. This field is optional. - /// - /// [pageSize] - The maximum number of Organizations to return in the - /// response. This field is optional. - /// - /// [pageToken] - A pagination token returned from a previous call to - /// `ListOrganizations` that indicates from where listing should continue. - /// This field is optional. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOrganizationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOrganizationsResponse> list({ - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/organizations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOrganizationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on an Organization resource. - /// - /// Replaces any existing policy. The `resource` field should be the - /// organization's resource name, e.g. "organizations/123". - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^organizations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified Organization. - /// - /// The `resource` field should be the organization's resource name, e.g. - /// "organizations/123". - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^organizations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates an Organization resource identified by the specified resource - /// name. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Output only. The resource name of the organization. This is the - /// organization's relative path in the API. Its format is - /// "organizations/\[organization_id\]". For example, "organizations/1234". - /// Value must have pattern `^organizations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Organization]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Organization> update( - Organization request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Organization.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a Project resource. - /// - /// Initially, the Project resource is owned by its creator exclusively. The - /// creator can later grant permission to others to read or update the - /// Project. Several APIs are activated automatically for the Project, - /// including Google Cloud Storage. The parent is identified by a specified - /// ResourceId, which must include both an ID and a type, such as project, - /// folder, or organization. This method does not associate the new project - /// with a billing account. You can set or update the billing account - /// associated with a project using the \[`projects.updateBillingInfo`\] - /// (/billing/reference/rest/v1/projects/updateBillingInfo) method. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [useLegacyStack] - A now unused experiment opt-out option. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Project]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Project> create( - Project request, { - core.bool useLegacyStack, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (useLegacyStack != null) { - _queryParams['useLegacyStack'] = ['${useLegacyStack}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Project.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Marks the Project identified by the specified `project_id` (for example, - /// `my-project-123`) for deletion. - /// - /// This method will only affect the Project if it has a lifecycle state of - /// ACTIVE. This method changes the Project's lifecycle state from ACTIVE to - /// DELETE_REQUESTED. The deletion starts at an unspecified time, at which - /// point the project is no longer accessible. Until the deletion completes, - /// you can check the lifecycle state checked by retrieving the Project with - /// GetProject, and the Project remains visible to ListProjects. However, you - /// cannot update the project. After the deletion completes, the Project is - /// not retrievable by the GetProject and ListProjects methods. The caller - /// must have delete permissions for this Project. - /// - /// Request parameters: - /// - /// [projectId] - The Project ID (for example, `foo-bar-123`). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String projectId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (projectId == null) { - throw core.ArgumentError('Parameter projectId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the Project identified by the specified `project_id` (for - /// example, `my-project-123`). - /// - /// The caller must have read permissions for this Project. - /// - /// Request parameters: - /// - /// [projectId] - Required. The Project ID (for example, `my-project-123`). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Project]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Project> get( - core.String projectId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (projectId == null) { - throw core.ArgumentError('Parameter projectId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Project.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a list of ancestors in the resource hierarchy for the Project - /// identified by the specified `project_id` (for example, `my-project-123`). - /// - /// The caller must have read permissions for this Project. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [projectId] - Required. The Project ID (for example, `my-project-123`). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GetAncestryResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GetAncestryResponse> getAncestry( - GetAncestryRequest request, - core.String projectId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (projectId == null) { - throw core.ArgumentError('Parameter projectId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + - commons.Escaper.ecapeVariable('$projectId') + - ':getAncestry'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GetAncestryResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the IAM access control policy for the specified Project. - /// - /// Permission is denied if the policy or the resource does not exist. For - /// additional information about resource structure and identification, see - /// \[Resource Names\](/apis/design/resource_names). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - GetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + - commons.Escaper.ecapeVariable('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists Projects that the caller has the `resourcemanager.projects.get` - /// permission on and satisfy the specified filter. - /// - /// This method returns Projects in an unspecified order. This method is - /// eventually consistent with project mutations; this means that a newly - /// created project may not appear in the results or recent updates to an - /// existing project may not be reflected in the results. To retrieve the - /// latest state of a project, use the GetProject method. NOTE: If the request - /// filter contains a `parent.type` and `parent.id` and the caller has the - /// `resourcemanager.projects.list` permission on the parent, the results will - /// be drawn from an alternate index which provides more consistent results. - /// In future versions of this API, this List method will be split into List - /// and Search to properly capture the behavioral difference. - /// - /// Request parameters: - /// - /// [filter] - An expression for filtering the results of the request. Filter - /// rules are case insensitive. If multiple fields are included in a filter - /// query, the query will return results that match any of the fields. Some - /// eligible fields for filtering are: + `name` + `id` + `labels.` (where - /// *key* is the name of a label) + `parent.type` + `parent.id` Some examples - /// of using labels as filters: | Filter | Description | - /// |------------------|-----------------------------------------------------| - /// | name:how* | The project's name starts with "how". | | name:Howl | The - /// project's name is `Howl` or `howl`. | | name:HOWL | Equivalent to above. | - /// | NAME:howl | Equivalent to above. | | labels.color:* | The project has - /// the label `color`. | | labels.color:red | The project's label `color` has - /// the value `red`. | | labels.color:red labels.size:big |The project's label - /// `color` has the value `red` and its label `size` has the value `big`. | If - /// no filter is specified, the call will return projects for which the user - /// has the `resourcemanager.projects.get` permission. NOTE: To perform a - /// by-parent query (eg., what projects are directly in a Folder), the caller - /// must have the `resourcemanager.projects.list` permission on the parent and - /// the filter must contain both a `parent.type` and a `parent.id` restriction - /// (example: "parent.type:folder parent.id:123"). In this case an alternate - /// search index is used which provides more consistent results. Optional. - /// - /// [pageSize] - The maximum number of Projects to return in the response. The - /// server can return fewer Projects than requested. If unspecified, server - /// picks an appropriate default. Optional. - /// - /// [pageToken] - A pagination token returned from a previous call to - /// ListProjects that indicates from where listing should continue. Optional. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListProjectsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListProjectsResponse> list({ - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListProjectsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the IAM access control policy for the specified Project. - /// - /// CAUTION: This method will replace the existing policy, and cannot be used - /// to append additional IAM settings. NOTE: Removing service accounts from - /// policies or changing their roles can render services completely - /// inoperable. It is important to understand how the service account is being - /// used before removing or updating its roles. The following constraints - /// apply when using `setIamPolicy()`: + Project does not support `allUsers` - /// and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + - /// The owner role can be granted to a `user`, `serviceAccount`, or a group - /// that is part of an organization. For example, - /// group@myownpersonaldomain.com could be added as an owner to a project in - /// the myownpersonaldomain.com organization, but not the examplepetstore.com - /// organization. + Service accounts can be made owners of a project directly - /// without any restrictions. However, to be added as an owner, a user must be - /// invited via Cloud Platform console and must accept the invitation. + A - /// user cannot be granted the owner role using `setIamPolicy()`. The user - /// must be granted the owner role using the Cloud Platform Console and must - /// explicitly accept the invitation. + Invitations to grant the owner role - /// cannot be sent using `setIamPolicy()`; they must be sent only using the - /// Cloud Platform Console. + Membership changes that leave the project - /// without any owners that have accepted the Terms of Service (ToS) will be - /// rejected. + If the project is not part of an organization, there must be - /// at least one owner who has accepted the Terms of Service (ToS) agreement - /// in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted - /// owner from the policy will fail. This restriction also applies to legacy - /// projects that no longer have owners who have accepted the ToS. Edits to - /// IAM policies will be rejected until the lack of a ToS-accepting owner is - /// rectified. Authorization requires the Google IAM permission - /// `resourcemanager.projects.setIamPolicy` on the project - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + - commons.Escaper.ecapeVariable('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified Project. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + - commons.Escaper.ecapeVariable('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Restores the Project identified by the specified `project_id` (for - /// example, `my-project-123`). - /// - /// You can only use this method for a Project that has a lifecycle state of - /// DELETE_REQUESTED. After deletion starts, the Project cannot be restored. - /// The caller must have undelete permissions for this Project. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [projectId] - Required. The project ID (for example, `foo-bar-123`). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> undelete( - UndeleteProjectRequest request, - core.String projectId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (projectId == null) { - throw core.ArgumentError('Parameter projectId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + - commons.Escaper.ecapeVariable('$projectId') + - ':undelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the attributes of the Project identified by the specified - /// `project_id` (for example, `my-project-123`). - /// - /// The caller must have modify permissions for this Project. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [projectId] - The project ID (for example, `my-project-123`). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Project]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Project> update( - Project request, - core.String projectId, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (projectId == null) { - throw core.ArgumentError('Parameter projectId is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Project.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Identifying information for a single ancestor of a project. -class Ancestor { - /// Resource id of the ancestor. - ResourceId resourceId; - - Ancestor(); - - Ancestor.fromJson(core.Map _json) { - if (_json.containsKey('resourceId')) { - resourceId = ResourceId.fromJson( - _json['resourceId'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (resourceId != null) { - _json['resourceId'] = resourceId.toJson(); - } - return _json; - } -} - -/// Specifies the audit configuration for a service. -/// -/// The configuration determines which permission types are logged, and what -/// identities, if any, are exempted from logging. An AuditConfig must have one -/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` -/// and a specific service, the union of the two AuditConfigs is used for that -/// service: the log_types specified in each AuditConfig are enabled, and the -/// exempted_members in each AuditLogConfig are exempted. Example Policy with -/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", -/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ -/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": -/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", -/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": -/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } -/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts jose@example.com from DATA_READ logging, and -/// aliya@example.com from DATA_WRITE logging. -class AuditConfig { - /// The configuration for logging of each type of permission. - core.List<AuditLogConfig> auditLogConfigs; - - /// Specifies a service that will be enabled for audit logging. - /// - /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - /// `allServices` is a special value that covers all services. - core.String service; - - AuditConfig(); - - AuditConfig.fromJson(core.Map _json) { - if (_json.containsKey('auditLogConfigs')) { - auditLogConfigs = (_json['auditLogConfigs'] as core.List) - .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('service')) { - service = _json['service'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditLogConfigs != null) { - _json['auditLogConfigs'] = - auditLogConfigs.map((value) => value.toJson()).toList(); - } - if (service != null) { - _json['service'] = service; - } - return _json; - } -} - -/// Provides the configuration for logging a type of permissions. -/// -/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", -/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": -/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while -/// exempting jose@example.com from DATA_READ logging. -class AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// - /// Follows the same format of Binding.members. - core.List<core.String> exemptedMembers; - - /// The log type that this config enables. - /// Possible string values are: - /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. - /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy - /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create - /// - "DATA_READ" : Data reads. Example: CloudSQL Users list - core.String logType; - - AuditLogConfig(); - - AuditLogConfig.fromJson(core.Map _json) { - if (_json.containsKey('exemptedMembers')) { - exemptedMembers = (_json['exemptedMembers'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('logType')) { - logType = _json['logType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exemptedMembers != null) { - _json['exemptedMembers'] = exemptedMembers; - } - if (logType != null) { - _json['logType'] = logType; - } - return _json; - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Metadata describing a long running folder operation -class FolderOperation { - /// The resource name of the folder or organization we are either creating the - /// folder under or moving the folder to. - core.String destinationParent; - - /// The display name of the folder. - core.String displayName; - - /// The type of this operation. - /// Possible string values are: - /// - "OPERATION_TYPE_UNSPECIFIED" : Operation type not specified. - /// - "CREATE" : A create folder operation. - /// - "MOVE" : A move folder operation. - core.String operationType; - - /// The resource name of the folder's parent. - /// - /// Only applicable when the operation_type is MOVE. - core.String sourceParent; - - FolderOperation(); - - FolderOperation.fromJson(core.Map _json) { - if (_json.containsKey('destinationParent')) { - destinationParent = _json['destinationParent'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('operationType')) { - operationType = _json['operationType'] as core.String; - } - if (_json.containsKey('sourceParent')) { - sourceParent = _json['sourceParent'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (destinationParent != null) { - _json['destinationParent'] = destinationParent; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (operationType != null) { - _json['operationType'] = operationType; - } - if (sourceParent != null) { - _json['sourceParent'] = sourceParent; - } - return _json; - } -} - -/// A classification of the Folder Operation error. -class FolderOperationError { - /// The type of operation error experienced. - /// Possible string values are: - /// - "ERROR_TYPE_UNSPECIFIED" : The error type was unrecognized or - /// unspecified. - /// - "ACTIVE_FOLDER_HEIGHT_VIOLATION" : The attempted action would violate - /// the max folder depth constraint. - /// - "MAX_CHILD_FOLDERS_VIOLATION" : The attempted action would violate the - /// max child folders constraint. - /// - "FOLDER_NAME_UNIQUENESS_VIOLATION" : The attempted action would violate - /// the locally-unique folder display_name constraint. - /// - "RESOURCE_DELETED_VIOLATION" : The resource being moved has been - /// deleted. - /// - "PARENT_DELETED_VIOLATION" : The resource a folder was being added to - /// has been deleted. - /// - "CYCLE_INTRODUCED_VIOLATION" : The attempted action would introduce - /// cycle in resource path. - /// - "FOLDER_BEING_MOVED_VIOLATION" : The attempted action would move a - /// folder that is already being moved. - /// - "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" : The folder the caller is trying - /// to delete contains active resources. - /// - "DELETED_FOLDER_HEIGHT_VIOLATION" : The attempted action would violate - /// the max deleted folder depth constraint. - core.String errorMessageId; - - FolderOperationError(); - - FolderOperationError.fromJson(core.Map _json) { - if (_json.containsKey('errorMessageId')) { - errorMessageId = _json['errorMessageId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (errorMessageId != null) { - _json['errorMessageId'] = errorMessageId; - } - return _json; - } -} - -/// The request sent to the -/// \[google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetAncestry\] -/// method. -class GetAncestryRequest { - GetAncestryRequest(); - - GetAncestryRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Response from the projects.getAncestry method. -class GetAncestryResponse { - /// Ancestors are ordered from bottom to top of the resource hierarchy. - /// - /// The first ancestor is the project itself, followed by the project's - /// parent, etc. - core.List<Ancestor> ancestor; - - GetAncestryResponse(); - - GetAncestryResponse.fromJson(core.Map _json) { - if (_json.containsKey('ancestor')) { - ancestor = (_json['ancestor'] as core.List) - .map<Ancestor>((value) => - Ancestor.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ancestor != null) { - _json['ancestor'] = ancestor.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Request message for `GetIamPolicy` method. -class GetIamPolicyRequest { - /// OPTIONAL: A `GetPolicyOptions` object for specifying options to - /// `GetIamPolicy`. - GetPolicyOptions options; - - GetIamPolicyRequest(); - - GetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('options')) { - options = GetPolicyOptions.fromJson( - _json['options'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (options != null) { - _json['options'] = options.toJson(); - } - return _json; - } -} - -/// Encapsulates settings provided to GetIamPolicy. -class GetPolicyOptions { - /// The policy format version to be returned. - /// - /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be - /// rejected. Requests for policies with any conditional bindings must specify - /// version 3. Policies without any conditional bindings may specify any valid - /// value or leave the field unset. To learn which resources support - /// conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// Optional. - core.int requestedPolicyVersion; - - GetPolicyOptions(); - - GetPolicyOptions.fromJson(core.Map _json) { - if (_json.containsKey('requestedPolicyVersion')) { - requestedPolicyVersion = _json['requestedPolicyVersion'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (requestedPolicyVersion != null) { - _json['requestedPolicyVersion'] = requestedPolicyVersion; - } - return _json; - } -} - -/// The response returned from the `ListOrganizations` method. -class ListOrganizationsResponse { - /// A pagination token to be used to retrieve the next page of results. - /// - /// If the result is too large to fit within the page size specified in the - /// request, this field will be set with a token that can be used to fetch the - /// next page of results. If this field is empty, it indicates that this - /// response contains the last page of results. - core.String nextPageToken; - - /// The list of Organizations that matched the list query, possibly paginated. - core.List<Organization> organizations; - - ListOrganizationsResponse(); - - ListOrganizationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('organizations')) { - organizations = (_json['organizations'] as core.List) - .map<Organization>((value) => Organization.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (organizations != null) { - _json['organizations'] = - organizations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A page of the response received from the ListProjects method. -/// -/// A paginated response where more pages are available has `next_page_token` -/// set. This token can be used in a subsequent request to retrieve the next -/// request page. -class ListProjectsResponse { - /// Pagination token. - /// - /// If the result set is too large to fit in a single response, this token is - /// returned. It encodes the position of the current result cursor. Feeding - /// this value into a new list request with the `page_token` parameter gives - /// the next page of the results. When `next_page_token` is not filled in, - /// there is no next page and the list returned is the last page in the result - /// set. Pagination tokens have a limited lifetime. - core.String nextPageToken; - - /// The list of Projects that matched the list filter. - /// - /// This list can be paginated. - core.List<Project> projects; - - ListProjectsResponse(); - - ListProjectsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('projects')) { - projects = (_json['projects'] as core.List) - .map<Project>((value) => - Project.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (projects != null) { - _json['projects'] = projects.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The root node in the resource hierarchy to which a particular entity's -/// (e.g., company) resources belong. -class Organization { - /// Timestamp when the Organization was created. - /// - /// Assigned by the server. - core.String creationTime; - - /// A human-readable string that refers to the Organization in the GCP Console - /// UI. - /// - /// This string is set by the server and cannot be changed. The string will be - /// set to the primary domain (for example, "google.com") of the G Suite - /// customer that owns the organization. - core.String displayName; - - /// The organization's current lifecycle state. - /// - /// Assigned by the server. - /// Possible string values are: - /// - "LIFECYCLE_STATE_UNSPECIFIED" : Unspecified state. This is only useful - /// for distinguishing unset values. - /// - "ACTIVE" : The normal and active state. - /// - "DELETE_REQUESTED" : The organization has been marked for deletion by - /// the user. - core.String lifecycleState; - - /// The resource name of the organization. - /// - /// This is the organization's relative path in the API. Its format is - /// "organizations/\[organization_id\]". For example, "organizations/1234". - /// - /// Output only. - core.String name; - - /// An immutable id for the Organization that is assigned on creation. - /// - /// This should be omitted when creating a new Organization. This field is - /// read-only. - core.String organizationId; - - /// The owner of this Organization. - /// - /// The owner should be specified on creation. Once set, it cannot be changed. - /// This field is required. - OrganizationOwner owner; - - Organization(); - - Organization.fromJson(core.Map _json) { - if (_json.containsKey('creationTime')) { - creationTime = _json['creationTime'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('lifecycleState')) { - lifecycleState = _json['lifecycleState'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('organizationId')) { - organizationId = _json['organizationId'] as core.String; - } - if (_json.containsKey('owner')) { - owner = OrganizationOwner.fromJson( - _json['owner'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (creationTime != null) { - _json['creationTime'] = creationTime; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (lifecycleState != null) { - _json['lifecycleState'] = lifecycleState; - } - if (name != null) { - _json['name'] = name; - } - if (organizationId != null) { - _json['organizationId'] = organizationId; - } - if (owner != null) { - _json['owner'] = owner.toJson(); - } - return _json; - } -} - -/// The entity that owns an Organization. -/// -/// The lifetime of the Organization and all of its descendants are bound to the -/// `OrganizationOwner`. If the `OrganizationOwner` is deleted, the Organization -/// and all its descendants will be deleted. -class OrganizationOwner { - /// The G Suite customer id used in the Directory API. - core.String directoryCustomerId; - - OrganizationOwner(); - - OrganizationOwner.fromJson(core.Map _json) { - if (_json.containsKey('directoryCustomerId')) { - directoryCustomerId = _json['directoryCustomerId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (directoryCustomerId != null) { - _json['directoryCustomerId'] = directoryCustomerId; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Specifies cloud audit logging configuration for this policy. - core.List<AuditConfig> auditConfigs; - - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('auditConfigs')) { - auditConfigs = (_json['auditConfigs'] as core.List) - .map<AuditConfig>((value) => AuditConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditConfigs != null) { - _json['auditConfigs'] = - auditConfigs.map((value) => value.toJson()).toList(); - } - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// A Project is a high-level Google Cloud Platform entity. -/// -/// It is a container for ACLs, APIs, App Engine Apps, VMs, and other Google -/// Cloud Platform resources. -class Project { - /// Creation time. - /// - /// Read-only. - core.String createTime; - - /// The labels associated with this Project. - /// - /// Label keys must be between 1 and 63 characters long and must conform to - /// the following regular expression: a-z{0,62}. Label values must be between - /// 0 and 63 characters long and must conform to the regular expression - /// \[a-z0-9_-\]{0,63}. A label value can be empty. No more than 256 labels - /// can be associated with a given resource. Clients should store labels in a - /// representation such as JSON that does not depend on specific characters - /// being disallowed. Example: `"environment" : "dev"` Read-write. - core.Map<core.String, core.String> labels; - - /// The Project lifecycle state. - /// - /// Read-only. - /// Possible string values are: - /// - "LIFECYCLE_STATE_UNSPECIFIED" : Unspecified state. This is only - /// used/useful for distinguishing unset values. - /// - "ACTIVE" : The normal and active state. - /// - "DELETE_REQUESTED" : The project has been marked for deletion by the - /// user (by invoking DeleteProject) or by the system (Google Cloud Platform). - /// This can generally be reversed by invoking UndeleteProject. - /// - "DELETE_IN_PROGRESS" : This lifecycle state is no longer used and is not - /// returned by the API. - core.String lifecycleState; - - /// The optional user-assigned display name of the Project. - /// - /// When present it must be between 4 to 30 characters. Allowed characters - /// are: lowercase and uppercase letters, numbers, hyphen, single-quote, - /// double-quote, space, and exclamation point. Example: `My Project` - /// Read-write. - core.String name; - - /// An optional reference to a parent Resource. - /// - /// Supported parent types include "organization" and "folder". Once set, the - /// parent cannot be cleared. The `parent` can be set on creation or using the - /// `UpdateProject` method; the end user must have the - /// `resourcemanager.projects.create` permission on the parent. Read-write. - ResourceId parent; - - /// The unique, user-assigned ID of the Project. - /// - /// It must be 6 to 30 lowercase letters, digits, or hyphens. It must start - /// with a letter. Trailing hyphens are prohibited. Example: `tokyo-rain-123` - /// Read-only after creation. - core.String projectId; - - /// The number uniquely identifying the project. - /// - /// Example: `415104041262` Read-only. - core.String projectNumber; - - Project(); - - Project.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('lifecycleState')) { - lifecycleState = _json['lifecycleState'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parent')) { - parent = ResourceId.fromJson( - _json['parent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('projectId')) { - projectId = _json['projectId'] as core.String; - } - if (_json.containsKey('projectNumber')) { - projectNumber = _json['projectNumber'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (labels != null) { - _json['labels'] = labels; - } - if (lifecycleState != null) { - _json['lifecycleState'] = lifecycleState; - } - if (name != null) { - _json['name'] = name; - } - if (parent != null) { - _json['parent'] = parent.toJson(); - } - if (projectId != null) { - _json['projectId'] = projectId; - } - if (projectNumber != null) { - _json['projectNumber'] = projectNumber; - } - return _json; - } -} - -/// A status object which is used as the `metadata` field for the Operation -/// returned by CreateProject. -/// -/// It provides insight for when significant phases of Project creation have -/// completed. -class ProjectCreationStatus { - /// Creation time of the project creation workflow. - core.String createTime; - - /// True if the project can be retrieved using GetProject. - /// - /// No other operations on the project are guaranteed to work until the - /// project creation is complete. - core.bool gettable; - - /// True if the project creation process is complete. - core.bool ready; - - ProjectCreationStatus(); - - ProjectCreationStatus.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('gettable')) { - gettable = _json['gettable'] as core.bool; - } - if (_json.containsKey('ready')) { - ready = _json['ready'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (gettable != null) { - _json['gettable'] = gettable; - } - if (ready != null) { - _json['ready'] = ready; - } - return _json; - } -} - -/// A container to reference an id for any resource type. -/// -/// A `resource` in Google Cloud Platform is a generic term for something you (a -/// developer) may want to interact with through one of our API's. Some examples -/// are an App Engine app, a Compute Engine instance, a Cloud SQL database, and -/// so on. -class ResourceId { - /// Required field for the type-specific id. - /// - /// This should correspond to the id used in the type-specific API's. - core.String id; - - /// Required field representing the resource type this id is for. - /// - /// At present, the valid types are "project", "folder", and "organization". - core.String type; - - ResourceId(); - - ResourceId.fromJson(core.Map _json) { - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (id != null) { - _json['id'] = id; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. - /// - /// Only the fields in the mask will be modified. If no mask is provided, the - /// following default mask is used: `paths: "bindings, etag"` - core.String updateMask; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// The request sent to the UndeleteProject method. -class UndeleteProjectRequest { - UndeleteProjectRequest(); - - UndeleteProjectRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/containeranalysis/v1beta1.dart b/generated/googleapis_beta/lib/containeranalysis/v1beta1.dart index e3891a9..1f71bf5 100644 --- a/generated/googleapis_beta/lib/containeranalysis/v1beta1.dart +++ b/generated/googleapis_beta/lib/containeranalysis/v1beta1.dart
@@ -1871,7 +1871,7 @@ /// Request to create notes in batch. class BatchCreateNotesRequest { - /// The notes to create. + /// The notes to create, the key is expected to be the note ID. /// /// Max allowed length is 1000. /// @@ -1984,11 +1984,6 @@ /// Associates `members` with a `role`. class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - /// The condition that is associated with this binding. /// /// If the condition evaluates to `true`, then this binding applies to the @@ -2039,9 +2034,6 @@ Binding(); Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } if (_json.containsKey('condition')) { condition = Expr.fromJson( _json['condition'] as core.Map<core.String, core.dynamic>); @@ -2058,9 +2050,6 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } if (condition != null) { _json['condition'] = condition.toJson(); } @@ -2868,6 +2857,9 @@ /// The severity (eg: distro assigned severity) for this vulnerability. core.String severityName; + /// The source from which the information in this Detail was obtained. + core.String source; + /// The time this information was last changed at the source. /// /// This is an upstream timestamp from the underlying information source - @@ -2907,6 +2899,9 @@ if (_json.containsKey('severityName')) { severityName = _json['severityName'] as core.String; } + if (_json.containsKey('source')) { + source = _json['source'] as core.String; + } if (_json.containsKey('sourceUpdateTime')) { sourceUpdateTime = _json['sourceUpdateTime'] as core.String; } @@ -2941,6 +2936,9 @@ if (severityName != null) { _json['severityName'] = severityName; } + if (source != null) { + _json['source'] = source; + } if (sourceUpdateTime != null) { _json['sourceUpdateTime'] = sourceUpdateTime; } @@ -3049,7 +3047,7 @@ /// /// Required. Immutable. /// Possible string values are: - /// - "NOTE_KIND_UNSPECIFIED" : Unknown. + /// - "NOTE_KIND_UNSPECIFIED" : Default value. This value is unused. /// - "VULNERABILITY" : The note and occurrence represent a package /// vulnerability. /// - "BUILD" : The note and occurrence assert build provenance. @@ -4642,7 +4640,7 @@ /// /// Output only. /// Possible string values are: - /// - "NOTE_KIND_UNSPECIFIED" : Unknown. + /// - "NOTE_KIND_UNSPECIFIED" : Default value. This value is unused. /// - "VULNERABILITY" : The note and occurrence represent a package /// vulnerability. /// - "BUILD" : The note and occurrence assert build provenance. @@ -4847,7 +4845,7 @@ /// /// Output only. /// Possible string values are: - /// - "NOTE_KIND_UNSPECIFIED" : Unknown. + /// - "NOTE_KIND_UNSPECIFIED" : Default value. This value is unused. /// - "VULNERABILITY" : The note and occurrence represent a package /// vulnerability. /// - "BUILD" : The note and occurrence assert build provenance. @@ -5911,6 +5909,15 @@ /// Used to correct mistakes in the version numbering scheme. core.int epoch; + /// Whether this version is specifying part of an inclusive range. + /// + /// Grafeas does not have the capability to specify version ranges; instead we + /// have fields that specify start version and end versions. At times this is + /// insufficient - we also need to specify whether the version is included in + /// the range or is excluded from the range. This boolean is expected to be + /// set to true when the version is included in a range. + core.bool inclusive; + /// Distinguishes between sentinel MIN/MAX versions and normal versions. /// /// Required. @@ -5935,6 +5942,9 @@ if (_json.containsKey('epoch')) { epoch = _json['epoch'] as core.int; } + if (_json.containsKey('inclusive')) { + inclusive = _json['inclusive'] as core.bool; + } if (_json.containsKey('kind')) { kind = _json['kind'] as core.String; } @@ -5951,6 +5961,9 @@ if (epoch != null) { _json['epoch'] = epoch; } + if (inclusive != null) { + _json['inclusive'] = inclusive; + } if (kind != null) { _json['kind'] = kind; }
diff --git a/generated/googleapis_beta/lib/datacatalog/v1beta1.dart b/generated/googleapis_beta/lib/datacatalog/v1beta1.dart index d7d5b6c..e7341a1 100644 --- a/generated/googleapis_beta/lib/datacatalog/v1beta1.dart +++ b/generated/googleapis_beta/lib/datacatalog/v1beta1.dart
@@ -3877,11 +3877,6 @@ /// Associates `members` with a `role`. class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - /// The condition that is associated with this binding. /// /// If the condition evaluates to `true`, then this binding applies to the @@ -3932,9 +3927,6 @@ Binding(); Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } if (_json.containsKey('condition')) { condition = Expr.fromJson( _json['condition'] as core.Map<core.String, core.dynamic>); @@ -3951,9 +3943,6 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } if (condition != null) { _json['condition'] = condition.toJson(); } @@ -4359,6 +4348,7 @@ /// - "INTEGRATED_SYSTEM_UNSPECIFIED" : Default unknown system. /// - "BIGQUERY" : BigQuery. /// - "CLOUD_PUBSUB" : Cloud Pub/Sub. + /// - "DPMS" : Dataproc Metastore - Managed Hive Metastore. core.String integratedSystem; /// The resource this metadata entry refers to. @@ -4668,18 +4658,6 @@ } class GoogleCloudDatacatalogV1beta1FieldTypeEnumType { - /// The set of allowed values for this enum. - /// - /// This set must not be empty, the display names of the values in this set - /// must not be empty and the display names of the values must be - /// case-insensitively unique within this set. The order of items in this list - /// is preserved. This field can be used to Required on create; optional on - /// update. The set of allowed values for this enum. This set must not be - /// empty, the display names of the values in this set must not be empty and - /// the display names of the values must be case-insensitively unique within - /// this set. Currently, enum values can only be added to the list of allowed - /// values. Deletion and renaming of enum values are not supported. Can have - /// up to 500 allowed values. core.List<GoogleCloudDatacatalogV1beta1FieldTypeEnumTypeEnumValue> allowedValues; @@ -5509,6 +5487,9 @@ /// `//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId` core.String linkedResource; + /// Last-modified timestamp of the entry from the managing system. + core.String modifyTime; + /// The relative resource name of the resource in URL format. /// /// Examples: * @@ -5540,6 +5521,9 @@ if (_json.containsKey('linkedResource')) { linkedResource = _json['linkedResource'] as core.String; } + if (_json.containsKey('modifyTime')) { + modifyTime = _json['modifyTime'] as core.String; + } if (_json.containsKey('relativeResourceName')) { relativeResourceName = _json['relativeResourceName'] as core.String; } @@ -5556,6 +5540,9 @@ if (linkedResource != null) { _json['linkedResource'] = linkedResource; } + if (modifyTime != null) { + _json['modifyTime'] = modifyTime; + } if (relativeResourceName != null) { _json['relativeResourceName'] = relativeResourceName; } @@ -5636,6 +5623,9 @@ /// /// Used for taxonomy import/export and mutation. class GoogleCloudDatacatalogV1beta1SerializedTaxonomy { + /// A list of policy types that are activated for a taxonomy. + core.List<core.String> activatedPolicyTypes; + /// Description of the serialized taxonomy. /// /// The length of the description is limited to 2000 bytes when encoded in @@ -5655,6 +5645,11 @@ GoogleCloudDatacatalogV1beta1SerializedTaxonomy(); GoogleCloudDatacatalogV1beta1SerializedTaxonomy.fromJson(core.Map _json) { + if (_json.containsKey('activatedPolicyTypes')) { + activatedPolicyTypes = (_json['activatedPolicyTypes'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } if (_json.containsKey('description')) { description = _json['description'] as core.String; } @@ -5672,6 +5667,9 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; + if (activatedPolicyTypes != null) { + _json['activatedPolicyTypes'] = activatedPolicyTypes; + } if (description != null) { _json['description'] = description; } @@ -6032,6 +6030,11 @@ /// The template for an individual field within a tag template. class GoogleCloudDatacatalogV1beta1TagTemplateField { + /// The description for this field. + /// + /// Defaults to an empty string. + core.String description; + /// The display name for this field. /// /// Defaults to an empty string. @@ -6067,6 +6070,9 @@ GoogleCloudDatacatalogV1beta1TagTemplateField(); GoogleCloudDatacatalogV1beta1TagTemplateField.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } if (_json.containsKey('displayName')) { displayName = _json['displayName'] as core.String; } @@ -6087,6 +6093,9 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } if (displayName != null) { _json['displayName'] = displayName; } @@ -6145,6 +6154,18 @@ /// Output only. core.String name; + /// Number of policy tags contained in this taxonomy. + /// + /// Output only. + core.int policyTagCount; + + /// Timestamps about this taxonomy. + /// + /// Only create_time and update_time are used. + /// + /// Output only. + GoogleCloudDatacatalogV1beta1SystemTimestamps taxonomyTimestamps; + GoogleCloudDatacatalogV1beta1Taxonomy(); GoogleCloudDatacatalogV1beta1Taxonomy.fromJson(core.Map _json) { @@ -6162,6 +6183,15 @@ if (_json.containsKey('name')) { name = _json['name'] as core.String; } + if (_json.containsKey('policyTagCount')) { + policyTagCount = _json['policyTagCount'] as core.int; + } + if (_json.containsKey('taxonomyTimestamps')) { + taxonomyTimestamps = + GoogleCloudDatacatalogV1beta1SystemTimestamps.fromJson( + _json['taxonomyTimestamps'] + as core.Map<core.String, core.dynamic>); + } } core.Map<core.String, core.Object> toJson() { @@ -6178,6 +6208,12 @@ if (name != null) { _json['name'] = name; } + if (policyTagCount != null) { + _json['policyTagCount'] = policyTagCount; + } + if (taxonomyTimestamps != null) { + _json['taxonomyTimestamps'] = taxonomyTimestamps.toJson(); + } return _json; } }
diff --git a/generated/googleapis_beta/lib/dataflow/v1b3.dart b/generated/googleapis_beta/lib/dataflow/v1b3.dart index bccd339..57bf53f 100644 --- a/generated/googleapis_beta/lib/dataflow/v1b3.dart +++ b/generated/googleapis_beta/lib/dataflow/v1b3.dart
@@ -657,8 +657,8 @@ /// [pageToken] - Set this to the 'next_page_token' field of a previous /// response to request additional results in a long list. /// - /// [view] - Level of information requested in response. Default is - /// `JOB_VIEW_SUMMARY`. + /// [view] - Deprecated. ListJobs always returns summaries now. Use GetJob for + /// other JobViews. /// Possible string values are: /// - "JOB_VIEW_UNKNOWN" : The job view to return isn't specified, or is /// unknown. Responses will contain at least the `JOB_VIEW_SUMMARY` @@ -1040,8 +1040,8 @@ /// [pageToken] - Set this to the 'next_page_token' field of a previous /// response to request additional results in a long list. /// - /// [view] - Level of information requested in response. Default is - /// `JOB_VIEW_SUMMARY`. + /// [view] - Deprecated. ListJobs always returns summaries now. Use GetJob for + /// other JobViews. /// Possible string values are: /// - "JOB_VIEW_UNKNOWN" : The job view to return isn't specified, or is /// unknown. Responses will contain at least the `JOB_VIEW_SUMMARY` @@ -2271,8 +2271,8 @@ /// [pageToken] - Set this to the 'next_page_token' field of a previous /// response to request additional results in a long list. /// - /// [view] - Level of information requested in response. Default is - /// `JOB_VIEW_SUMMARY`. + /// [view] - Deprecated. ListJobs always returns summaries now. Use GetJob for + /// other JobViews. /// Possible string values are: /// - "JOB_VIEW_UNKNOWN" : The job view to return isn't specified, or is /// unknown. Responses will contain at least the `JOB_VIEW_SUMMARY` @@ -4867,6 +4867,9 @@ /// Container Spec. class ContainerSpec { + /// Default runtime environment for the job. + FlexTemplateRuntimeEnvironment defaultEnvironment; + /// Name of the docker container image. /// /// E.g., gcr.io/project/some-image @@ -4883,6 +4886,10 @@ ContainerSpec(); ContainerSpec.fromJson(core.Map _json) { + if (_json.containsKey('defaultEnvironment')) { + defaultEnvironment = FlexTemplateRuntimeEnvironment.fromJson( + _json['defaultEnvironment'] as core.Map<core.String, core.dynamic>); + } if (_json.containsKey('image')) { image = _json['image'] as core.String; } @@ -4898,6 +4905,9 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; + if (defaultEnvironment != null) { + _json['defaultEnvironment'] = defaultEnvironment.toJson(); + } if (image != null) { _json['image'] = image; } @@ -6169,6 +6179,10 @@ /// - "JOB_STATE_QUEUED" : `JOB_STATE_QUEUED` indicates that the job has been /// created but is being delayed until launch. Jobs that are queued may only /// transition to `JOB_STATE_PENDING` or `JOB_STATE_CANCELLED`. + /// - "JOB_STATE_RESOURCE_CLEANING_UP" : `JOB_STATE_RESOURCE_CLEANING_UP` + /// indicates that the batch job's associated resources are currently being + /// cleaned up after a successful run. Currently, this is an opt-in feature, + /// please reach out to Cloud support team if you are intersted. core.String executionStageState; ExecutionStageState(); @@ -6239,6 +6253,9 @@ /// Output sources for this stage. core.List<StageSource> outputSource; + /// Other stages that must complete before this stage can run. + core.List<core.String> prerequisiteStage; + ExecutionStageSummary(); ExecutionStageSummary.fromJson(core.Map _json) { @@ -6275,6 +6292,11 @@ value as core.Map<core.String, core.dynamic>)) .toList(); } + if (_json.containsKey('prerequisiteStage')) { + prerequisiteStage = (_json['prerequisiteStage'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } } core.Map<core.String, core.Object> toJson() { @@ -6304,6 +6326,9 @@ _json['outputSource'] = outputSource.map((value) => value.toJson()).toList(); } + if (prerequisiteStage != null) { + _json['prerequisiteStage'] = prerequisiteStage; + } return _json; } } @@ -6397,6 +6422,15 @@ /// Whether to enable Streaming Engine for the job. core.bool enableStreamingEngine; + /// Set FlexRS goal for the job. + /// + /// https://cloud.google.com/dataflow/docs/guides/flexrs + /// Possible string values are: + /// - "FLEXRS_UNSPECIFIED" : Run in the default mode. + /// - "FLEXRS_SPEED_OPTIMIZED" : Optimize for lower execution time. + /// - "FLEXRS_COST_OPTIMIZED" : Optimize for lower cost. + core.String flexrsGoal; + /// Configuration for VM IPs. /// Possible string values are: /// - "WORKER_IP_UNSPECIFIED" : The configuration is unknown, or unspecified. @@ -6489,6 +6523,9 @@ if (_json.containsKey('enableStreamingEngine')) { enableStreamingEngine = _json['enableStreamingEngine'] as core.bool; } + if (_json.containsKey('flexrsGoal')) { + flexrsGoal = _json['flexrsGoal'] as core.String; + } if (_json.containsKey('ipConfiguration')) { ipConfiguration = _json['ipConfiguration'] as core.String; } @@ -6538,6 +6575,9 @@ if (enableStreamingEngine != null) { _json['enableStreamingEngine'] = enableStreamingEngine; } + if (flexrsGoal != null) { + _json['flexrsGoal'] = flexrsGoal; + } if (ipConfiguration != null) { _json['ipConfiguration'] = ipConfiguration; } @@ -7055,6 +7095,8 @@ } /// Defines a job to be run by the Cloud Dataflow service. +/// +/// nextID: 26 class Job { /// The client's unique identifier of the job, re-used across retried /// attempts. @@ -7127,6 +7169,10 @@ /// - "JOB_STATE_QUEUED" : `JOB_STATE_QUEUED` indicates that the job has been /// created but is being delayed until launch. Jobs that are queued may only /// transition to `JOB_STATE_PENDING` or `JOB_STATE_CANCELLED`. + /// - "JOB_STATE_RESOURCE_CLEANING_UP" : `JOB_STATE_RESOURCE_CLEANING_UP` + /// indicates that the batch job's associated resources are currently being + /// cleaned up after a successful run. Currently, this is an opt-in feature, + /// please reach out to Cloud support team if you are intersted. core.String currentState; /// The timestamp associated with the current state. @@ -7245,8 +7291,18 @@ /// - "JOB_STATE_QUEUED" : `JOB_STATE_QUEUED` indicates that the job has been /// created but is being delayed until launch. Jobs that are queued may only /// transition to `JOB_STATE_PENDING` or `JOB_STATE_CANCELLED`. + /// - "JOB_STATE_RESOURCE_CLEANING_UP" : `JOB_STATE_RESOURCE_CLEANING_UP` + /// indicates that the batch job's associated resources are currently being + /// cleaned up after a successful run. Currently, this is an opt-in feature, + /// please reach out to Cloud support team if you are intersted. core.String requestedState; + /// Reserved for future use. + /// + /// This field is set only in responses from the server; it is ignored if it + /// is set in any requests. + core.bool satisfiesPzs; + /// This field may be mutated by the Cloud Dataflow service; callers cannot /// mutate it. core.List<ExecutionStageState> stageStates; @@ -7356,6 +7412,9 @@ if (_json.containsKey('requestedState')) { requestedState = _json['requestedState'] as core.String; } + if (_json.containsKey('satisfiesPzs')) { + satisfiesPzs = _json['satisfiesPzs'] as core.bool; + } if (_json.containsKey('stageStates')) { stageStates = (_json['stageStates'] as core.List) .map<ExecutionStageState>((value) => ExecutionStageState.fromJson( @@ -7447,6 +7506,9 @@ if (requestedState != null) { _json['requestedState'] = requestedState; } + if (satisfiesPzs != null) { + _json['satisfiesPzs'] = satisfiesPzs; + } if (stageStates != null) { _json['stageStates'] = stageStates.map((value) => value.toJson()).toList(); @@ -7915,6 +7977,9 @@ /// The job name to use for the created job. /// + /// For update job request, job name should be same as the existing running + /// job. + /// /// Required. core.String jobName; @@ -7929,6 +7994,17 @@ /// Ex. {"num_workers":"5"} core.Map<core.String, core.String> parameters; + /// Use this to pass transform_name_mappings for streaming update jobs. + /// + /// Ex:{"oldTransformName":"newTransformName",...}' + core.Map<core.String, core.String> transformNameMappings; + + /// Set this to true if you are sending a request to update a running + /// streaming job. + /// + /// When set, the job name should be the same as the running job. + core.bool update; + LaunchFlexTemplateParameter(); LaunchFlexTemplateParameter.fromJson(core.Map _json) { @@ -7966,6 +8042,19 @@ ), ); } + if (_json.containsKey('transformNameMappings')) { + transformNameMappings = (_json['transformNameMappings'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('update')) { + update = _json['update'] as core.bool; + } } core.Map<core.String, core.Object> toJson() { @@ -7988,6 +8077,12 @@ if (parameters != null) { _json['parameters'] = parameters; } + if (transformNameMappings != null) { + _json['transformNameMappings'] = transformNameMappings; + } + if (update != null) { + _json['update'] = update; + } return _json; } }
diff --git a/generated/googleapis_beta/lib/datafusion/v1beta1.dart b/generated/googleapis_beta/lib/datafusion/v1beta1.dart deleted file mode 100644 index ff3c5f4..0000000 --- a/generated/googleapis_beta/lib/datafusion/v1beta1.dart +++ /dev/null
@@ -1,2709 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Data Fusion API - v1beta1 -/// -/// Cloud Data Fusion is a fully-managed, cloud native, enterprise data -/// integration service for quickly building and managing data pipelines. It -/// provides a graphical interface to increase time efficiency and reduce -/// complexity, and allows business users, developers, and data scientists to -/// easily and reliably build scalable data integration solutions to cleanse, -/// prepare, blend, transfer and transform data without having to wrestle with -/// infrastructure. -/// -/// For more information, see <https://cloud.google.com/data-fusion/docs> -/// -/// Create an instance of [DataFusionApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsInstancesResource] -/// - [ProjectsLocationsOperationsResource] -/// - [ProjectsLocationsVersionsResource] -library datafusion.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Cloud Data Fusion is a fully-managed, cloud native, enterprise data -/// integration service for quickly building and managing data pipelines. -/// -/// It provides a graphical interface to increase time efficiency and reduce -/// complexity, and allows business users, developers, and data scientists to -/// easily and reliably build scalable data integration solutions to cleanse, -/// prepare, blend, transfer and transform data without having to wrestle with -/// infrastructure. -class DataFusionApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - DataFusionApi(http.Client client, - {core.String rootUrl = 'https://datafusion.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsInstancesResource get instances => - ProjectsLocationsInstancesResource(_requester); - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - ProjectsLocationsVersionsResource get versions => - ProjectsLocationsVersionsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [includeUnrevealedLocations] - If true, the returned list will include - /// locations which are not yet revealed. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.bool includeUnrevealedLocations, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (includeUnrevealedLocations != null) { - _queryParams['includeUnrevealedLocations'] = [ - '${includeUnrevealedLocations}' - ]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsInstancesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsInstancesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new Data Fusion instance in the specified project and location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The instance's project and location in the format - /// projects/{project}/locations/{location}. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [instanceId] - The name of the instance to create. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Instance request, - core.String parent, { - core.String instanceId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (instanceId != null) { - _queryParams['instanceId'] = [instanceId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/instances'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single Date Fusion instance. - /// - /// Request parameters: - /// - /// [name] - The instance resource name in the format - /// projects/{project}/locations/{location}/instances/{instance} - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single Data Fusion instance. - /// - /// Request parameters: - /// - /// [name] - The instance resource name in the format - /// projects/{project}/locations/{location}/instances/{instance}. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Instance]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Instance> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Instance.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for a resource. - /// - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists Data Fusion instances in the specified project and location. - /// - /// Request parameters: - /// - /// [parent] - The project and location for which to retrieve instance - /// information in the format projects/{project}/locations/{location}. If the - /// location is specified as '-' (wildcard), then all regions available to the - /// project are queried, and the results are aggregated. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - List filter. - /// - /// [orderBy] - Sort results. Supported values are "name", "name desc", or "" - /// (unsorted). - /// - /// [pageSize] - The maximum number of items to return. - /// - /// [pageToken] - The next_page_token value to use if there are additional - /// results to retrieve for this list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListInstancesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListInstancesResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/instances'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListInstancesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a single Data Fusion instance. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Output only. The name of this instance is in the form of - /// projects/{project}/locations/{location}/instances/{instance}. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [updateMask] - Field mask is used to specify the fields that the update - /// will overwrite in an instance resource. The fields specified in the - /// update_mask are relative to the resource, not the full request. A field - /// will be overwritten if it is in the mask. If the user does not provide a - /// mask, all the supported fields (labels and options currently) will be - /// overwritten. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Instance request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Restart a single Data Fusion instance. - /// - /// At the end of an operation instance is fully restarted. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Name of the Data Fusion instance which need to be restarted in - /// the form of projects/{project}/locations/{location}/instances/{instance} - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> restart( - RestartInstanceRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':restart'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on the specified resource. - /// - /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, - /// and `PERMISSION_DENIED` errors. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Upgrade a single Data Fusion instance. - /// - /// At the end of an operation instance is fully upgraded. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Name of the Data Fusion instance which need to be upgraded in the - /// form of projects/{project}/locations/{location}/instances/{instance} - /// Instance will be upgraded with the latest stable version of the Data - /// Fusion. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> upgrade( - UpgradeInstanceRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':upgrade'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> cancel( - CancelOperationRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a long-running operation. - /// - /// This method indicates that the client is no longer interested in the - /// operation result. It does not cancel the operation. If the server doesn't - /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be deleted. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsVersionsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsVersionsResource(commons.ApiRequester client) - : _requester = client; - - /// Lists possible versions for Data Fusion instances in the specified project - /// and location. - /// - /// Request parameters: - /// - /// [parent] - Required. The project and location for which to retrieve - /// instance information in the format - /// projects/{project}/locations/{location}. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [latestPatchOnly] - Whether or not to return the latest patch of every - /// available minor version. If true, only the latest patch will be returned. - /// Ex. if allowed versions is \[6.1.1, 6.1.2, 6.2.0\] then response will be - /// \[6.1.2, 6.2.0\] - /// - /// [pageSize] - The maximum number of items to return. - /// - /// [pageToken] - The next_page_token value to use if there are additional - /// results to retrieve for this list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListAvailableVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListAvailableVersionsResponse> list( - core.String parent, { - core.bool latestPatchOnly, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (latestPatchOnly != null) { - _queryParams['latestPatchOnly'] = ['${latestPatchOnly}']; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListAvailableVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Identifies Data Fusion accelerators for an instance. -class Accelerator { - /// The type of an accelator for a CDF instance. - /// Possible string values are: - /// - "ACCELERATOR_TYPE_UNSPECIFIED" : Default value, if unspecified. - /// - "CDC" : Change Data Capture accelerator for CDF. - /// - "HEALTHCARE" : Cloud Healthcare accelerator for CDF. This accelerator is - /// to enable Cloud Healthcare specific CDF plugins developed by Healthcare - /// team. - core.String acceleratorType; - - Accelerator(); - - Accelerator.fromJson(core.Map _json) { - if (_json.containsKey('acceleratorType')) { - acceleratorType = _json['acceleratorType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (acceleratorType != null) { - _json['acceleratorType'] = acceleratorType; - } - return _json; - } -} - -/// Specifies the audit configuration for a service. -/// -/// The configuration determines which permission types are logged, and what -/// identities, if any, are exempted from logging. An AuditConfig must have one -/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` -/// and a specific service, the union of the two AuditConfigs is used for that -/// service: the log_types specified in each AuditConfig are enabled, and the -/// exempted_members in each AuditLogConfig are exempted. Example Policy with -/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", -/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ -/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": -/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", -/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": -/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } -/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts jose@example.com from DATA_READ logging, and -/// aliya@example.com from DATA_WRITE logging. -class AuditConfig { - /// The configuration for logging of each type of permission. - core.List<AuditLogConfig> auditLogConfigs; - - /// Specifies a service that will be enabled for audit logging. - /// - /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - /// `allServices` is a special value that covers all services. - core.String service; - - AuditConfig(); - - AuditConfig.fromJson(core.Map _json) { - if (_json.containsKey('auditLogConfigs')) { - auditLogConfigs = (_json['auditLogConfigs'] as core.List) - .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('service')) { - service = _json['service'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditLogConfigs != null) { - _json['auditLogConfigs'] = - auditLogConfigs.map((value) => value.toJson()).toList(); - } - if (service != null) { - _json['service'] = service; - } - return _json; - } -} - -/// Provides the configuration for logging a type of permissions. -/// -/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", -/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": -/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while -/// exempting jose@example.com from DATA_READ logging. -class AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// - /// Follows the same format of Binding.members. - core.List<core.String> exemptedMembers; - - /// The log type that this config enables. - /// Possible string values are: - /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. - /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy - /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create - /// - "DATA_READ" : Data reads. Example: CloudSQL Users list - core.String logType; - - AuditLogConfig(); - - AuditLogConfig.fromJson(core.Map _json) { - if (_json.containsKey('exemptedMembers')) { - exemptedMembers = (_json['exemptedMembers'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('logType')) { - logType = _json['logType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exemptedMembers != null) { - _json['exemptedMembers'] = exemptedMembers; - } - if (logType != null) { - _json['logType'] = logType; - } - return _json; - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// The request message for Operations.CancelOperation. -class CancelOperationRequest { - CancelOperationRequest(); - - CancelOperationRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Represents a Data Fusion instance. -class Instance { - /// List of accelerators enabled for this CDF instance. - core.List<Accelerator> accelerators; - - /// Endpoint on which the REST APIs is accessible. - /// - /// Output only. - core.String apiEndpoint; - - /// Available versions that the instance can be upgraded to using - /// UpdateInstanceRequest. - core.List<Version> availableVersion; - - /// The time the instance was created. - /// - /// Output only. - core.String createTime; - - /// User-managed service account to set on Dataproc when Cloud Data Fusion - /// creates Dataproc to run data processing pipelines. - /// - /// This allows users to have fine-grained access control on Dataproc's - /// accesses to cloud resources. - core.String dataprocServiceAccount; - - /// A description of this instance. - core.String description; - - /// Display name for an instance. - core.String displayName; - - /// Option to enable Stackdriver Logging. - core.bool enableStackdriverLogging; - - /// Option to enable Stackdriver Monitoring. - core.bool enableStackdriverMonitoring; - - /// Cloud Storage bucket generated by Data Fusion in the customer project. - /// - /// Output only. - core.String gcsBucket; - - /// The resource labels for instance to use to annotate any related underlying - /// resources such as Compute Engine VMs. - /// - /// The character '=' is not allowed to be used within the labels. - core.Map<core.String, core.String> labels; - - /// The name of this instance is in the form of - /// projects/{project}/locations/{location}/instances/{instance}. - /// - /// Output only. - core.String name; - - /// Network configuration options. - /// - /// These are required when a private Data Fusion instance is to be created. - NetworkConfig networkConfig; - - /// Map of additional options used to configure the behavior of Data Fusion - /// instance. - core.Map<core.String, core.String> options; - - /// P4 service account for the customer project. - /// - /// Output only. - core.String p4ServiceAccount; - - /// Specifies whether the Data Fusion instance should be private. - /// - /// If set to true, all Data Fusion nodes will have private IP addresses and - /// will not be able to access the public internet. - core.bool privateInstance; - - /// Use tenant_project_id instead to extract the tenant project ID. - /// - /// Output only. Deprecated. - core.String serviceAccount; - - /// Endpoint on which the Data Fusion UI is accessible. - /// - /// Output only. - core.String serviceEndpoint; - - /// The current state of this Data Fusion instance. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Instance does not have a state yet - /// - "CREATING" : Instance is being created - /// - "RUNNING" : Instance is running and ready for requests - /// - "FAILED" : Instance creation failed - /// - "DELETING" : Instance is being deleted - /// - "UPGRADING" : Instance is being upgraded - /// - "RESTARTING" : Instance is being restarted - /// - "UPDATING" : Instance is being updated on customer request - /// - "AUTO_UPDATING" : Instance is being auto-updated - /// - "AUTO_UPGRADING" : Instance is being auto-upgraded - core.String state; - - /// Additional information about the current state of this Data Fusion - /// instance if available. - /// - /// Output only. - core.String stateMessage; - - /// The name of the tenant project. - /// - /// Output only. - core.String tenantProjectId; - - /// Instance type. - /// - /// Required. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : No type specified. The instance creation will fail. - /// - "BASIC" : Basic Data Fusion instance. In Basic type, the user will be - /// able to create data pipelines using point and click UI. However, there are - /// certain limitations, such as fewer number of concurrent pipelines, no - /// support for streaming pipelines, etc. - /// - "ENTERPRISE" : Enterprise Data Fusion instance. In Enterprise type, the - /// user will have all features available, such as support for streaming - /// pipelines, higher number of concurrent pipelines, etc. - /// - "DEVELOPER" : Developer Data Fusion instance. In Developer type, the - /// user will have all features available but with restrictive capabilities. - /// This is to help enterprises design and develop their data ingestion and - /// integration pipelines at low cost. - core.String type; - - /// The time the instance was last updated. - /// - /// Output only. - core.String updateTime; - - /// Current version of Data Fusion. - core.String version; - - /// Name of the zone in which the Data Fusion instance will be created. - core.String zone; - - Instance(); - - Instance.fromJson(core.Map _json) { - if (_json.containsKey('accelerators')) { - accelerators = (_json['accelerators'] as core.List) - .map<Accelerator>((value) => Accelerator.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('apiEndpoint')) { - apiEndpoint = _json['apiEndpoint'] as core.String; - } - if (_json.containsKey('availableVersion')) { - availableVersion = (_json['availableVersion'] as core.List) - .map<Version>((value) => - Version.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('dataprocServiceAccount')) { - dataprocServiceAccount = _json['dataprocServiceAccount'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enableStackdriverLogging')) { - enableStackdriverLogging = _json['enableStackdriverLogging'] as core.bool; - } - if (_json.containsKey('enableStackdriverMonitoring')) { - enableStackdriverMonitoring = - _json['enableStackdriverMonitoring'] as core.bool; - } - if (_json.containsKey('gcsBucket')) { - gcsBucket = _json['gcsBucket'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('networkConfig')) { - networkConfig = NetworkConfig.fromJson( - _json['networkConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('options')) { - options = - (_json['options'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('p4ServiceAccount')) { - p4ServiceAccount = _json['p4ServiceAccount'] as core.String; - } - if (_json.containsKey('privateInstance')) { - privateInstance = _json['privateInstance'] as core.bool; - } - if (_json.containsKey('serviceAccount')) { - serviceAccount = _json['serviceAccount'] as core.String; - } - if (_json.containsKey('serviceEndpoint')) { - serviceEndpoint = _json['serviceEndpoint'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('stateMessage')) { - stateMessage = _json['stateMessage'] as core.String; - } - if (_json.containsKey('tenantProjectId')) { - tenantProjectId = _json['tenantProjectId'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - if (_json.containsKey('zone')) { - zone = _json['zone'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (accelerators != null) { - _json['accelerators'] = - accelerators.map((value) => value.toJson()).toList(); - } - if (apiEndpoint != null) { - _json['apiEndpoint'] = apiEndpoint; - } - if (availableVersion != null) { - _json['availableVersion'] = - availableVersion.map((value) => value.toJson()).toList(); - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (dataprocServiceAccount != null) { - _json['dataprocServiceAccount'] = dataprocServiceAccount; - } - if (description != null) { - _json['description'] = description; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enableStackdriverLogging != null) { - _json['enableStackdriverLogging'] = enableStackdriverLogging; - } - if (enableStackdriverMonitoring != null) { - _json['enableStackdriverMonitoring'] = enableStackdriverMonitoring; - } - if (gcsBucket != null) { - _json['gcsBucket'] = gcsBucket; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (networkConfig != null) { - _json['networkConfig'] = networkConfig.toJson(); - } - if (options != null) { - _json['options'] = options; - } - if (p4ServiceAccount != null) { - _json['p4ServiceAccount'] = p4ServiceAccount; - } - if (privateInstance != null) { - _json['privateInstance'] = privateInstance; - } - if (serviceAccount != null) { - _json['serviceAccount'] = serviceAccount; - } - if (serviceEndpoint != null) { - _json['serviceEndpoint'] = serviceEndpoint; - } - if (state != null) { - _json['state'] = state; - } - if (stateMessage != null) { - _json['stateMessage'] = stateMessage; - } - if (tenantProjectId != null) { - _json['tenantProjectId'] = tenantProjectId; - } - if (type != null) { - _json['type'] = type; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - if (version != null) { - _json['version'] = version; - } - if (zone != null) { - _json['zone'] = zone; - } - return _json; - } -} - -/// Response message for the list available versions request. -class ListAvailableVersionsResponse { - /// Represents a list of versions that are supported. - core.List<Version> availableVersions; - - /// Token to retrieve the next page of results or empty if there are no more - /// results in the list. - core.String nextPageToken; - - ListAvailableVersionsResponse(); - - ListAvailableVersionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('availableVersions')) { - availableVersions = (_json['availableVersions'] as core.List) - .map<Version>((value) => - Version.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (availableVersions != null) { - _json['availableVersions'] = - availableVersions.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for the list instance request. -class ListInstancesResponse { - /// Represents a list of Data Fusion instances. - core.List<Instance> instances; - - /// Token to retrieve the next page of results or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// Locations that could not be reached. - core.List<core.String> unreachable; - - ListInstancesResponse(); - - ListInstancesResponse.fromJson(core.Map _json) { - if (_json.containsKey('instances')) { - instances = (_json['instances'] as core.List) - .map<Instance>((value) => - Instance.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (instances != null) { - _json['instances'] = instances.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Network configuration for a Data Fusion instance. -/// -/// These configurations are used for peering with the customer network. -/// Configurations are optional when a public Data Fusion instance is to be -/// created. However, providing these configurations allows several benefits, -/// such as reduced network latency while accessing the customer resources from -/// managed Data Fusion instance nodes, as well as access to the customer -/// on-prem resources. -class NetworkConfig { - /// The IP range in CIDR notation to use for the managed Data Fusion instance - /// nodes. - /// - /// This range must not overlap with any other ranges used in the Data Fusion - /// instance network. - core.String ipAllocation; - - /// Name of the network in the customer project with which the Tenant Project - /// will be peered for executing pipelines. - /// - /// In case of shared VPC where the network resides in another host project - /// the network should specified in the form of - /// projects/{host-project-id}/global/networks/{network} - core.String network; - - NetworkConfig(); - - NetworkConfig.fromJson(core.Map _json) { - if (_json.containsKey('ipAllocation')) { - ipAllocation = _json['ipAllocation'] as core.String; - } - if (_json.containsKey('network')) { - network = _json['network'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ipAllocation != null) { - _json['ipAllocation'] = ipAllocation; - } - if (network != null) { - _json['network'] = network; - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Represents the metadata of a long-running operation. -class OperationMetadata { - /// API version used to start the operation. - core.String apiVersion; - - /// The time the operation was created. - core.String createTime; - - /// The time the operation finished running. - core.String endTime; - - /// Identifies whether the user has requested cancellation of the operation. - /// - /// Operations that have successfully been cancelled have Operation.error - /// value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - core.bool requestedCancellation; - - /// Human-readable status of the operation if any. - core.String statusDetail; - - /// Server-defined resource path for the target of the operation. - core.String target; - - /// Name of the verb executed by the operation. - core.String verb; - - OperationMetadata(); - - OperationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('apiVersion')) { - apiVersion = _json['apiVersion'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('requestedCancellation')) { - requestedCancellation = _json['requestedCancellation'] as core.bool; - } - if (_json.containsKey('statusDetail')) { - statusDetail = _json['statusDetail'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('verb')) { - verb = _json['verb'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiVersion != null) { - _json['apiVersion'] = apiVersion; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (requestedCancellation != null) { - _json['requestedCancellation'] = requestedCancellation; - } - if (statusDetail != null) { - _json['statusDetail'] = statusDetail; - } - if (target != null) { - _json['target'] = target; - } - if (verb != null) { - _json['verb'] = verb; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Specifies cloud audit logging configuration for this policy. - core.List<AuditConfig> auditConfigs; - - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('auditConfigs')) { - auditConfigs = (_json['auditConfigs'] as core.List) - .map<AuditConfig>((value) => AuditConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditConfigs != null) { - _json['auditConfigs'] = - auditConfigs.map((value) => value.toJson()).toList(); - } - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Request message for restarting a Data Fusion instance. -class RestartInstanceRequest { - RestartInstanceRequest(); - - RestartInstanceRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. - /// - /// Only the fields in the mask will be modified. If no mask is provided, the - /// following default mask is used: `paths: "bindings, etag"` - core.String updateMask; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Request message for upgrading a Data Fusion instance. -/// -/// To change the instance properties, instance update should be used. -class UpgradeInstanceRequest { - UpgradeInstanceRequest(); - - UpgradeInstanceRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The Data Fusion version. -class Version { - /// Represents a list of available feature names for a given version. - core.List<core.String> availableFeatures; - - /// Whether this is currently the default version for Cloud Data Fusion - core.bool defaultVersion; - - /// The version number of the Data Fusion instance, such as '6.0.1.0'. - core.String versionNumber; - - Version(); - - Version.fromJson(core.Map _json) { - if (_json.containsKey('availableFeatures')) { - availableFeatures = (_json['availableFeatures'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('defaultVersion')) { - defaultVersion = _json['defaultVersion'] as core.bool; - } - if (_json.containsKey('versionNumber')) { - versionNumber = _json['versionNumber'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (availableFeatures != null) { - _json['availableFeatures'] = availableFeatures; - } - if (defaultVersion != null) { - _json['defaultVersion'] = defaultVersion; - } - if (versionNumber != null) { - _json['versionNumber'] = versionNumber; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/datalabeling/v1beta1.dart b/generated/googleapis_beta/lib/datalabeling/v1beta1.dart new file mode 100644 index 0000000..82f1050 --- /dev/null +++ b/generated/googleapis_beta/lib/datalabeling/v1beta1.dart
@@ -0,0 +1,13000 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Data Labeling API - v1beta1 +/// +/// Public API for Google Cloud AI Data Labeling Service. +/// +/// For more information, see <https://cloud.google.com/data-labeling/docs/> +/// +/// Create an instance of [DataLabelingApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsAnnotationSpecSetsResource] +/// - [ProjectsDatasetsResource] +/// - [ProjectsDatasetsAnnotatedDatasetsResource] +/// - [ProjectsDatasetsAnnotatedDatasetsDataItemsResource] +/// - [ProjectsDatasetsAnnotatedDatasetsExamplesResource] +/// - [ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsResource] +/// - [ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesResource] +/// - [ProjectsDatasetsDataItemsResource] +/// - [ProjectsDatasetsEvaluationsResource] +/// - [ProjectsDatasetsEvaluationsExampleComparisonsResource] +/// - [ProjectsDatasetsImageResource] +/// - [ProjectsDatasetsTextResource] +/// - [ProjectsDatasetsVideoResource] +/// - [ProjectsEvaluationJobsResource] +/// - [ProjectsEvaluationsResource] +/// - [ProjectsInstructionsResource] +/// - [ProjectsOperationsResource] +library datalabeling.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Public API for Google Cloud AI Data Labeling Service. +class DataLabelingApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + DataLabelingApi(http.Client client, + {core.String rootUrl = 'https://datalabeling.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsAnnotationSpecSetsResource get annotationSpecSets => + ProjectsAnnotationSpecSetsResource(_requester); + ProjectsDatasetsResource get datasets => ProjectsDatasetsResource(_requester); + ProjectsEvaluationJobsResource get evaluationJobs => + ProjectsEvaluationJobsResource(_requester); + ProjectsEvaluationsResource get evaluations => + ProjectsEvaluationsResource(_requester); + ProjectsInstructionsResource get instructions => + ProjectsInstructionsResource(_requester); + ProjectsOperationsResource get operations => + ProjectsOperationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsAnnotationSpecSetsResource { + final commons.ApiRequester _requester; + + ProjectsAnnotationSpecSetsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates an annotation spec set by providing a set of labels. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. AnnotationSpecSet resource parent, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1AnnotationSpecSet]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1AnnotationSpecSet> create( + GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/annotationSpecSets'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1AnnotationSpecSet.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes an annotation spec set by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. AnnotationSpec resource name, format: + /// `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. + /// Value must have pattern `^projects/\[^/\]+/annotationSpecSets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets an annotation spec set by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. AnnotationSpecSet resource name, format: + /// projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + /// Value must have pattern `^projects/\[^/\]+/annotationSpecSets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1AnnotationSpecSet]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1AnnotationSpecSet> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1AnnotationSpecSet.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists annotation spec sets for a project. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Parent of AnnotationSpecSet resource, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - Optional. Filter is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListAnnotationSpecSetsResponse.next_page_token of the previous + /// \[DataLabelingService.ListAnnotationSpecSets\] call. Return first page if + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse> + list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/annotationSpecSets'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsResource get annotatedDatasets => + ProjectsDatasetsAnnotatedDatasetsResource(_requester); + ProjectsDatasetsDataItemsResource get dataItems => + ProjectsDatasetsDataItemsResource(_requester); + ProjectsDatasetsEvaluationsResource get evaluations => + ProjectsDatasetsEvaluationsResource(_requester); + ProjectsDatasetsImageResource get image => + ProjectsDatasetsImageResource(_requester); + ProjectsDatasetsTextResource get text => + ProjectsDatasetsTextResource(_requester); + ProjectsDatasetsVideoResource get video => + ProjectsDatasetsVideoResource(_requester); + + ProjectsDatasetsResource(commons.ApiRequester client) : _requester = client; + + /// Creates dataset. + /// + /// If success return a Dataset resource. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Dataset resource parent, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1Dataset]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1Dataset> create( + GoogleCloudDatalabelingV1beta1CreateDatasetRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/datasets'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1Dataset.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a dataset by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Dataset resource name, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Exports data and annotations from dataset. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Dataset resource name, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> exportData( + GoogleCloudDatalabelingV1beta1ExportDataRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':exportData'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets dataset by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Dataset resource name, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1Dataset]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1Dataset> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1Dataset.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Imports data into dataset based on source locations defined in request. + /// + /// It can be called multiple times for the same dataset. Each dataset can + /// only have one long running operation running on it. For example, no + /// labeling task (also long running operation) can be started while importing + /// is still ongoing. Vice versa. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Dataset resource name, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> importData( + GoogleCloudDatalabelingV1beta1ImportDataRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':importData'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists datasets under a project. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Dataset resource parent, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - Optional. Filter on dataset is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListDatasetsResponse.next_page_token of the previous + /// \[DataLabelingService.ListDatasets\] call. Returns the first page if + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1ListDatasetsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListDatasetsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/datasets'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1ListDatasetsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsAnnotatedDatasetsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsDataItemsResource get dataItems => + ProjectsDatasetsAnnotatedDatasetsDataItemsResource(_requester); + ProjectsDatasetsAnnotatedDatasetsExamplesResource get examples => + ProjectsDatasetsAnnotatedDatasetsExamplesResource(_requester); + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsResource + get feedbackThreads => + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsResource(_requester); + + ProjectsDatasetsAnnotatedDatasetsResource(commons.ApiRequester client) + : _requester = client; + + /// Deletes an annotated dataset by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the annotated dataset to delete, format: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets an annotated dataset by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the annotated dataset to get, format: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1AnnotatedDataset]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1AnnotatedDataset> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1AnnotatedDataset.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists annotated datasets for a dataset. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the dataset to list annotated datasets, + /// format: projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [filter] - Optional. Filter is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListAnnotatedDatasetsResponse.next_page_token of the previous + /// \[DataLabelingService.ListAnnotatedDatasets\] call. Return first page if + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse> + list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/annotatedDatasets'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsAnnotatedDatasetsDataItemsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsDataItemsResource( + commons.ApiRequester client) + : _requester = client; + + /// Gets a data item in a dataset by resource name. + /// + /// This API can be called after data are imported into dataset. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the data item to get, format: + /// projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/dataItems/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1DataItem]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1DataItem> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1DataItem.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists data items in a dataset. + /// + /// This API can be called after data are imported into dataset. Pagination is + /// supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the dataset to list data items, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+$`. + /// + /// [filter] - Optional. Filter is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListDataItemsResponse.next_page_token of the previous + /// \[DataLabelingService.ListDataItems\] call. Return first page if empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1ListDataItemsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListDataItemsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/dataItems'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1ListDataItemsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsAnnotatedDatasetsExamplesResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsExamplesResource(commons.ApiRequester client) + : _requester = client; + + /// Gets an example by resource name, including both data and annotation. + /// + /// Request parameters: + /// + /// [name] - Required. Name of example, format: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id}/examples/{example_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/examples/\[^/\]+$`. + /// + /// [filter] - Optional. An expression for filtering Examples. Filter by + /// annotation_spec.display_name is supported. Format + /// "annotation_spec.display_name = {display_name}" + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1Example]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1Example> get( + core.String name, { + core.String filter, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1Example.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists examples in an annotated dataset. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Example resource parent. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+$`. + /// + /// [filter] - Optional. An expression for filtering Examples. For annotated + /// datasets that have annotation spec set, filter by + /// annotation_spec.display_name is supported. Format + /// "annotation_spec.display_name = {display_name}" + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListExamplesResponse.next_page_token of the previous + /// \[DataLabelingService.ListExamples\] call. Return first page if empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1ListExamplesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListExamplesResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/examples'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1ListExamplesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesResource + get feedbackMessages => + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesResource( + _requester); + + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsResource( + commons.ApiRequester client) + : _requester = client; + + /// Delete a FeedbackThread. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the FeedbackThread that is going to be deleted. + /// Format: + /// 'projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}'. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Get a FeedbackThread object. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the feedback. Format: + /// 'projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}'. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1FeedbackThread]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1FeedbackThread> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1FeedbackThread.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// List FeedbackThreads with pagination. + /// + /// Request parameters: + /// + /// [parent] - Required. FeedbackThread resource parent. Format: + /// "projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}" + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+$`. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListFeedbackThreads.next_page_token of the previous + /// \[DataLabelingService.ListFeedbackThreads\] call. Return first page if + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/feedbackThreads'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsAnnotatedDatasetsFeedbackThreadsFeedbackMessagesResource( + commons.ApiRequester client) + : _requester = client; + + /// Create a FeedbackMessage object. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. FeedbackMessage resource parent, format: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> create( + GoogleCloudDatalabelingV1beta1FeedbackMessage request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/feedbackMessages'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Delete a FeedbackMessage. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the FeedbackMessage that is going to be + /// deleted. Format: + /// 'projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessages/{feedback_message_id}'. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+/feedbackMessages/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Get a FeedbackMessage object. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the feedback. Format: + /// 'projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessages/{feedback_message_id}'. + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+/feedbackMessages/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1FeedbackMessage]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1FeedbackMessage> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1FeedbackMessage.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// List FeedbackMessages with pagination. + /// + /// Request parameters: + /// + /// [parent] - Required. FeedbackMessage resource parent. Format: + /// "projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}" + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/annotatedDatasets/\[^/\]+/feedbackThreads/\[^/\]+$`. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListFeedbackMessages.next_page_token of the previous + /// \[DataLabelingService.ListFeedbackMessages\] call. Return first page if + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/feedbackMessages'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsDataItemsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsDataItemsResource(commons.ApiRequester client) + : _requester = client; + + /// Gets a data item in a dataset by resource name. + /// + /// This API can be called after data are imported into dataset. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the data item to get, format: + /// projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/dataItems/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1DataItem]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1DataItem> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1DataItem.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists data items in a dataset. + /// + /// This API can be called after data are imported into dataset. Pagination is + /// supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the dataset to list data items, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [filter] - Optional. Filter is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListDataItemsResponse.next_page_token of the previous + /// \[DataLabelingService.ListDataItems\] call. Return first page if empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1ListDataItemsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListDataItemsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/dataItems'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1ListDataItemsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsEvaluationsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsEvaluationsExampleComparisonsResource + get exampleComparisons => + ProjectsDatasetsEvaluationsExampleComparisonsResource(_requester); + + ProjectsDatasetsEvaluationsResource(commons.ApiRequester client) + : _requester = client; + + /// Gets an evaluation by resource name (to search, use + /// projects.evaluations.search). + /// + /// Request parameters: + /// + /// [name] - Required. Name of the evaluation. Format: + /// "projects/{project_id}/datasets/ {dataset_id}/evaluations/{evaluation_id}' + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/evaluations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1Evaluation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1Evaluation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1Evaluation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsEvaluationsExampleComparisonsResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsEvaluationsExampleComparisonsResource( + commons.ApiRequester client) + : _requester = client; + + /// Searches example comparisons from an evaluation. + /// + /// The return format is a list of example comparisons that show ground truth + /// and prediction(s) for a single input. Search by providing an evaluation + /// ID. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the Evaluation resource to search for example + /// comparisons from. Format: + /// "projects/{project_id}/datasets/{dataset_id}/evaluations/ {evaluation_id}" + /// Value must have pattern + /// `^projects/\[^/\]+/datasets/\[^/\]+/evaluations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse> + search( + GoogleCloudDatalabelingV1beta1SearchExampleComparisonsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/exampleComparisons:search'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse + .fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsImageResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsImageResource(commons.ApiRequester client) + : _requester = client; + + /// Starts a labeling task for image. + /// + /// The type of image labeling task is configured by feature in the request. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the dataset to request labeling task, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> label( + GoogleCloudDatalabelingV1beta1LabelImageRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/image:label'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsTextResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsTextResource(commons.ApiRequester client) + : _requester = client; + + /// Starts a labeling task for text. + /// + /// The type of text labeling task is configured by feature in the request. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the data set to request labeling task, + /// format: projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> label( + GoogleCloudDatalabelingV1beta1LabelTextRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/text:label'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsDatasetsVideoResource { + final commons.ApiRequester _requester; + + ProjectsDatasetsVideoResource(commons.ApiRequester client) + : _requester = client; + + /// Starts a labeling task for video. + /// + /// The type of video labeling task is configured by feature in the request. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the dataset to request labeling task, format: + /// projects/{project_id}/datasets/{dataset_id} + /// Value must have pattern `^projects/\[^/\]+/datasets/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> label( + GoogleCloudDatalabelingV1beta1LabelVideoRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/video:label'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsEvaluationJobsResource { + final commons.ApiRequester _requester; + + ProjectsEvaluationJobsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates an evaluation job. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Evaluation job resource parent. Format: + /// "projects/{project_id}" + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1EvaluationJob]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1EvaluationJob> create( + GoogleCloudDatalabelingV1beta1CreateEvaluationJobRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/evaluationJobs'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Stops and deletes an evaluation job. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the evaluation job that is going to be deleted. + /// Format: "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + /// Value must have pattern `^projects/\[^/\]+/evaluationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets an evaluation job by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the evaluation job. Format: + /// "projects/{project_id} /evaluationJobs/{evaluation_job_id}" + /// Value must have pattern `^projects/\[^/\]+/evaluationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1EvaluationJob]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1EvaluationJob> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists all evaluation jobs within a project with possible filters. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Evaluation job resource parent. Format: + /// "projects/{project_id}" + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - Optional. You can filter the jobs to list by model_id (also + /// known as model_name, as described in EvaluationJob.modelVersion) or by + /// evaluation job state (as described in EvaluationJob.state). To filter by + /// both criteria, use the `AND` operator or the `OR` operator. For example, + /// you can use the following string for your filter: "evaluation_job.model_id + /// = {model_name} AND evaluation_job.state = {evaluation_job_state}" + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by the nextPageToken in the response + /// to the previous request. The request returns the first page if this is + /// empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/evaluationJobs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates an evaluation job. + /// + /// You can only update certain fields of the job's EvaluationJobConfig: + /// `humanAnnotationConfig.instruction`, `exampleCount`, and + /// `exampleSamplePercentage`. If you want to change any other aspect of the + /// evaluation job, you must delete the job and create a new one. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. After you create a job, Data Labeling Service + /// assigns a name to the job with the following format: + /// "projects/{project_id}/evaluationJobs/ {evaluation_job_id}" + /// Value must have pattern `^projects/\[^/\]+/evaluationJobs/\[^/\]+$`. + /// + /// [updateMask] - Optional. Mask for which fields to update. You can only + /// provide the following fields: * + /// `evaluationJobConfig.humanAnnotationConfig.instruction` * + /// `evaluationJobConfig.exampleCount` * + /// `evaluationJobConfig.exampleSamplePercentage` You can provide more than + /// one of these fields by separating them with commas. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1EvaluationJob]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1EvaluationJob> patch( + GoogleCloudDatalabelingV1beta1EvaluationJob request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Pauses an evaluation job. + /// + /// Pausing an evaluation job that is already in a `PAUSED` state is a no-op. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the evaluation job that is going to be paused. + /// Format: "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + /// Value must have pattern `^projects/\[^/\]+/evaluationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> pause( + GoogleCloudDatalabelingV1beta1PauseEvaluationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':pause'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Resumes a paused evaluation job. + /// + /// A deleted evaluation job can't be resumed. Resuming a running or scheduled + /// evaluation job is a no-op. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the evaluation job that is going to be resumed. + /// Format: "projects/{project_id}/evaluationJobs/{evaluation_job_id}" + /// Value must have pattern `^projects/\[^/\]+/evaluationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> resume( + GoogleCloudDatalabelingV1beta1ResumeEvaluationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':resume'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsEvaluationsResource { + final commons.ApiRequester _requester; + + ProjectsEvaluationsResource(commons.ApiRequester client) + : _requester = client; + + /// Searches evaluations within a project. + /// + /// Request parameters: + /// + /// [parent] - Required. Evaluation search parent (project ID). Format: + /// "projects/ {project_id}" + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - Optional. To search evaluations, you can filter by the + /// following: * evaluation_job.evaluation_job_id (the last part of + /// EvaluationJob.name) * evaluation_job.model_id (the {model_name} portion of + /// EvaluationJob.modelVersion) * evaluation_job.evaluation_job_run_time_start + /// (Minimum threshold for the evaluationJobRunTime that created the + /// evaluation) * evaluation_job.evaluation_job_run_time_end (Maximum + /// threshold for the evaluationJobRunTime that created the evaluation) * + /// evaluation_job.job_state (EvaluationJob.state) * + /// annotation_spec.display_name (the Evaluation contains a metric for the + /// annotation spec with this displayName) To filter by multiple critiera, use + /// the `AND` operator or the `OR` operator. The following examples shows a + /// string that filters by several critiera: "evaluation_job.evaluation_job_id + /// = {evaluation_job_id} AND evaluation_job.model_id = {model_name} AND + /// evaluation_job.evaluation_job_run_time_start = {timestamp_1} AND + /// evaluation_job.evaluation_job_run_time_end = {timestamp_2} AND + /// annotation_spec.display_name = {display_name}" + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by the nextPageToken of the response + /// to a previous search request. If you don't specify this field, the API + /// call requests the first page of the search. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse> search( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/evaluations:search'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsInstructionsResource { + final commons.ApiRequester _requester; + + ProjectsInstructionsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates an instruction for how data should be labeled. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Instruction resource parent, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> create( + GoogleCloudDatalabelingV1beta1CreateInstructionRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/instructions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes an instruction object by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Instruction resource name, format: + /// projects/{project_id}/instructions/{instruction_id} + /// Value must have pattern `^projects/\[^/\]+/instructions/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets an instruction by resource name. + /// + /// Request parameters: + /// + /// [name] - Required. Instruction resource name, format: + /// projects/{project_id}/instructions/{instruction_id} + /// Value must have pattern `^projects/\[^/\]+/instructions/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1Instruction]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1Instruction> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1Instruction.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists instructions for a project. + /// + /// Pagination is supported. + /// + /// Request parameters: + /// + /// [parent] - Required. Instruction resource parent, format: + /// projects/{project_id} + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - Optional. Filter is not supported at this moment. + /// + /// [pageSize] - Optional. Requested page size. Server may return fewer + /// results than requested. Default value is 100. + /// + /// [pageToken] - Optional. A token identifying a page of results for the + /// server to return. Typically obtained by + /// ListInstructionsResponse.next_page_token of the previous + /// \[DataLabelingService.ListInstructions\] call. Return first page if empty. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDatalabelingV1beta1ListInstructionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDatalabelingV1beta1ListInstructionsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/instructions'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDatalabelingV1beta1ListInstructionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; + + /// Starts asynchronous cancellation on a long-running operation. + /// + /// The server makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + /// or other methods to check whether the cancellation succeeded or whether + /// the operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with an + /// Operation.error value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be cancelled. + /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> cancel( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Metadata of a CreateInstruction operation. +class GoogleCloudDatalabelingV1alpha1CreateInstructionMetadata { + /// Timestamp when create instruction request was created. + core.String createTime; + + /// The name of the created Instruction. + /// + /// projects/{project_id}/instructions/{instruction_id} + core.String instruction; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1alpha1CreateInstructionMetadata(); + + GoogleCloudDatalabelingV1alpha1CreateInstructionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Metadata of an ExportData operation. +class GoogleCloudDatalabelingV1alpha1ExportDataOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when export dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be exported. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1alpha1ExportDataOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1ExportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ExportDataset longrunning operation. +class GoogleCloudDatalabelingV1alpha1ExportDataOperationResponse { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Ouptut only. + /// + /// The name of dataset. "projects / * /datasets / * " + core.String dataset; + + /// Number of examples exported successfully. + /// + /// Output only. + core.int exportCount; + + /// Statistic infos of labels in the exported dataset. + /// + /// Output only. + GoogleCloudDatalabelingV1alpha1LabelStats labelStats; + + /// output_config in the ExportData request. + /// + /// Output only. + GoogleCloudDatalabelingV1alpha1OutputConfig outputConfig; + + /// Total number of examples requested to export + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1alpha1ExportDataOperationResponse(); + + GoogleCloudDatalabelingV1alpha1ExportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('exportCount')) { + exportCount = _json['exportCount'] as core.int; + } + if (_json.containsKey('labelStats')) { + labelStats = GoogleCloudDatalabelingV1alpha1LabelStats.fromJson( + _json['labelStats'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputConfig')) { + outputConfig = GoogleCloudDatalabelingV1alpha1OutputConfig.fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (exportCount != null) { + _json['exportCount'] = exportCount; + } + if (labelStats != null) { + _json['labelStats'] = labelStats.toJson(); + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Export destination of the data.Only gcs path is allowed in output_uri. +class GoogleCloudDatalabelingV1alpha1GcsDestination { + /// The format of the gcs destination. + /// + /// Only "text/csv" and "application/json" are supported. + /// + /// Required. + core.String mimeType; + + /// The output uri of destination file. + /// + /// Required. + core.String outputUri; + + GoogleCloudDatalabelingV1alpha1GcsDestination(); + + GoogleCloudDatalabelingV1alpha1GcsDestination.fromJson(core.Map _json) { + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('outputUri')) { + outputUri = _json['outputUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (outputUri != null) { + _json['outputUri'] = outputUri; + } + return _json; + } +} + +/// Export folder destination of the data. +class GoogleCloudDatalabelingV1alpha1GcsFolderDestination { + /// Cloud Storage directory to export data to. + /// + /// Required. + core.String outputFolderUri; + + GoogleCloudDatalabelingV1alpha1GcsFolderDestination(); + + GoogleCloudDatalabelingV1alpha1GcsFolderDestination.fromJson(core.Map _json) { + if (_json.containsKey('outputFolderUri')) { + outputFolderUri = _json['outputFolderUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (outputFolderUri != null) { + _json['outputFolderUri'] = outputFolderUri; + } + return _json; + } +} + +/// Configuration for how human labeling task should be done. +class GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig { + /// A human-readable description for AnnotatedDataset. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String annotatedDatasetDescription; + + /// A human-readable name for AnnotatedDataset defined by users. + /// + /// Maximum of 64 characters . + /// + /// Required. + core.String annotatedDatasetDisplayName; + + /// If you want your own labeling contributors to manage and work on this + /// labeling request, you can set these contributors here. + /// + /// We will give them access to the question types in crowdcompute. Note that + /// these emails must be registered in crowdcompute worker UI: + /// https://crowd-compute.appspot.com/ + /// + /// Optional. + core.List<core.String> contributorEmails; + + /// Instruction resource name. + /// + /// Required. + core.String instruction; + + /// A human-readable label used to logically group labeling tasks. + /// + /// This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + /// + /// Optional. + core.String labelGroup; + + /// The Language of this question, as a + /// \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + /// Default value is en-US. Only need to set this when task is language + /// related. For example, French text classification. + /// + /// Optional. + core.String languageCode; + + /// Maximum duration for contributors to answer a question. + /// + /// Maximum is 3600 seconds. Default is 3600 seconds. + /// + /// Optional. + core.String questionDuration; + + /// Replication of questions. + /// + /// Each question will be sent to up to this number of contributors to label. + /// Aggregated answers will be returned. Default is set to 1. For image + /// related labeling, valid values are 1, 3, 5. + /// + /// Optional. + core.int replicaCount; + + /// Email of the user who started the labeling task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig(); + + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDatasetDescription')) { + annotatedDatasetDescription = + _json['annotatedDatasetDescription'] as core.String; + } + if (_json.containsKey('annotatedDatasetDisplayName')) { + annotatedDatasetDisplayName = + _json['annotatedDatasetDisplayName'] as core.String; + } + if (_json.containsKey('contributorEmails')) { + contributorEmails = (_json['contributorEmails'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('labelGroup')) { + labelGroup = _json['labelGroup'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('questionDuration')) { + questionDuration = _json['questionDuration'] as core.String; + } + if (_json.containsKey('replicaCount')) { + replicaCount = _json['replicaCount'] as core.int; + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDatasetDescription != null) { + _json['annotatedDatasetDescription'] = annotatedDatasetDescription; + } + if (annotatedDatasetDisplayName != null) { + _json['annotatedDatasetDisplayName'] = annotatedDatasetDisplayName; + } + if (contributorEmails != null) { + _json['contributorEmails'] = contributorEmails; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (labelGroup != null) { + _json['labelGroup'] = labelGroup; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (questionDuration != null) { + _json['questionDuration'] = questionDuration; + } + if (replicaCount != null) { + _json['replicaCount'] = replicaCount; + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// Metadata of an ImportData operation. +class GoogleCloudDatalabelingV1alpha1ImportDataOperationMetadata { + /// Timestamp when import dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of imported dataset. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1alpha1ImportDataOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1ImportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ImportData longrunning operation. +class GoogleCloudDatalabelingV1alpha1ImportDataOperationResponse { + /// Ouptut only. + /// + /// The name of imported dataset. + core.String dataset; + + /// Number of examples imported successfully. + /// + /// Output only. + core.int importCount; + + /// Total number of examples requested to import + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1alpha1ImportDataOperationResponse(); + + GoogleCloudDatalabelingV1alpha1ImportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('importCount')) { + importCount = _json['importCount'] as core.int; + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataset != null) { + _json['dataset'] = dataset; + } + if (importCount != null) { + _json['importCount'] = importCount; + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Details of a LabelImageBoundingBox operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelImageBoundingBoxOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImageBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImageBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImageBoundingPoly operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelImageBoundingPolyOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImageBoundingPolyOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImageBoundingPolyOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a LabelImageClassification operation. +class GoogleCloudDatalabelingV1alpha1LabelImageClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImageClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImageClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageOrientedBoundingBox operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelImageOrientedBoundingBoxOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImageOrientedBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImageOrientedBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImagePolyline operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelImagePolylineOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImagePolylineOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImagePolylineOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageSegmentation operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelImageSegmentationOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelImageSegmentationOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelImageSegmentationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a labeling operation, such as LabelImage or LabelVideo. +/// +/// Next tag: 23 +class GoogleCloudDatalabelingV1alpha1LabelOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when labeling request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be labeled. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Details of label image bounding box operation. + GoogleCloudDatalabelingV1alpha1LabelImageBoundingBoxOperationMetadata + imageBoundingBoxDetails; + + /// Details of label image bounding poly operation. + GoogleCloudDatalabelingV1alpha1LabelImageBoundingPolyOperationMetadata + imageBoundingPolyDetails; + + /// Details of label image classification operation. + GoogleCloudDatalabelingV1alpha1LabelImageClassificationOperationMetadata + imageClassificationDetails; + + /// Details of label image oriented bounding box operation. + GoogleCloudDatalabelingV1alpha1LabelImageOrientedBoundingBoxOperationMetadata + imageOrientedBoundingBoxDetails; + + /// Details of label image polyline operation. + GoogleCloudDatalabelingV1alpha1LabelImagePolylineOperationMetadata + imagePolylineDetails; + + /// Details of label image segmentation operation. + GoogleCloudDatalabelingV1alpha1LabelImageSegmentationOperationMetadata + imageSegmentationDetails; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + /// Progress of label operation. + /// + /// Range: \[0, 100\]. + /// + /// Output only. + core.int progressPercent; + + /// Details of label text classification operation. + GoogleCloudDatalabelingV1alpha1LabelTextClassificationOperationMetadata + textClassificationDetails; + + /// Details of label text entity extraction operation. + GoogleCloudDatalabelingV1alpha1LabelTextEntityExtractionOperationMetadata + textEntityExtractionDetails; + + /// Details of label video classification operation. + GoogleCloudDatalabelingV1alpha1LabelVideoClassificationOperationMetadata + videoClassificationDetails; + + /// Details of label video event operation. + GoogleCloudDatalabelingV1alpha1LabelVideoEventOperationMetadata + videoEventDetails; + + /// Details of label video object detection operation. + GoogleCloudDatalabelingV1alpha1LabelVideoObjectDetectionOperationMetadata + videoObjectDetectionDetails; + + /// Details of label video object tracking operation. + GoogleCloudDatalabelingV1alpha1LabelVideoObjectTrackingOperationMetadata + videoObjectTrackingDetails; + + GoogleCloudDatalabelingV1alpha1LabelOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('imageBoundingBoxDetails')) { + imageBoundingBoxDetails = + GoogleCloudDatalabelingV1alpha1LabelImageBoundingBoxOperationMetadata + .fromJson(_json['imageBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageBoundingPolyDetails')) { + imageBoundingPolyDetails = + GoogleCloudDatalabelingV1alpha1LabelImageBoundingPolyOperationMetadata + .fromJson(_json['imageBoundingPolyDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationDetails')) { + imageClassificationDetails = + GoogleCloudDatalabelingV1alpha1LabelImageClassificationOperationMetadata + .fromJson(_json['imageClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageOrientedBoundingBoxDetails')) { + imageOrientedBoundingBoxDetails = + GoogleCloudDatalabelingV1alpha1LabelImageOrientedBoundingBoxOperationMetadata + .fromJson(_json['imageOrientedBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imagePolylineDetails')) { + imagePolylineDetails = + GoogleCloudDatalabelingV1alpha1LabelImagePolylineOperationMetadata + .fromJson(_json['imagePolylineDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageSegmentationDetails')) { + imageSegmentationDetails = + GoogleCloudDatalabelingV1alpha1LabelImageSegmentationOperationMetadata + .fromJson(_json['imageSegmentationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('progressPercent')) { + progressPercent = _json['progressPercent'] as core.int; + } + if (_json.containsKey('textClassificationDetails')) { + textClassificationDetails = + GoogleCloudDatalabelingV1alpha1LabelTextClassificationOperationMetadata + .fromJson(_json['textClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionDetails')) { + textEntityExtractionDetails = + GoogleCloudDatalabelingV1alpha1LabelTextEntityExtractionOperationMetadata + .fromJson(_json['textEntityExtractionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationDetails')) { + videoClassificationDetails = + GoogleCloudDatalabelingV1alpha1LabelVideoClassificationOperationMetadata + .fromJson(_json['videoClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoEventDetails')) { + videoEventDetails = + GoogleCloudDatalabelingV1alpha1LabelVideoEventOperationMetadata + .fromJson(_json['videoEventDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectDetectionDetails')) { + videoObjectDetectionDetails = + GoogleCloudDatalabelingV1alpha1LabelVideoObjectDetectionOperationMetadata + .fromJson(_json['videoObjectDetectionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectTrackingDetails')) { + videoObjectTrackingDetails = + GoogleCloudDatalabelingV1alpha1LabelVideoObjectTrackingOperationMetadata + .fromJson(_json['videoObjectTrackingDetails'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (imageBoundingBoxDetails != null) { + _json['imageBoundingBoxDetails'] = imageBoundingBoxDetails.toJson(); + } + if (imageBoundingPolyDetails != null) { + _json['imageBoundingPolyDetails'] = imageBoundingPolyDetails.toJson(); + } + if (imageClassificationDetails != null) { + _json['imageClassificationDetails'] = imageClassificationDetails.toJson(); + } + if (imageOrientedBoundingBoxDetails != null) { + _json['imageOrientedBoundingBoxDetails'] = + imageOrientedBoundingBoxDetails.toJson(); + } + if (imagePolylineDetails != null) { + _json['imagePolylineDetails'] = imagePolylineDetails.toJson(); + } + if (imageSegmentationDetails != null) { + _json['imageSegmentationDetails'] = imageSegmentationDetails.toJson(); + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + if (progressPercent != null) { + _json['progressPercent'] = progressPercent; + } + if (textClassificationDetails != null) { + _json['textClassificationDetails'] = textClassificationDetails.toJson(); + } + if (textEntityExtractionDetails != null) { + _json['textEntityExtractionDetails'] = + textEntityExtractionDetails.toJson(); + } + if (videoClassificationDetails != null) { + _json['videoClassificationDetails'] = videoClassificationDetails.toJson(); + } + if (videoEventDetails != null) { + _json['videoEventDetails'] = videoEventDetails.toJson(); + } + if (videoObjectDetectionDetails != null) { + _json['videoObjectDetectionDetails'] = + videoObjectDetectionDetails.toJson(); + } + if (videoObjectTrackingDetails != null) { + _json['videoObjectTrackingDetails'] = videoObjectTrackingDetails.toJson(); + } + return _json; + } +} + +/// Statistics about annotation specs. +class GoogleCloudDatalabelingV1alpha1LabelStats { + /// Map of each annotation spec's example count. + /// + /// Key is the annotation spec name and value is the number of examples for + /// that annotation spec. If the annotated dataset does not have annotation + /// spec, the map will return a pair where the key is empty string and value + /// is the total number of annotations. + core.Map<core.String, core.String> exampleCount; + + GoogleCloudDatalabelingV1alpha1LabelStats(); + + GoogleCloudDatalabelingV1alpha1LabelStats.fromJson(core.Map _json) { + if (_json.containsKey('exampleCount')) { + exampleCount = (_json['exampleCount'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + return _json; + } +} + +/// Details of a LabelTextClassification operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelTextClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelTextClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelTextClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelTextEntityExtraction operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelTextEntityExtractionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelTextEntityExtractionOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelTextEntityExtractionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoClassification operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelVideoClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelVideoClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelVideoClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoEvent operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelVideoEventOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelVideoEventOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelVideoEventOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectDetection operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelVideoObjectDetectionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelVideoObjectDetectionOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelVideoObjectDetectionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectTracking operation metadata. +class GoogleCloudDatalabelingV1alpha1LabelVideoObjectTrackingOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1alpha1LabelVideoObjectTrackingOperationMetadata(); + + GoogleCloudDatalabelingV1alpha1LabelVideoObjectTrackingOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// The configuration of output data. +class GoogleCloudDatalabelingV1alpha1OutputConfig { + /// Output to a file in Cloud Storage. + /// + /// Should be used for labeling output other than image segmentation. + GoogleCloudDatalabelingV1alpha1GcsDestination gcsDestination; + + /// Output to a folder in Cloud Storage. + /// + /// Should be used for image segmentation or document de-identification + /// labeling outputs. + GoogleCloudDatalabelingV1alpha1GcsFolderDestination gcsFolderDestination; + + GoogleCloudDatalabelingV1alpha1OutputConfig(); + + GoogleCloudDatalabelingV1alpha1OutputConfig.fromJson(core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = GoogleCloudDatalabelingV1alpha1GcsDestination.fromJson( + _json['gcsDestination'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('gcsFolderDestination')) { + gcsFolderDestination = + GoogleCloudDatalabelingV1alpha1GcsFolderDestination.fromJson( + _json['gcsFolderDestination'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination.toJson(); + } + if (gcsFolderDestination != null) { + _json['gcsFolderDestination'] = gcsFolderDestination.toJson(); + } + return _json; + } +} + +/// AnnotatedDataset is a set holding annotations for data in a Dataset. +/// +/// Each labeling task will generate an AnnotatedDataset under the Dataset that +/// the task is requested for. +class GoogleCloudDatalabelingV1beta1AnnotatedDataset { + /// Source of the annotation. + /// + /// Output only. + /// Possible string values are: + /// - "ANNOTATION_SOURCE_UNSPECIFIED" + /// - "OPERATOR" : Answer is provided by a human contributor. + core.String annotationSource; + + /// Type of the annotation. + /// + /// It is specified when starting labeling task. + /// + /// Output only. + /// Possible string values are: + /// - "ANNOTATION_TYPE_UNSPECIFIED" + /// - "IMAGE_CLASSIFICATION_ANNOTATION" : Classification annotations in an + /// image. Allowed for continuous evaluation. + /// - "IMAGE_BOUNDING_BOX_ANNOTATION" : Bounding box annotations in an image. + /// A form of image object detection. Allowed for continuous evaluation. + /// - "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION" : Oriented bounding box. The + /// box does not have to be parallel to horizontal line. + /// - "IMAGE_BOUNDING_POLY_ANNOTATION" : Bounding poly annotations in an + /// image. + /// - "IMAGE_POLYLINE_ANNOTATION" : Polyline annotations in an image. + /// - "IMAGE_SEGMENTATION_ANNOTATION" : Segmentation annotations in an image. + /// - "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION" : Classification annotations in + /// video shots. + /// - "VIDEO_OBJECT_TRACKING_ANNOTATION" : Video object tracking annotation. + /// - "VIDEO_OBJECT_DETECTION_ANNOTATION" : Video object detection annotation. + /// - "VIDEO_EVENT_ANNOTATION" : Video event annotation. + /// - "TEXT_CLASSIFICATION_ANNOTATION" : Classification for text. Allowed for + /// continuous evaluation. + /// - "TEXT_ENTITY_EXTRACTION_ANNOTATION" : Entity extraction for text. + /// - "GENERAL_CLASSIFICATION_ANNOTATION" : General classification. Allowed + /// for continuous evaluation. + core.String annotationType; + + /// The names of any related resources that are blocking changes to the + /// annotated dataset. + /// + /// Output only. + core.List<core.String> blockingResources; + + /// Number of examples that have annotation in the annotated dataset. + /// + /// Output only. + core.String completedExampleCount; + + /// Time the AnnotatedDataset was created. + /// + /// Output only. + core.String createTime; + + /// The description of the AnnotatedDataset. + /// + /// It is specified in HumanAnnotationConfig when user starts a labeling task. + /// Maximum of 10000 characters. + /// + /// Output only. + core.String description; + + /// The display name of the AnnotatedDataset. + /// + /// It is specified in HumanAnnotationConfig when user starts a labeling task. + /// Maximum of 64 characters. + /// + /// Output only. + core.String displayName; + + /// Number of examples in the annotated dataset. + /// + /// Output only. + core.String exampleCount; + + /// Per label statistics. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1LabelStats labelStats; + + /// Additional information about AnnotatedDataset. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1AnnotatedDatasetMetadata metadata; + + /// AnnotatedDataset resource name in format of: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id} + /// + /// Output only. + core.String name; + + GoogleCloudDatalabelingV1beta1AnnotatedDataset(); + + GoogleCloudDatalabelingV1beta1AnnotatedDataset.fromJson(core.Map _json) { + if (_json.containsKey('annotationSource')) { + annotationSource = _json['annotationSource'] as core.String; + } + if (_json.containsKey('annotationType')) { + annotationType = _json['annotationType'] as core.String; + } + if (_json.containsKey('blockingResources')) { + blockingResources = (_json['blockingResources'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('completedExampleCount')) { + completedExampleCount = _json['completedExampleCount'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('exampleCount')) { + exampleCount = _json['exampleCount'] as core.String; + } + if (_json.containsKey('labelStats')) { + labelStats = GoogleCloudDatalabelingV1beta1LabelStats.fromJson( + _json['labelStats'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + GoogleCloudDatalabelingV1beta1AnnotatedDatasetMetadata.fromJson( + _json['metadata'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSource != null) { + _json['annotationSource'] = annotationSource; + } + if (annotationType != null) { + _json['annotationType'] = annotationType; + } + if (blockingResources != null) { + _json['blockingResources'] = blockingResources; + } + if (completedExampleCount != null) { + _json['completedExampleCount'] = completedExampleCount; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + if (labelStats != null) { + _json['labelStats'] = labelStats.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Metadata on AnnotatedDataset. +class GoogleCloudDatalabelingV1beta1AnnotatedDatasetMetadata { + /// Configuration for image bounding box and bounding poly task. + GoogleCloudDatalabelingV1beta1BoundingPolyConfig boundingPolyConfig; + + /// Configuration for video event labeling task. + GoogleCloudDatalabelingV1beta1EventConfig eventConfig; + + /// HumanAnnotationConfig used when requesting the human labeling task for + /// this AnnotatedDataset. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig humanAnnotationConfig; + + /// Configuration for image classification task. + GoogleCloudDatalabelingV1beta1ImageClassificationConfig + imageClassificationConfig; + + /// Configuration for video object detection task. + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig objectDetectionConfig; + + /// Configuration for video object tracking task. + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig objectTrackingConfig; + + /// Configuration for image polyline task. + GoogleCloudDatalabelingV1beta1PolylineConfig polylineConfig; + + /// Configuration for image segmentation task. + GoogleCloudDatalabelingV1beta1SegmentationConfig segmentationConfig; + + /// Configuration for text classification task. + GoogleCloudDatalabelingV1beta1TextClassificationConfig + textClassificationConfig; + + /// Configuration for text entity extraction task. + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig + textEntityExtractionConfig; + + /// Configuration for video classification task. + GoogleCloudDatalabelingV1beta1VideoClassificationConfig + videoClassificationConfig; + + GoogleCloudDatalabelingV1beta1AnnotatedDatasetMetadata(); + + GoogleCloudDatalabelingV1beta1AnnotatedDatasetMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('boundingPolyConfig')) { + boundingPolyConfig = + GoogleCloudDatalabelingV1beta1BoundingPolyConfig.fromJson( + _json['boundingPolyConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('eventConfig')) { + eventConfig = GoogleCloudDatalabelingV1beta1EventConfig.fromJson( + _json['eventConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('humanAnnotationConfig')) { + humanAnnotationConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['humanAnnotationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationConfig')) { + imageClassificationConfig = + GoogleCloudDatalabelingV1beta1ImageClassificationConfig.fromJson( + _json['imageClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('objectDetectionConfig')) { + objectDetectionConfig = + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig.fromJson( + _json['objectDetectionConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('objectTrackingConfig')) { + objectTrackingConfig = + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig.fromJson( + _json['objectTrackingConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('polylineConfig')) { + polylineConfig = GoogleCloudDatalabelingV1beta1PolylineConfig.fromJson( + _json['polylineConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('segmentationConfig')) { + segmentationConfig = + GoogleCloudDatalabelingV1beta1SegmentationConfig.fromJson( + _json['segmentationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textClassificationConfig')) { + textClassificationConfig = + GoogleCloudDatalabelingV1beta1TextClassificationConfig.fromJson( + _json['textClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionConfig')) { + textEntityExtractionConfig = + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig.fromJson( + _json['textEntityExtractionConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationConfig')) { + videoClassificationConfig = + GoogleCloudDatalabelingV1beta1VideoClassificationConfig.fromJson( + _json['videoClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boundingPolyConfig != null) { + _json['boundingPolyConfig'] = boundingPolyConfig.toJson(); + } + if (eventConfig != null) { + _json['eventConfig'] = eventConfig.toJson(); + } + if (humanAnnotationConfig != null) { + _json['humanAnnotationConfig'] = humanAnnotationConfig.toJson(); + } + if (imageClassificationConfig != null) { + _json['imageClassificationConfig'] = imageClassificationConfig.toJson(); + } + if (objectDetectionConfig != null) { + _json['objectDetectionConfig'] = objectDetectionConfig.toJson(); + } + if (objectTrackingConfig != null) { + _json['objectTrackingConfig'] = objectTrackingConfig.toJson(); + } + if (polylineConfig != null) { + _json['polylineConfig'] = polylineConfig.toJson(); + } + if (segmentationConfig != null) { + _json['segmentationConfig'] = segmentationConfig.toJson(); + } + if (textClassificationConfig != null) { + _json['textClassificationConfig'] = textClassificationConfig.toJson(); + } + if (textEntityExtractionConfig != null) { + _json['textEntityExtractionConfig'] = textEntityExtractionConfig.toJson(); + } + if (videoClassificationConfig != null) { + _json['videoClassificationConfig'] = videoClassificationConfig.toJson(); + } + return _json; + } +} + +/// Annotation for Example. +/// +/// Each example may have one or more annotations. For example in image +/// classification problem, each image might have one or more labels. We call +/// labels binded with this image an Annotation. +class GoogleCloudDatalabelingV1beta1Annotation { + /// Annotation metadata, including information like votes for labels. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1AnnotationMetadata annotationMetadata; + + /// Sentiment for this annotation. + /// + /// Output only. + /// Possible string values are: + /// - "ANNOTATION_SENTIMENT_UNSPECIFIED" + /// - "NEGATIVE" : This annotation describes negatively about the data. + /// - "POSITIVE" : This label describes positively about the data. + core.String annotationSentiment; + + /// The source of the annotation. + /// + /// Output only. + /// Possible string values are: + /// - "ANNOTATION_SOURCE_UNSPECIFIED" + /// - "OPERATOR" : Answer is provided by a human contributor. + core.String annotationSource; + + /// This is the actual annotation value, e.g classification, bounding box + /// values are stored here. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1AnnotationValue annotationValue; + + /// Unique name of this annotation, format is: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} + /// + /// Output only. + core.String name; + + GoogleCloudDatalabelingV1beta1Annotation(); + + GoogleCloudDatalabelingV1beta1Annotation.fromJson(core.Map _json) { + if (_json.containsKey('annotationMetadata')) { + annotationMetadata = + GoogleCloudDatalabelingV1beta1AnnotationMetadata.fromJson( + _json['annotationMetadata'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('annotationSentiment')) { + annotationSentiment = _json['annotationSentiment'] as core.String; + } + if (_json.containsKey('annotationSource')) { + annotationSource = _json['annotationSource'] as core.String; + } + if (_json.containsKey('annotationValue')) { + annotationValue = GoogleCloudDatalabelingV1beta1AnnotationValue.fromJson( + _json['annotationValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationMetadata != null) { + _json['annotationMetadata'] = annotationMetadata.toJson(); + } + if (annotationSentiment != null) { + _json['annotationSentiment'] = annotationSentiment; + } + if (annotationSource != null) { + _json['annotationSource'] = annotationSource; + } + if (annotationValue != null) { + _json['annotationValue'] = annotationValue.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Additional information associated with the annotation. +class GoogleCloudDatalabelingV1beta1AnnotationMetadata { + /// Metadata related to human labeling. + GoogleCloudDatalabelingV1beta1OperatorMetadata operatorMetadata; + + GoogleCloudDatalabelingV1beta1AnnotationMetadata(); + + GoogleCloudDatalabelingV1beta1AnnotationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('operatorMetadata')) { + operatorMetadata = + GoogleCloudDatalabelingV1beta1OperatorMetadata.fromJson( + _json['operatorMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (operatorMetadata != null) { + _json['operatorMetadata'] = operatorMetadata.toJson(); + } + return _json; + } +} + +/// Container of information related to one possible annotation that can be used +/// in a labeling task. +/// +/// For example, an image classification task where images are labeled as `dog` +/// or `cat` must reference an AnnotationSpec for `dog` and an AnnotationSpec +/// for `cat`. +class GoogleCloudDatalabelingV1beta1AnnotationSpec { + /// User-provided description of the annotation specification. + /// + /// The description can be up to 10,000 characters long. + /// + /// Optional. + core.String description; + + /// The display name of the AnnotationSpec. + /// + /// Maximum of 64 characters. + /// + /// Required. + core.String displayName; + + /// This is the integer index of the AnnotationSpec. + /// + /// The index for the whole AnnotationSpecSet is sequential starting from 0. + /// For example, an AnnotationSpecSet with classes `dog` and `cat`, might + /// contain one AnnotationSpec with `{ display_name: "dog", index: 0 }` and + /// one AnnotationSpec with `{ display_name: "cat", index: 1 }`. This is + /// especially useful for model training as it encodes the string labels into + /// numeric values. + /// + /// Output only. + core.int index; + + GoogleCloudDatalabelingV1beta1AnnotationSpec(); + + GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('index')) { + index = _json['index'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (index != null) { + _json['index'] = index; + } + return _json; + } +} + +/// An AnnotationSpecSet is a collection of label definitions. +/// +/// For example, in image classification tasks, you define a set of possible +/// labels for images as an AnnotationSpecSet. An AnnotationSpecSet is immutable +/// upon creation. +class GoogleCloudDatalabelingV1beta1AnnotationSpecSet { + /// The array of AnnotationSpecs that you define when you create the + /// AnnotationSpecSet. + /// + /// These are the possible labels for the labeling task. + /// + /// Required. + core.List<GoogleCloudDatalabelingV1beta1AnnotationSpec> annotationSpecs; + + /// The names of any related resources that are blocking changes to the + /// annotation spec set. + /// + /// Output only. + core.List<core.String> blockingResources; + + /// User-provided description of the annotation specification set. + /// + /// The description can be up to 10,000 characters long. + /// + /// Optional. + core.String description; + + /// The display name for AnnotationSpecSet that you define when you create it. + /// + /// Maximum of 64 characters. + /// + /// Required. + core.String displayName; + + /// The AnnotationSpecSet resource name in the following format: + /// "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" + /// + /// Output only. + core.String name; + + GoogleCloudDatalabelingV1beta1AnnotationSpecSet(); + + GoogleCloudDatalabelingV1beta1AnnotationSpecSet.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecs')) { + annotationSpecs = (_json['annotationSpecs'] as core.List) + .map<GoogleCloudDatalabelingV1beta1AnnotationSpec>((value) => + GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('blockingResources')) { + blockingResources = (_json['blockingResources'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecs != null) { + _json['annotationSpecs'] = + annotationSpecs.map((value) => value.toJson()).toList(); + } + if (blockingResources != null) { + _json['blockingResources'] = blockingResources; + } + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Annotation spec set with the setting of allowing multi labels or not. +class GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig { + /// If allow_multi_label is true, contributors are able to choose multiple + /// labels from one annotation spec set. + /// + /// Optional. + core.bool allowMultiLabel; + + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig(); + + GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig.fromJson( + core.Map _json) { + if (_json.containsKey('allowMultiLabel')) { + allowMultiLabel = _json['allowMultiLabel'] as core.bool; + } + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowMultiLabel != null) { + _json['allowMultiLabel'] = allowMultiLabel; + } + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + return _json; + } +} + +/// Annotation value for an example. +class GoogleCloudDatalabelingV1beta1AnnotationValue { + /// Annotation value for image bounding box, oriented bounding box and polygon + /// cases. + GoogleCloudDatalabelingV1beta1ImageBoundingPolyAnnotation + imageBoundingPolyAnnotation; + + /// Annotation value for image classification case. + GoogleCloudDatalabelingV1beta1ImageClassificationAnnotation + imageClassificationAnnotation; + + /// Annotation value for image polyline cases. + /// + /// Polyline here is different from BoundingPoly. It is formed by line + /// segments connected to each other but not closed form(Bounding Poly). The + /// line segments can cross each other. + GoogleCloudDatalabelingV1beta1ImagePolylineAnnotation imagePolylineAnnotation; + + /// Annotation value for image segmentation. + GoogleCloudDatalabelingV1beta1ImageSegmentationAnnotation + imageSegmentationAnnotation; + + /// Annotation value for text classification case. + GoogleCloudDatalabelingV1beta1TextClassificationAnnotation + textClassificationAnnotation; + + /// Annotation value for text entity extraction case. + GoogleCloudDatalabelingV1beta1TextEntityExtractionAnnotation + textEntityExtractionAnnotation; + + /// Annotation value for video classification case. + GoogleCloudDatalabelingV1beta1VideoClassificationAnnotation + videoClassificationAnnotation; + + /// Annotation value for video event case. + GoogleCloudDatalabelingV1beta1VideoEventAnnotation videoEventAnnotation; + + /// Annotation value for video object detection and tracking case. + GoogleCloudDatalabelingV1beta1VideoObjectTrackingAnnotation + videoObjectTrackingAnnotation; + + GoogleCloudDatalabelingV1beta1AnnotationValue(); + + GoogleCloudDatalabelingV1beta1AnnotationValue.fromJson(core.Map _json) { + if (_json.containsKey('imageBoundingPolyAnnotation')) { + imageBoundingPolyAnnotation = + GoogleCloudDatalabelingV1beta1ImageBoundingPolyAnnotation.fromJson( + _json['imageBoundingPolyAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationAnnotation')) { + imageClassificationAnnotation = + GoogleCloudDatalabelingV1beta1ImageClassificationAnnotation.fromJson( + _json['imageClassificationAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imagePolylineAnnotation')) { + imagePolylineAnnotation = + GoogleCloudDatalabelingV1beta1ImagePolylineAnnotation.fromJson( + _json['imagePolylineAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageSegmentationAnnotation')) { + imageSegmentationAnnotation = + GoogleCloudDatalabelingV1beta1ImageSegmentationAnnotation.fromJson( + _json['imageSegmentationAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textClassificationAnnotation')) { + textClassificationAnnotation = + GoogleCloudDatalabelingV1beta1TextClassificationAnnotation.fromJson( + _json['textClassificationAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionAnnotation')) { + textEntityExtractionAnnotation = + GoogleCloudDatalabelingV1beta1TextEntityExtractionAnnotation.fromJson( + _json['textEntityExtractionAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationAnnotation')) { + videoClassificationAnnotation = + GoogleCloudDatalabelingV1beta1VideoClassificationAnnotation.fromJson( + _json['videoClassificationAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoEventAnnotation')) { + videoEventAnnotation = + GoogleCloudDatalabelingV1beta1VideoEventAnnotation.fromJson( + _json['videoEventAnnotation'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectTrackingAnnotation')) { + videoObjectTrackingAnnotation = + GoogleCloudDatalabelingV1beta1VideoObjectTrackingAnnotation.fromJson( + _json['videoObjectTrackingAnnotation'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (imageBoundingPolyAnnotation != null) { + _json['imageBoundingPolyAnnotation'] = + imageBoundingPolyAnnotation.toJson(); + } + if (imageClassificationAnnotation != null) { + _json['imageClassificationAnnotation'] = + imageClassificationAnnotation.toJson(); + } + if (imagePolylineAnnotation != null) { + _json['imagePolylineAnnotation'] = imagePolylineAnnotation.toJson(); + } + if (imageSegmentationAnnotation != null) { + _json['imageSegmentationAnnotation'] = + imageSegmentationAnnotation.toJson(); + } + if (textClassificationAnnotation != null) { + _json['textClassificationAnnotation'] = + textClassificationAnnotation.toJson(); + } + if (textEntityExtractionAnnotation != null) { + _json['textEntityExtractionAnnotation'] = + textEntityExtractionAnnotation.toJson(); + } + if (videoClassificationAnnotation != null) { + _json['videoClassificationAnnotation'] = + videoClassificationAnnotation.toJson(); + } + if (videoEventAnnotation != null) { + _json['videoEventAnnotation'] = videoEventAnnotation.toJson(); + } + if (videoObjectTrackingAnnotation != null) { + _json['videoObjectTrackingAnnotation'] = + videoObjectTrackingAnnotation.toJson(); + } + return _json; + } +} + +/// Records a failed evaluation job run. +class GoogleCloudDatalabelingV1beta1Attempt { + core.String attemptTime; + + /// Details of errors that occurred. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1beta1Attempt(); + + GoogleCloudDatalabelingV1beta1Attempt.fromJson(core.Map _json) { + if (_json.containsKey('attemptTime')) { + attemptTime = _json['attemptTime'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attemptTime != null) { + _json['attemptTime'] = attemptTime; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The BigQuery location for input data. +/// +/// If used in an EvaluationJob, this is where the service saves the prediction +/// input and output sampled from the model version. +class GoogleCloudDatalabelingV1beta1BigQuerySource { + /// BigQuery URI to a table, up to 2,000 characters long. + /// + /// If you specify the URI of a table that does not exist, Data Labeling + /// Service creates a table at the URI with the correct schema when you create + /// your EvaluationJob. If you specify the URI of a table that already exists, + /// it must have the \[correct + /// schema\](/ml-engine/docs/continuous-evaluation/create-job#table-schema). + /// Provide the table URI in the following format: "bq://{your_project_id}/ + /// {your_dataset_name}/{your_table_name}" \[Learn + /// more\](/ml-engine/docs/continuous-evaluation/create-job#table-schema). + /// + /// Required. + core.String inputUri; + + GoogleCloudDatalabelingV1beta1BigQuerySource(); + + GoogleCloudDatalabelingV1beta1BigQuerySource.fromJson(core.Map _json) { + if (_json.containsKey('inputUri')) { + inputUri = _json['inputUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputUri != null) { + _json['inputUri'] = inputUri; + } + return _json; + } +} + +/// Options regarding evaluation between bounding boxes. +class GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions { + /// Minimum \[intersection-over-union + /// (IOU)\](/vision/automl/object-detection/docs/evaluate#intersection-over-union) + /// required for 2 bounding boxes to be considered a match. + /// + /// This must be a number between 0 and 1. + core.double iouThreshold; + + GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions(); + + GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions.fromJson( + core.Map _json) { + if (_json.containsKey('iouThreshold')) { + iouThreshold = (_json['iouThreshold'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (iouThreshold != null) { + _json['iouThreshold'] = iouThreshold; + } + return _json; + } +} + +/// A bounding polygon in the image. +class GoogleCloudDatalabelingV1beta1BoundingPoly { + /// The bounding polygon vertices. + core.List<GoogleCloudDatalabelingV1beta1Vertex> vertices; + + GoogleCloudDatalabelingV1beta1BoundingPoly(); + + GoogleCloudDatalabelingV1beta1BoundingPoly.fromJson(core.Map _json) { + if (_json.containsKey('vertices')) { + vertices = (_json['vertices'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Vertex>((value) => + GoogleCloudDatalabelingV1beta1Vertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vertices != null) { + _json['vertices'] = vertices.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Config for image bounding poly (and bounding box) human labeling task. +class GoogleCloudDatalabelingV1beta1BoundingPolyConfig { + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// Instruction message showed on contributors UI. + /// + /// Optional. + core.String instructionMessage; + + GoogleCloudDatalabelingV1beta1BoundingPolyConfig(); + + GoogleCloudDatalabelingV1beta1BoundingPolyConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('instructionMessage')) { + instructionMessage = _json['instructionMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (instructionMessage != null) { + _json['instructionMessage'] = instructionMessage; + } + return _json; + } +} + +/// Metadata for classification annotations. +class GoogleCloudDatalabelingV1beta1ClassificationMetadata { + /// Whether the classification task is multi-label or not. + core.bool isMultiLabel; + + GoogleCloudDatalabelingV1beta1ClassificationMetadata(); + + GoogleCloudDatalabelingV1beta1ClassificationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('isMultiLabel')) { + isMultiLabel = _json['isMultiLabel'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (isMultiLabel != null) { + _json['isMultiLabel'] = isMultiLabel; + } + return _json; + } +} + +/// Metrics calculated for a classification model. +class GoogleCloudDatalabelingV1beta1ClassificationMetrics { + /// Confusion matrix of predicted labels vs. + /// + /// ground truth labels. + GoogleCloudDatalabelingV1beta1ConfusionMatrix confusionMatrix; + + /// Precision-recall curve based on ground truth labels, predicted labels, and + /// scores for the predicted labels. + GoogleCloudDatalabelingV1beta1PrCurve prCurve; + + GoogleCloudDatalabelingV1beta1ClassificationMetrics(); + + GoogleCloudDatalabelingV1beta1ClassificationMetrics.fromJson(core.Map _json) { + if (_json.containsKey('confusionMatrix')) { + confusionMatrix = GoogleCloudDatalabelingV1beta1ConfusionMatrix.fromJson( + _json['confusionMatrix'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('prCurve')) { + prCurve = GoogleCloudDatalabelingV1beta1PrCurve.fromJson( + _json['prCurve'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confusionMatrix != null) { + _json['confusionMatrix'] = confusionMatrix.toJson(); + } + if (prCurve != null) { + _json['prCurve'] = prCurve.toJson(); + } + return _json; + } +} + +class GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry { + /// Threshold used for this entry. + /// + /// For classification tasks, this is a classification threshold: a predicted + /// label is categorized as positive or negative (in the context of this point + /// on the PR curve) based on whether the label's score meets this threshold. + /// For image object detection (bounding box) tasks, this is the + /// \[intersection-over-union + /// (IOU)\](/vision/automl/object-detection/docs/evaluate#intersection-over-union) + /// threshold for the context of this point on the PR curve. + core.double confidenceThreshold; + + /// Harmonic mean of recall and precision. + core.double f1Score; + + /// The harmonic mean of recall_at1 and precision_at1. + core.double f1ScoreAt1; + + /// The harmonic mean of recall_at5 and precision_at5. + core.double f1ScoreAt5; + + /// Precision value. + core.double precision; + + /// Precision value for entries with label that has highest score. + core.double precisionAt1; + + /// Precision value for entries with label that has highest 5 scores. + core.double precisionAt5; + + /// Recall value. + core.double recall; + + /// Recall value for entries with label that has highest score. + core.double recallAt1; + + /// Recall value for entries with label that has highest 5 scores. + core.double recallAt5; + + GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry(); + + GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry.fromJson( + core.Map _json) { + if (_json.containsKey('confidenceThreshold')) { + confidenceThreshold = + (_json['confidenceThreshold'] as core.num).toDouble(); + } + if (_json.containsKey('f1Score')) { + f1Score = (_json['f1Score'] as core.num).toDouble(); + } + if (_json.containsKey('f1ScoreAt1')) { + f1ScoreAt1 = (_json['f1ScoreAt1'] as core.num).toDouble(); + } + if (_json.containsKey('f1ScoreAt5')) { + f1ScoreAt5 = (_json['f1ScoreAt5'] as core.num).toDouble(); + } + if (_json.containsKey('precision')) { + precision = (_json['precision'] as core.num).toDouble(); + } + if (_json.containsKey('precisionAt1')) { + precisionAt1 = (_json['precisionAt1'] as core.num).toDouble(); + } + if (_json.containsKey('precisionAt5')) { + precisionAt5 = (_json['precisionAt5'] as core.num).toDouble(); + } + if (_json.containsKey('recall')) { + recall = (_json['recall'] as core.num).toDouble(); + } + if (_json.containsKey('recallAt1')) { + recallAt1 = (_json['recallAt1'] as core.num).toDouble(); + } + if (_json.containsKey('recallAt5')) { + recallAt5 = (_json['recallAt5'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confidenceThreshold != null) { + _json['confidenceThreshold'] = confidenceThreshold; + } + if (f1Score != null) { + _json['f1Score'] = f1Score; + } + if (f1ScoreAt1 != null) { + _json['f1ScoreAt1'] = f1ScoreAt1; + } + if (f1ScoreAt5 != null) { + _json['f1ScoreAt5'] = f1ScoreAt5; + } + if (precision != null) { + _json['precision'] = precision; + } + if (precisionAt1 != null) { + _json['precisionAt1'] = precisionAt1; + } + if (precisionAt5 != null) { + _json['precisionAt5'] = precisionAt5; + } + if (recall != null) { + _json['recall'] = recall; + } + if (recallAt1 != null) { + _json['recallAt1'] = recallAt1; + } + if (recallAt5 != null) { + _json['recallAt5'] = recallAt5; + } + return _json; + } +} + +/// Confusion matrix of the model running the classification. +/// +/// Only applicable when the metrics entry aggregates multiple labels. Not +/// applicable when the entry is for a single label. +class GoogleCloudDatalabelingV1beta1ConfusionMatrix { + core.List<GoogleCloudDatalabelingV1beta1Row> row; + + GoogleCloudDatalabelingV1beta1ConfusionMatrix(); + + GoogleCloudDatalabelingV1beta1ConfusionMatrix.fromJson(core.Map _json) { + if (_json.containsKey('row')) { + row = (_json['row'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Row>((value) => + GoogleCloudDatalabelingV1beta1Row.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (row != null) { + _json['row'] = row.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +class GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry { + /// The annotation spec of a predicted label. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// Number of items predicted to have this label. + /// + /// (The ground truth label for these items is the `Row.annotationSpec` of + /// this entry's parent.) + core.int itemCount; + + GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry(); + + GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('itemCount')) { + itemCount = _json['itemCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (itemCount != null) { + _json['itemCount'] = itemCount; + } + return _json; + } +} + +/// Request message for CreateAnnotationSpecSet. +class GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest { + /// Annotation spec set to create. + /// + /// Annotation specs must be included. Only one annotation spec will be + /// accepted for annotation specs with same display_name. + /// + /// Required. + GoogleCloudDatalabelingV1beta1AnnotationSpecSet annotationSpecSet; + + GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest(); + + GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = + GoogleCloudDatalabelingV1beta1AnnotationSpecSet.fromJson( + _json['annotationSpecSet'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet.toJson(); + } + return _json; + } +} + +/// Request message for CreateDataset. +class GoogleCloudDatalabelingV1beta1CreateDatasetRequest { + /// The dataset to be created. + /// + /// Required. + GoogleCloudDatalabelingV1beta1Dataset dataset; + + GoogleCloudDatalabelingV1beta1CreateDatasetRequest(); + + GoogleCloudDatalabelingV1beta1CreateDatasetRequest.fromJson(core.Map _json) { + if (_json.containsKey('dataset')) { + dataset = GoogleCloudDatalabelingV1beta1Dataset.fromJson( + _json['dataset'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataset != null) { + _json['dataset'] = dataset.toJson(); + } + return _json; + } +} + +/// Request message for CreateEvaluationJob. +class GoogleCloudDatalabelingV1beta1CreateEvaluationJobRequest { + /// The evaluation job to create. + /// + /// Required. + GoogleCloudDatalabelingV1beta1EvaluationJob job; + + GoogleCloudDatalabelingV1beta1CreateEvaluationJobRequest(); + + GoogleCloudDatalabelingV1beta1CreateEvaluationJobRequest.fromJson( + core.Map _json) { + if (_json.containsKey('job')) { + job = GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson( + _json['job'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (job != null) { + _json['job'] = job.toJson(); + } + return _json; + } +} + +/// Metadata of a CreateInstruction operation. +class GoogleCloudDatalabelingV1beta1CreateInstructionMetadata { + /// Timestamp when create instruction request was created. + core.String createTime; + + /// The name of the created Instruction. + /// + /// projects/{project_id}/instructions/{instruction_id} + core.String instruction; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1beta1CreateInstructionMetadata(); + + GoogleCloudDatalabelingV1beta1CreateInstructionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for CreateInstruction. +class GoogleCloudDatalabelingV1beta1CreateInstructionRequest { + /// Instruction of how to perform the labeling task. + /// + /// Required. + GoogleCloudDatalabelingV1beta1Instruction instruction; + + GoogleCloudDatalabelingV1beta1CreateInstructionRequest(); + + GoogleCloudDatalabelingV1beta1CreateInstructionRequest.fromJson( + core.Map _json) { + if (_json.containsKey('instruction')) { + instruction = GoogleCloudDatalabelingV1beta1Instruction.fromJson( + _json['instruction'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (instruction != null) { + _json['instruction'] = instruction.toJson(); + } + return _json; + } +} + +/// Deprecated: this instruction format is not supported any more. +/// +/// Instruction from a CSV file. +class GoogleCloudDatalabelingV1beta1CsvInstruction { + /// CSV file for the instruction. + /// + /// Only gcs path is allowed. + core.String gcsFileUri; + + GoogleCloudDatalabelingV1beta1CsvInstruction(); + + GoogleCloudDatalabelingV1beta1CsvInstruction.fromJson(core.Map _json) { + if (_json.containsKey('gcsFileUri')) { + gcsFileUri = _json['gcsFileUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsFileUri != null) { + _json['gcsFileUri'] = gcsFileUri; + } + return _json; + } +} + +/// DataItem is a piece of data, without annotation. +/// +/// For example, an image. +class GoogleCloudDatalabelingV1beta1DataItem { + /// The image payload, a container of the image bytes/uri. + GoogleCloudDatalabelingV1beta1ImagePayload imagePayload; + + /// Name of the data item, in format of: + /// projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} + /// + /// Output only. + core.String name; + + /// The text payload, a container of text content. + GoogleCloudDatalabelingV1beta1TextPayload textPayload; + + /// The video payload, a container of the video uri. + GoogleCloudDatalabelingV1beta1VideoPayload videoPayload; + + GoogleCloudDatalabelingV1beta1DataItem(); + + GoogleCloudDatalabelingV1beta1DataItem.fromJson(core.Map _json) { + if (_json.containsKey('imagePayload')) { + imagePayload = GoogleCloudDatalabelingV1beta1ImagePayload.fromJson( + _json['imagePayload'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('textPayload')) { + textPayload = GoogleCloudDatalabelingV1beta1TextPayload.fromJson( + _json['textPayload'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoPayload')) { + videoPayload = GoogleCloudDatalabelingV1beta1VideoPayload.fromJson( + _json['videoPayload'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (imagePayload != null) { + _json['imagePayload'] = imagePayload.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (textPayload != null) { + _json['textPayload'] = textPayload.toJson(); + } + if (videoPayload != null) { + _json['videoPayload'] = videoPayload.toJson(); + } + return _json; + } +} + +/// Dataset is the resource to hold your data. +/// +/// You can request multiple labeling tasks for a dataset while each one will +/// generate an AnnotatedDataset. +class GoogleCloudDatalabelingV1beta1Dataset { + /// The names of any related resources that are blocking changes to the + /// dataset. + /// + /// Output only. + core.List<core.String> blockingResources; + + /// Time the dataset is created. + /// + /// Output only. + core.String createTime; + + /// The number of data items in the dataset. + /// + /// Output only. + core.String dataItemCount; + + /// User-provided description of the annotation specification set. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String description; + + /// The display name of the dataset. + /// + /// Maximum of 64 characters. + /// + /// Required. + core.String displayName; + + /// This is populated with the original input configs where ImportData is + /// called. + /// + /// It is available only after the clients import data to this dataset. + /// + /// Output only. + core.List<GoogleCloudDatalabelingV1beta1InputConfig> inputConfigs; + + /// Last time that the Dataset is migrated to AI Platform V2. + /// + /// If any of the AnnotatedDataset is migrated, the last_migration_time in + /// Dataset is also updated. + core.String lastMigrateTime; + + /// Dataset resource name, format is: + /// projects/{project_id}/datasets/{dataset_id} + /// + /// Output only. + core.String name; + + GoogleCloudDatalabelingV1beta1Dataset(); + + GoogleCloudDatalabelingV1beta1Dataset.fromJson(core.Map _json) { + if (_json.containsKey('blockingResources')) { + blockingResources = (_json['blockingResources'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataItemCount')) { + dataItemCount = _json['dataItemCount'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('inputConfigs')) { + inputConfigs = (_json['inputConfigs'] as core.List) + .map<GoogleCloudDatalabelingV1beta1InputConfig>((value) => + GoogleCloudDatalabelingV1beta1InputConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('lastMigrateTime')) { + lastMigrateTime = _json['lastMigrateTime'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (blockingResources != null) { + _json['blockingResources'] = blockingResources; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataItemCount != null) { + _json['dataItemCount'] = dataItemCount; + } + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (inputConfigs != null) { + _json['inputConfigs'] = + inputConfigs.map((value) => value.toJson()).toList(); + } + if (lastMigrateTime != null) { + _json['lastMigrateTime'] = lastMigrateTime; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Describes an evaluation between a machine learning model's predictions and +/// ground truth labels. +/// +/// Created when an EvaluationJob runs successfully. +class GoogleCloudDatalabelingV1beta1Evaluation { + /// Type of task that the model version being evaluated performs, as defined + /// in the evaluationJobConfig.inputConfig.annotationType field of the + /// evaluation job that created this evaluation. + /// + /// Output only. + /// Possible string values are: + /// - "ANNOTATION_TYPE_UNSPECIFIED" + /// - "IMAGE_CLASSIFICATION_ANNOTATION" : Classification annotations in an + /// image. Allowed for continuous evaluation. + /// - "IMAGE_BOUNDING_BOX_ANNOTATION" : Bounding box annotations in an image. + /// A form of image object detection. Allowed for continuous evaluation. + /// - "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION" : Oriented bounding box. The + /// box does not have to be parallel to horizontal line. + /// - "IMAGE_BOUNDING_POLY_ANNOTATION" : Bounding poly annotations in an + /// image. + /// - "IMAGE_POLYLINE_ANNOTATION" : Polyline annotations in an image. + /// - "IMAGE_SEGMENTATION_ANNOTATION" : Segmentation annotations in an image. + /// - "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION" : Classification annotations in + /// video shots. + /// - "VIDEO_OBJECT_TRACKING_ANNOTATION" : Video object tracking annotation. + /// - "VIDEO_OBJECT_DETECTION_ANNOTATION" : Video object detection annotation. + /// - "VIDEO_EVENT_ANNOTATION" : Video event annotation. + /// - "TEXT_CLASSIFICATION_ANNOTATION" : Classification for text. Allowed for + /// continuous evaluation. + /// - "TEXT_ENTITY_EXTRACTION_ANNOTATION" : Entity extraction for text. + /// - "GENERAL_CLASSIFICATION_ANNOTATION" : General classification. Allowed + /// for continuous evaluation. + core.String annotationType; + + /// Options used in the evaluation job that created this evaluation. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1EvaluationConfig config; + + /// Timestamp for when this evaluation was created. + /// + /// Output only. + core.String createTime; + + /// The number of items in the ground truth dataset that were used for this + /// evaluation. + /// + /// Only populated when the evaulation is for certain AnnotationTypes. + /// + /// Output only. + core.String evaluatedItemCount; + + /// Timestamp for when the evaluation job that created this evaluation ran. + /// + /// Output only. + core.String evaluationJobRunTime; + + /// Metrics comparing predictions to ground truth labels. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1EvaluationMetrics evaluationMetrics; + + /// Resource name of an evaluation. + /// + /// The name has the following format: + /// "projects/{project_id}/datasets/{dataset_id}/evaluations/ {evaluation_id}' + /// + /// Output only. + core.String name; + + GoogleCloudDatalabelingV1beta1Evaluation(); + + GoogleCloudDatalabelingV1beta1Evaluation.fromJson(core.Map _json) { + if (_json.containsKey('annotationType')) { + annotationType = _json['annotationType'] as core.String; + } + if (_json.containsKey('config')) { + config = GoogleCloudDatalabelingV1beta1EvaluationConfig.fromJson( + _json['config'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('evaluatedItemCount')) { + evaluatedItemCount = _json['evaluatedItemCount'] as core.String; + } + if (_json.containsKey('evaluationJobRunTime')) { + evaluationJobRunTime = _json['evaluationJobRunTime'] as core.String; + } + if (_json.containsKey('evaluationMetrics')) { + evaluationMetrics = + GoogleCloudDatalabelingV1beta1EvaluationMetrics.fromJson( + _json['evaluationMetrics'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationType != null) { + _json['annotationType'] = annotationType; + } + if (config != null) { + _json['config'] = config.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (evaluatedItemCount != null) { + _json['evaluatedItemCount'] = evaluatedItemCount; + } + if (evaluationJobRunTime != null) { + _json['evaluationJobRunTime'] = evaluationJobRunTime; + } + if (evaluationMetrics != null) { + _json['evaluationMetrics'] = evaluationMetrics.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Configuration details used for calculating evaluation metrics and creating +/// an Evaluation. +class GoogleCloudDatalabelingV1beta1EvaluationConfig { + /// Only specify this field if the related model performs image object + /// detection (`IMAGE_BOUNDING_BOX_ANNOTATION`). + /// + /// Describes how to evaluate bounding boxes. + GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions + boundingBoxEvaluationOptions; + + GoogleCloudDatalabelingV1beta1EvaluationConfig(); + + GoogleCloudDatalabelingV1beta1EvaluationConfig.fromJson(core.Map _json) { + if (_json.containsKey('boundingBoxEvaluationOptions')) { + boundingBoxEvaluationOptions = + GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions.fromJson( + _json['boundingBoxEvaluationOptions'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boundingBoxEvaluationOptions != null) { + _json['boundingBoxEvaluationOptions'] = + boundingBoxEvaluationOptions.toJson(); + } + return _json; + } +} + +/// Defines an evaluation job that runs periodically to generate Evaluations. +/// +/// \[Creating an evaluation +/// job\](/ml-engine/docs/continuous-evaluation/create-job) is the starting +/// point for using continuous evaluation. +class GoogleCloudDatalabelingV1beta1EvaluationJob { + /// Name of the AnnotationSpecSet describing all the labels that your machine + /// learning model outputs. + /// + /// You must create this resource before you create an evaluation job and + /// provide its name in the following format: + /// "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" + /// + /// Required. + core.String annotationSpecSet; + + /// Every time the evaluation job runs and an error occurs, the failed attempt + /// is appended to this array. + /// + /// Output only. + core.List<GoogleCloudDatalabelingV1beta1Attempt> attempts; + + /// Timestamp of when this evaluation job was created. + /// + /// Output only. + core.String createTime; + + /// Description of the job. + /// + /// The description can be up to 25,000 characters long. + /// + /// Required. + core.String description; + + /// Configuration details for the evaluation job. + /// + /// Required. + GoogleCloudDatalabelingV1beta1EvaluationJobConfig evaluationJobConfig; + + /// Whether you want Data Labeling Service to provide ground truth labels for + /// prediction input. + /// + /// If you want the service to assign human labelers to annotate your data, + /// set this to `true`. If you want to provide your own ground truth labels in + /// the evaluation job's BigQuery table, set this to `false`. + /// + /// Required. + core.bool labelMissingGroundTruth; + + /// The \[AI Platform Prediction model + /// version\](/ml-engine/docs/prediction-overview) to be evaluated. + /// + /// Prediction input and output is sampled from this model version. When + /// creating an evaluation job, specify the model version in the following + /// format: + /// "projects/{project_id}/models/{model_name}/versions/{version_name}" There + /// can only be one evaluation job per model version. + /// + /// Required. + core.String modelVersion; + + /// After you create a job, Data Labeling Service assigns a name to the job + /// with the following format: "projects/{project_id}/evaluationJobs/ + /// {evaluation_job_id}" + /// + /// Output only. + core.String name; + + /// Describes the interval at which the job runs. + /// + /// This interval must be at least 1 day, and it is rounded to the nearest + /// day. For example, if you specify a 50-hour interval, the job runs every 2 + /// days. You can provide the schedule in \[crontab + /// format\](/scheduler/docs/configuring/cron-job-schedules) or in an + /// \[English-like + /// format\](/appengine/docs/standard/python/config/cronref#schedule_format). + /// Regardless of what you specify, the job will run at 10:00 AM UTC. Only the + /// interval from this schedule is used, not the specific time of day. + /// + /// Required. + core.String schedule; + + /// Describes the current state of the job. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" + /// - "SCHEDULED" : The job is scheduled to run at the configured interval. + /// You can pause or delete the job. When the job is in this state, it samples + /// prediction input and output from your model version into your BigQuery + /// table as predictions occur. + /// - "RUNNING" : The job is currently running. When the job runs, Data + /// Labeling Service does several things: 1. If you have configured your job + /// to use Data Labeling Service for ground truth labeling, the service + /// creates a Dataset and a labeling task for all data sampled since the last + /// time the job ran. Human labelers provide ground truth labels for your + /// data. Human labeling may take hours, or even days, depending on how much + /// data has been sampled. The job remains in the `RUNNING` state during this + /// time, and it can even be running multiple times in parallel if it gets + /// triggered again (for example 24 hours later) before the earlier run has + /// completed. When human labelers have finished labeling the data, the next + /// step occurs. If you have configured your job to provide your own ground + /// truth labels, Data Labeling Service still creates a Dataset for newly + /// sampled data, but it expects that you have already added ground truth + /// labels to the BigQuery table by this time. The next step occurs + /// immediately. 2. Data Labeling Service creates an Evaluation by comparing + /// your model version's predictions with the ground truth labels. If the job + /// remains in this state for a long time, it continues to sample prediction + /// data into your BigQuery table and will run again at the next interval, + /// even if it causes the job to run multiple times in parallel. + /// - "PAUSED" : The job is not sampling prediction input and output into your + /// BigQuery table and it will not run according to its schedule. You can + /// resume the job. + /// - "STOPPED" : The job has this state right before it is deleted. + core.String state; + + GoogleCloudDatalabelingV1beta1EvaluationJob(); + + GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('attempts')) { + attempts = (_json['attempts'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Attempt>((value) => + GoogleCloudDatalabelingV1beta1Attempt.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('evaluationJobConfig')) { + evaluationJobConfig = + GoogleCloudDatalabelingV1beta1EvaluationJobConfig.fromJson( + _json['evaluationJobConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('labelMissingGroundTruth')) { + labelMissingGroundTruth = _json['labelMissingGroundTruth'] as core.bool; + } + if (_json.containsKey('modelVersion')) { + modelVersion = _json['modelVersion'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('schedule')) { + schedule = _json['schedule'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (attempts != null) { + _json['attempts'] = attempts.map((value) => value.toJson()).toList(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (evaluationJobConfig != null) { + _json['evaluationJobConfig'] = evaluationJobConfig.toJson(); + } + if (labelMissingGroundTruth != null) { + _json['labelMissingGroundTruth'] = labelMissingGroundTruth; + } + if (modelVersion != null) { + _json['modelVersion'] = modelVersion; + } + if (name != null) { + _json['name'] = name; + } + if (schedule != null) { + _json['schedule'] = schedule; + } + if (state != null) { + _json['state'] = state; + } + return _json; + } +} + +/// Provides details for how an evaluation job sends email alerts based on the +/// results of a run. +class GoogleCloudDatalabelingV1beta1EvaluationJobAlertConfig { + /// An email address to send alerts to. + /// + /// Required. + core.String email; + + /// A number between 0 and 1 that describes a minimum mean average precision + /// threshold. + /// + /// When the evaluation job runs, if it calculates that your model version's + /// predictions from the recent interval have meanAveragePrecision below this + /// threshold, then it sends an alert to your specified email. + /// + /// Required. + core.double minAcceptableMeanAveragePrecision; + + GoogleCloudDatalabelingV1beta1EvaluationJobAlertConfig(); + + GoogleCloudDatalabelingV1beta1EvaluationJobAlertConfig.fromJson( + core.Map _json) { + if (_json.containsKey('email')) { + email = _json['email'] as core.String; + } + if (_json.containsKey('minAcceptableMeanAveragePrecision')) { + minAcceptableMeanAveragePrecision = + (_json['minAcceptableMeanAveragePrecision'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (email != null) { + _json['email'] = email; + } + if (minAcceptableMeanAveragePrecision != null) { + _json['minAcceptableMeanAveragePrecision'] = + minAcceptableMeanAveragePrecision; + } + return _json; + } +} + +/// Configures specific details of how a continuous evaluation job works. +/// +/// Provide this configuration when you create an EvaluationJob. +class GoogleCloudDatalabelingV1beta1EvaluationJobConfig { + /// Prediction keys that tell Data Labeling Service where to find the data for + /// evaluation in your BigQuery table. + /// + /// When the service samples prediction input and output from your model + /// version and saves it to BigQuery, the data gets stored as JSON strings in + /// the BigQuery table. These keys tell Data Labeling Service how to parse the + /// JSON. You can provide the following entries in this field: * + /// `data_json_key`: the data key for prediction input. You must provide + /// either this key or `reference_json_key`. * `reference_json_key`: the data + /// reference key for prediction input. You must provide either this key or + /// `data_json_key`. * `label_json_key`: the label key for prediction output. + /// Required. * `label_score_json_key`: the score key for prediction output. + /// Required. * `bounding_box_json_key`: the bounding box key for prediction + /// output. Required if your model version perform image object detection. + /// Learn \[how to configure prediction + /// keys\](/ml-engine/docs/continuous-evaluation/create-job#prediction-keys). + /// + /// Required. + core.Map<core.String, core.String> bigqueryImportKeys; + + /// Specify this field if your model version performs image object detection + /// (bounding box detection). + /// + /// `annotationSpecSet` in this configuration must match + /// EvaluationJob.annotationSpecSet. + GoogleCloudDatalabelingV1beta1BoundingPolyConfig boundingPolyConfig; + + /// Details for calculating evaluation metrics and creating Evaulations. + /// + /// If your model version performs image object detection, you must specify + /// the `boundingBoxEvaluationOptions` field within this configuration. + /// Otherwise, provide an empty object for this configuration. + /// + /// Required. + GoogleCloudDatalabelingV1beta1EvaluationConfig evaluationConfig; + + /// Configuration details for evaluation job alerts. + /// + /// Specify this field if you want to receive email alerts if the evaluation + /// job finds that your predictions have low mean average precision during a + /// run. + /// + /// Optional. + GoogleCloudDatalabelingV1beta1EvaluationJobAlertConfig + evaluationJobAlertConfig; + + /// The maximum number of predictions to sample and save to BigQuery during + /// each evaluation interval. + /// + /// This limit overrides `example_sample_percentage`: even if the service has + /// not sampled enough predictions to fulfill `example_sample_perecentage` + /// during an interval, it stops sampling predictions when it meets this + /// limit. + /// + /// Required. + core.int exampleCount; + + /// Fraction of predictions to sample and save to BigQuery during each + /// evaluation interval. + /// + /// For example, 0.1 means 10% of predictions served by your model version get + /// saved to BigQuery. + /// + /// Required. + core.double exampleSamplePercentage; + + /// Details for human annotation of your data. + /// + /// If you set labelMissingGroundTruth to `true` for this evaluation job, then + /// you must specify this field. If you plan to provide your own ground truth + /// labels, then omit this field. Note that you must create an Instruction + /// resource before you can specify this field. Provide the name of the + /// instruction resource in the `instruction` field within this configuration. + /// + /// Optional. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig humanAnnotationConfig; + + /// Specify this field if your model version performs image classification or + /// general classification. + /// + /// `annotationSpecSet` in this configuration must match + /// EvaluationJob.annotationSpecSet. `allowMultiLabel` in this configuration + /// must match `classificationMetadata.isMultiLabel` in input_config. + GoogleCloudDatalabelingV1beta1ImageClassificationConfig + imageClassificationConfig; + + /// Rquired. + /// + /// Details for the sampled prediction input. Within this configuration, there + /// are requirements for several fields: * `dataType` must be one of `IMAGE`, + /// `TEXT`, or `GENERAL_DATA`. * `annotationType` must be one of + /// `IMAGE_CLASSIFICATION_ANNOTATION`, `TEXT_CLASSIFICATION_ANNOTATION`, + /// `GENERAL_CLASSIFICATION_ANNOTATION`, or `IMAGE_BOUNDING_BOX_ANNOTATION` + /// (image object detection). * If your machine learning model performs + /// classification, you must specify `classificationMetadata.isMultiLabel`. * + /// You must specify `bigquerySource` (not `gcsSource`). + GoogleCloudDatalabelingV1beta1InputConfig inputConfig; + + /// Specify this field if your model version performs text classification. + /// + /// `annotationSpecSet` in this configuration must match + /// EvaluationJob.annotationSpecSet. `allowMultiLabel` in this configuration + /// must match `classificationMetadata.isMultiLabel` in input_config. + GoogleCloudDatalabelingV1beta1TextClassificationConfig + textClassificationConfig; + + GoogleCloudDatalabelingV1beta1EvaluationJobConfig(); + + GoogleCloudDatalabelingV1beta1EvaluationJobConfig.fromJson(core.Map _json) { + if (_json.containsKey('bigqueryImportKeys')) { + bigqueryImportKeys = (_json['bigqueryImportKeys'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('boundingPolyConfig')) { + boundingPolyConfig = + GoogleCloudDatalabelingV1beta1BoundingPolyConfig.fromJson( + _json['boundingPolyConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('evaluationConfig')) { + evaluationConfig = + GoogleCloudDatalabelingV1beta1EvaluationConfig.fromJson( + _json['evaluationConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('evaluationJobAlertConfig')) { + evaluationJobAlertConfig = + GoogleCloudDatalabelingV1beta1EvaluationJobAlertConfig.fromJson( + _json['evaluationJobAlertConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('exampleCount')) { + exampleCount = _json['exampleCount'] as core.int; + } + if (_json.containsKey('exampleSamplePercentage')) { + exampleSamplePercentage = + (_json['exampleSamplePercentage'] as core.num).toDouble(); + } + if (_json.containsKey('humanAnnotationConfig')) { + humanAnnotationConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['humanAnnotationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationConfig')) { + imageClassificationConfig = + GoogleCloudDatalabelingV1beta1ImageClassificationConfig.fromJson( + _json['imageClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inputConfig')) { + inputConfig = GoogleCloudDatalabelingV1beta1InputConfig.fromJson( + _json['inputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textClassificationConfig')) { + textClassificationConfig = + GoogleCloudDatalabelingV1beta1TextClassificationConfig.fromJson( + _json['textClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bigqueryImportKeys != null) { + _json['bigqueryImportKeys'] = bigqueryImportKeys; + } + if (boundingPolyConfig != null) { + _json['boundingPolyConfig'] = boundingPolyConfig.toJson(); + } + if (evaluationConfig != null) { + _json['evaluationConfig'] = evaluationConfig.toJson(); + } + if (evaluationJobAlertConfig != null) { + _json['evaluationJobAlertConfig'] = evaluationJobAlertConfig.toJson(); + } + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + if (exampleSamplePercentage != null) { + _json['exampleSamplePercentage'] = exampleSamplePercentage; + } + if (humanAnnotationConfig != null) { + _json['humanAnnotationConfig'] = humanAnnotationConfig.toJson(); + } + if (imageClassificationConfig != null) { + _json['imageClassificationConfig'] = imageClassificationConfig.toJson(); + } + if (inputConfig != null) { + _json['inputConfig'] = inputConfig.toJson(); + } + if (textClassificationConfig != null) { + _json['textClassificationConfig'] = textClassificationConfig.toJson(); + } + return _json; + } +} + +class GoogleCloudDatalabelingV1beta1EvaluationMetrics { + GoogleCloudDatalabelingV1beta1ClassificationMetrics classificationMetrics; + GoogleCloudDatalabelingV1beta1ObjectDetectionMetrics objectDetectionMetrics; + + GoogleCloudDatalabelingV1beta1EvaluationMetrics(); + + GoogleCloudDatalabelingV1beta1EvaluationMetrics.fromJson(core.Map _json) { + if (_json.containsKey('classificationMetrics')) { + classificationMetrics = + GoogleCloudDatalabelingV1beta1ClassificationMetrics.fromJson( + _json['classificationMetrics'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('objectDetectionMetrics')) { + objectDetectionMetrics = + GoogleCloudDatalabelingV1beta1ObjectDetectionMetrics.fromJson( + _json['objectDetectionMetrics'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (classificationMetrics != null) { + _json['classificationMetrics'] = classificationMetrics.toJson(); + } + if (objectDetectionMetrics != null) { + _json['objectDetectionMetrics'] = objectDetectionMetrics.toJson(); + } + return _json; + } +} + +/// Config for video event human labeling task. +class GoogleCloudDatalabelingV1beta1EventConfig { + /// The list of annotation spec set resource name. + /// + /// Similar to video classification, we support selecting event from multiple + /// AnnotationSpecSet at the same time. + /// + /// Required. + core.List<core.String> annotationSpecSets; + + /// Videos will be cut to smaller clips to make it easier for labelers to work + /// on. + /// + /// Users can configure is field in seconds, if not set, default value is 60s. + core.int clipLength; + + /// The overlap length between different video clips. + /// + /// Users can configure is field in seconds, if not set, default value is 1s. + core.int overlapLength; + + GoogleCloudDatalabelingV1beta1EventConfig(); + + GoogleCloudDatalabelingV1beta1EventConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSets')) { + annotationSpecSets = (_json['annotationSpecSets'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('clipLength')) { + clipLength = _json['clipLength'] as core.int; + } + if (_json.containsKey('overlapLength')) { + overlapLength = _json['overlapLength'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSets != null) { + _json['annotationSpecSets'] = annotationSpecSets; + } + if (clipLength != null) { + _json['clipLength'] = clipLength; + } + if (overlapLength != null) { + _json['overlapLength'] = overlapLength; + } + return _json; + } +} + +/// An Example is a piece of data and its annotation. +/// +/// For example, an image with label "house". +class GoogleCloudDatalabelingV1beta1Example { + /// Annotations for the piece of data in Example. + /// + /// One piece of data can have multiple annotations. + /// + /// Output only. + core.List<GoogleCloudDatalabelingV1beta1Annotation> annotations; + + /// The image payload, a container of the image bytes/uri. + GoogleCloudDatalabelingV1beta1ImagePayload imagePayload; + + /// Name of the example, in format of: + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id}/examples/{example_id} + /// + /// Output only. + core.String name; + + /// The text payload, a container of the text content. + GoogleCloudDatalabelingV1beta1TextPayload textPayload; + + /// The video payload, a container of the video uri. + GoogleCloudDatalabelingV1beta1VideoPayload videoPayload; + + GoogleCloudDatalabelingV1beta1Example(); + + GoogleCloudDatalabelingV1beta1Example.fromJson(core.Map _json) { + if (_json.containsKey('annotations')) { + annotations = (_json['annotations'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Annotation>((value) => + GoogleCloudDatalabelingV1beta1Annotation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('imagePayload')) { + imagePayload = GoogleCloudDatalabelingV1beta1ImagePayload.fromJson( + _json['imagePayload'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('textPayload')) { + textPayload = GoogleCloudDatalabelingV1beta1TextPayload.fromJson( + _json['textPayload'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoPayload')) { + videoPayload = GoogleCloudDatalabelingV1beta1VideoPayload.fromJson( + _json['videoPayload'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotations != null) { + _json['annotations'] = + annotations.map((value) => value.toJson()).toList(); + } + if (imagePayload != null) { + _json['imagePayload'] = imagePayload.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (textPayload != null) { + _json['textPayload'] = textPayload.toJson(); + } + if (videoPayload != null) { + _json['videoPayload'] = videoPayload.toJson(); + } + return _json; + } +} + +/// Example comparisons comparing ground truth output and predictions for a +/// specific input. +class GoogleCloudDatalabelingV1beta1ExampleComparison { + /// The ground truth output for the input. + GoogleCloudDatalabelingV1beta1Example groundTruthExample; + + /// Predictions by the model for the input. + core.List<GoogleCloudDatalabelingV1beta1Example> modelCreatedExamples; + + GoogleCloudDatalabelingV1beta1ExampleComparison(); + + GoogleCloudDatalabelingV1beta1ExampleComparison.fromJson(core.Map _json) { + if (_json.containsKey('groundTruthExample')) { + groundTruthExample = GoogleCloudDatalabelingV1beta1Example.fromJson( + _json['groundTruthExample'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('modelCreatedExamples')) { + modelCreatedExamples = (_json['modelCreatedExamples'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Example>((value) => + GoogleCloudDatalabelingV1beta1Example.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (groundTruthExample != null) { + _json['groundTruthExample'] = groundTruthExample.toJson(); + } + if (modelCreatedExamples != null) { + _json['modelCreatedExamples'] = + modelCreatedExamples.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Metadata of an ExportData operation. +class GoogleCloudDatalabelingV1beta1ExportDataOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when export dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be exported. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1beta1ExportDataOperationMetadata(); + + GoogleCloudDatalabelingV1beta1ExportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ExportDataset longrunning operation. +class GoogleCloudDatalabelingV1beta1ExportDataOperationResponse { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Ouptut only. + /// + /// The name of dataset. "projects / * /datasets / * " + core.String dataset; + + /// Number of examples exported successfully. + /// + /// Output only. + core.int exportCount; + + /// Statistic infos of labels in the exported dataset. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1LabelStats labelStats; + + /// output_config in the ExportData request. + /// + /// Output only. + GoogleCloudDatalabelingV1beta1OutputConfig outputConfig; + + /// Total number of examples requested to export + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1beta1ExportDataOperationResponse(); + + GoogleCloudDatalabelingV1beta1ExportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('exportCount')) { + exportCount = _json['exportCount'] as core.int; + } + if (_json.containsKey('labelStats')) { + labelStats = GoogleCloudDatalabelingV1beta1LabelStats.fromJson( + _json['labelStats'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputConfig')) { + outputConfig = GoogleCloudDatalabelingV1beta1OutputConfig.fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (exportCount != null) { + _json['exportCount'] = exportCount; + } + if (labelStats != null) { + _json['labelStats'] = labelStats.toJson(); + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Request message for ExportData API. +class GoogleCloudDatalabelingV1beta1ExportDataRequest { + /// Annotated dataset resource name. + /// + /// DataItem in Dataset and their annotations in specified annotated dataset + /// will be exported. It's in format of + /// projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ + /// {annotated_dataset_id} + /// + /// Required. + core.String annotatedDataset; + + /// Filter is not supported at this moment. + /// + /// Optional. + core.String filter; + + /// Specify the output destination. + /// + /// Required. + GoogleCloudDatalabelingV1beta1OutputConfig outputConfig; + + /// Email of the user who started the export task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1beta1ExportDataRequest(); + + GoogleCloudDatalabelingV1beta1ExportDataRequest.fromJson(core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('filter')) { + filter = _json['filter'] as core.String; + } + if (_json.containsKey('outputConfig')) { + outputConfig = GoogleCloudDatalabelingV1beta1OutputConfig.fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (filter != null) { + _json['filter'] = filter; + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// A feedback message inside a feedback thread. +class GoogleCloudDatalabelingV1beta1FeedbackMessage { + /// String content of the feedback. + /// + /// Maximum of 10000 characters. + core.String body; + + /// Create time. + core.String createTime; + + /// The image storing this feedback if the feedback is an image representing + /// operator's comments. + core.String image; + core.List<core.int> get imageAsBytes => convert.base64.decode(image); + + set imageAsBytes(core.List<core.int> _bytes) { + image = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Name of the feedback message in a feedback thread. + /// + /// Format: + /// 'project/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessage/{feedback_message_id}' + core.String name; + GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata + operatorFeedbackMetadata; + GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata + requesterFeedbackMetadata; + + GoogleCloudDatalabelingV1beta1FeedbackMessage(); + + GoogleCloudDatalabelingV1beta1FeedbackMessage.fromJson(core.Map _json) { + if (_json.containsKey('body')) { + body = _json['body'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('image')) { + image = _json['image'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('operatorFeedbackMetadata')) { + operatorFeedbackMetadata = + GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata.fromJson( + _json['operatorFeedbackMetadata'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('requesterFeedbackMetadata')) { + requesterFeedbackMetadata = + GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata.fromJson( + _json['requesterFeedbackMetadata'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (body != null) { + _json['body'] = body; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (image != null) { + _json['image'] = image; + } + if (name != null) { + _json['name'] = name; + } + if (operatorFeedbackMetadata != null) { + _json['operatorFeedbackMetadata'] = operatorFeedbackMetadata.toJson(); + } + if (requesterFeedbackMetadata != null) { + _json['requesterFeedbackMetadata'] = requesterFeedbackMetadata.toJson(); + } + return _json; + } +} + +/// A feedback thread of a certain labeling task on a certain annotated dataset. +class GoogleCloudDatalabelingV1beta1FeedbackThread { + /// Metadata regarding the feedback thread. + GoogleCloudDatalabelingV1beta1FeedbackThreadMetadata feedbackThreadMetadata; + + /// Name of the feedback thread. + /// + /// Format: + /// 'project/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}' + core.String name; + + GoogleCloudDatalabelingV1beta1FeedbackThread(); + + GoogleCloudDatalabelingV1beta1FeedbackThread.fromJson(core.Map _json) { + if (_json.containsKey('feedbackThreadMetadata')) { + feedbackThreadMetadata = + GoogleCloudDatalabelingV1beta1FeedbackThreadMetadata.fromJson( + _json['feedbackThreadMetadata'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (feedbackThreadMetadata != null) { + _json['feedbackThreadMetadata'] = feedbackThreadMetadata.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +class GoogleCloudDatalabelingV1beta1FeedbackThreadMetadata { + /// When the thread is created + core.String createTime; + + /// When the thread is last updated. + core.String lastUpdateTime; + + /// + /// Possible string values are: + /// - "FEEDBACK_THREAD_STATUS_UNSPECIFIED" + /// - "NEW" : Feedback thread is created with no reply; + /// - "REPLIED" : Feedback thread is replied at least once; + core.String status; + + /// An image thumbnail of this thread. + core.String thumbnail; + core.List<core.int> get thumbnailAsBytes => convert.base64.decode(thumbnail); + + set thumbnailAsBytes(core.List<core.int> _bytes) { + thumbnail = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + GoogleCloudDatalabelingV1beta1FeedbackThreadMetadata(); + + GoogleCloudDatalabelingV1beta1FeedbackThreadMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('lastUpdateTime')) { + lastUpdateTime = _json['lastUpdateTime'] as core.String; + } + if (_json.containsKey('status')) { + status = _json['status'] as core.String; + } + if (_json.containsKey('thumbnail')) { + thumbnail = _json['thumbnail'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (lastUpdateTime != null) { + _json['lastUpdateTime'] = lastUpdateTime; + } + if (status != null) { + _json['status'] = status; + } + if (thumbnail != null) { + _json['thumbnail'] = thumbnail; + } + return _json; + } +} + +/// Export destination of the data.Only gcs path is allowed in output_uri. +class GoogleCloudDatalabelingV1beta1GcsDestination { + /// The format of the gcs destination. + /// + /// Only "text/csv" and "application/json" are supported. + /// + /// Required. + core.String mimeType; + + /// The output uri of destination file. + /// + /// Required. + core.String outputUri; + + GoogleCloudDatalabelingV1beta1GcsDestination(); + + GoogleCloudDatalabelingV1beta1GcsDestination.fromJson(core.Map _json) { + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('outputUri')) { + outputUri = _json['outputUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (outputUri != null) { + _json['outputUri'] = outputUri; + } + return _json; + } +} + +/// Export folder destination of the data. +class GoogleCloudDatalabelingV1beta1GcsFolderDestination { + /// Cloud Storage directory to export data to. + /// + /// Required. + core.String outputFolderUri; + + GoogleCloudDatalabelingV1beta1GcsFolderDestination(); + + GoogleCloudDatalabelingV1beta1GcsFolderDestination.fromJson(core.Map _json) { + if (_json.containsKey('outputFolderUri')) { + outputFolderUri = _json['outputFolderUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (outputFolderUri != null) { + _json['outputFolderUri'] = outputFolderUri; + } + return _json; + } +} + +/// Source of the Cloud Storage file to be imported. +class GoogleCloudDatalabelingV1beta1GcsSource { + /// The input URI of source file. + /// + /// This must be a Cloud Storage path (`gs://...`). + /// + /// Required. + core.String inputUri; + + /// The format of the source file. + /// + /// Only "text/csv" is supported. + /// + /// Required. + core.String mimeType; + + GoogleCloudDatalabelingV1beta1GcsSource(); + + GoogleCloudDatalabelingV1beta1GcsSource.fromJson(core.Map _json) { + if (_json.containsKey('inputUri')) { + inputUri = _json['inputUri'] as core.String; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputUri != null) { + _json['inputUri'] = inputUri; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + return _json; + } +} + +/// Configuration for how human labeling task should be done. +class GoogleCloudDatalabelingV1beta1HumanAnnotationConfig { + /// A human-readable description for AnnotatedDataset. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String annotatedDatasetDescription; + + /// A human-readable name for AnnotatedDataset defined by users. + /// + /// Maximum of 64 characters . + /// + /// Required. + core.String annotatedDatasetDisplayName; + + /// If you want your own labeling contributors to manage and work on this + /// labeling request, you can set these contributors here. + /// + /// We will give them access to the question types in crowdcompute. Note that + /// these emails must be registered in crowdcompute worker UI: + /// https://crowd-compute.appspot.com/ + /// + /// Optional. + core.List<core.String> contributorEmails; + + /// Instruction resource name. + /// + /// Required. + core.String instruction; + + /// A human-readable label used to logically group labeling tasks. + /// + /// This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + /// + /// Optional. + core.String labelGroup; + + /// The Language of this question, as a + /// \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + /// Default value is en-US. Only need to set this when task is language + /// related. For example, French text classification. + /// + /// Optional. + core.String languageCode; + + /// Maximum duration for contributors to answer a question. + /// + /// Maximum is 3600 seconds. Default is 3600 seconds. + /// + /// Optional. + core.String questionDuration; + + /// Replication of questions. + /// + /// Each question will be sent to up to this number of contributors to label. + /// Aggregated answers will be returned. Default is set to 1. For image + /// related labeling, valid values are 1, 3, 5. + /// + /// Optional. + core.int replicaCount; + + /// Email of the user who started the labeling task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig(); + + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotatedDatasetDescription')) { + annotatedDatasetDescription = + _json['annotatedDatasetDescription'] as core.String; + } + if (_json.containsKey('annotatedDatasetDisplayName')) { + annotatedDatasetDisplayName = + _json['annotatedDatasetDisplayName'] as core.String; + } + if (_json.containsKey('contributorEmails')) { + contributorEmails = (_json['contributorEmails'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('labelGroup')) { + labelGroup = _json['labelGroup'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('questionDuration')) { + questionDuration = _json['questionDuration'] as core.String; + } + if (_json.containsKey('replicaCount')) { + replicaCount = _json['replicaCount'] as core.int; + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDatasetDescription != null) { + _json['annotatedDatasetDescription'] = annotatedDatasetDescription; + } + if (annotatedDatasetDisplayName != null) { + _json['annotatedDatasetDisplayName'] = annotatedDatasetDisplayName; + } + if (contributorEmails != null) { + _json['contributorEmails'] = contributorEmails; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (labelGroup != null) { + _json['labelGroup'] = labelGroup; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (questionDuration != null) { + _json['questionDuration'] = questionDuration; + } + if (replicaCount != null) { + _json['replicaCount'] = replicaCount; + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// Image bounding poly annotation. +/// +/// It represents a polygon including bounding box in the image. +class GoogleCloudDatalabelingV1beta1ImageBoundingPolyAnnotation { + /// Label of object in this bounding polygon. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + GoogleCloudDatalabelingV1beta1BoundingPoly boundingPoly; + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly normalizedBoundingPoly; + + GoogleCloudDatalabelingV1beta1ImageBoundingPolyAnnotation(); + + GoogleCloudDatalabelingV1beta1ImageBoundingPolyAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('boundingPoly')) { + boundingPoly = GoogleCloudDatalabelingV1beta1BoundingPoly.fromJson( + _json['boundingPoly'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('normalizedBoundingPoly')) { + normalizedBoundingPoly = + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly.fromJson( + _json['normalizedBoundingPoly'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (boundingPoly != null) { + _json['boundingPoly'] = boundingPoly.toJson(); + } + if (normalizedBoundingPoly != null) { + _json['normalizedBoundingPoly'] = normalizedBoundingPoly.toJson(); + } + return _json; + } +} + +/// Image classification annotation definition. +class GoogleCloudDatalabelingV1beta1ImageClassificationAnnotation { + /// Label of image. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + GoogleCloudDatalabelingV1beta1ImageClassificationAnnotation(); + + GoogleCloudDatalabelingV1beta1ImageClassificationAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + return _json; + } +} + +/// Config for image classification human labeling task. +class GoogleCloudDatalabelingV1beta1ImageClassificationConfig { + /// If allow_multi_label is true, contributors are able to choose multiple + /// labels for one image. + /// + /// Optional. + core.bool allowMultiLabel; + + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// The type of how to aggregate answers. + /// + /// Optional. + /// Possible string values are: + /// - "STRING_AGGREGATION_TYPE_UNSPECIFIED" + /// - "MAJORITY_VOTE" : Majority vote to aggregate answers. + /// - "UNANIMOUS_VOTE" : Unanimous answers will be adopted. + /// - "NO_AGGREGATION" : Preserve all answers by crowd compute. + core.String answerAggregationType; + + GoogleCloudDatalabelingV1beta1ImageClassificationConfig(); + + GoogleCloudDatalabelingV1beta1ImageClassificationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('allowMultiLabel')) { + allowMultiLabel = _json['allowMultiLabel'] as core.bool; + } + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('answerAggregationType')) { + answerAggregationType = _json['answerAggregationType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowMultiLabel != null) { + _json['allowMultiLabel'] = allowMultiLabel; + } + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (answerAggregationType != null) { + _json['answerAggregationType'] = answerAggregationType; + } + return _json; + } +} + +/// Container of information about an image. +class GoogleCloudDatalabelingV1beta1ImagePayload { + /// A byte string of a thumbnail image. + core.String imageThumbnail; + core.List<core.int> get imageThumbnailAsBytes => + convert.base64.decode(imageThumbnail); + + set imageThumbnailAsBytes(core.List<core.int> _bytes) { + imageThumbnail = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Image uri from the user bucket. + core.String imageUri; + + /// Image format. + core.String mimeType; + + /// Signed uri of the image file in the service bucket. + core.String signedUri; + + GoogleCloudDatalabelingV1beta1ImagePayload(); + + GoogleCloudDatalabelingV1beta1ImagePayload.fromJson(core.Map _json) { + if (_json.containsKey('imageThumbnail')) { + imageThumbnail = _json['imageThumbnail'] as core.String; + } + if (_json.containsKey('imageUri')) { + imageUri = _json['imageUri'] as core.String; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('signedUri')) { + signedUri = _json['signedUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (imageThumbnail != null) { + _json['imageThumbnail'] = imageThumbnail; + } + if (imageUri != null) { + _json['imageUri'] = imageUri; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (signedUri != null) { + _json['signedUri'] = signedUri; + } + return _json; + } +} + +/// A polyline for the image annotation. +class GoogleCloudDatalabelingV1beta1ImagePolylineAnnotation { + /// Label of this polyline. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + GoogleCloudDatalabelingV1beta1NormalizedPolyline normalizedPolyline; + GoogleCloudDatalabelingV1beta1Polyline polyline; + + GoogleCloudDatalabelingV1beta1ImagePolylineAnnotation(); + + GoogleCloudDatalabelingV1beta1ImagePolylineAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('normalizedPolyline')) { + normalizedPolyline = + GoogleCloudDatalabelingV1beta1NormalizedPolyline.fromJson( + _json['normalizedPolyline'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('polyline')) { + polyline = GoogleCloudDatalabelingV1beta1Polyline.fromJson( + _json['polyline'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (normalizedPolyline != null) { + _json['normalizedPolyline'] = normalizedPolyline.toJson(); + } + if (polyline != null) { + _json['polyline'] = polyline.toJson(); + } + return _json; + } +} + +/// Image segmentation annotation. +class GoogleCloudDatalabelingV1beta1ImageSegmentationAnnotation { + /// The mapping between rgb color and annotation spec. + /// + /// The key is the rgb color represented in format of rgb(0, 0, 0). The value + /// is the AnnotationSpec. + core.Map<core.String, GoogleCloudDatalabelingV1beta1AnnotationSpec> + annotationColors; + + /// A byte string of a full image's color map. + core.String imageBytes; + core.List<core.int> get imageBytesAsBytes => + convert.base64.decode(imageBytes); + + set imageBytesAsBytes(core.List<core.int> _bytes) { + imageBytes = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Image format. + core.String mimeType; + + GoogleCloudDatalabelingV1beta1ImageSegmentationAnnotation(); + + GoogleCloudDatalabelingV1beta1ImageSegmentationAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationColors')) { + annotationColors = (_json['annotationColors'] as core.Map) + .cast<core.String, core.Map>() + .map( + (key, item) => core.MapEntry( + key, + GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + item as core.Map<core.String, core.dynamic>), + ), + ); + } + if (_json.containsKey('imageBytes')) { + imageBytes = _json['imageBytes'] as core.String; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationColors != null) { + _json['annotationColors'] = annotationColors + .map((key, item) => core.MapEntry(key, item.toJson())); + } + if (imageBytes != null) { + _json['imageBytes'] = imageBytes; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + return _json; + } +} + +/// Metadata of an ImportData operation. +class GoogleCloudDatalabelingV1beta1ImportDataOperationMetadata { + /// Timestamp when import dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of imported dataset. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1beta1ImportDataOperationMetadata(); + + GoogleCloudDatalabelingV1beta1ImportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ImportData longrunning operation. +class GoogleCloudDatalabelingV1beta1ImportDataOperationResponse { + /// Ouptut only. + /// + /// The name of imported dataset. + core.String dataset; + + /// Number of examples imported successfully. + /// + /// Output only. + core.int importCount; + + /// Total number of examples requested to import + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1beta1ImportDataOperationResponse(); + + GoogleCloudDatalabelingV1beta1ImportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('importCount')) { + importCount = _json['importCount'] as core.int; + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataset != null) { + _json['dataset'] = dataset; + } + if (importCount != null) { + _json['importCount'] = importCount; + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Request message for ImportData API. +class GoogleCloudDatalabelingV1beta1ImportDataRequest { + /// Specify the input source of the data. + /// + /// Required. + GoogleCloudDatalabelingV1beta1InputConfig inputConfig; + + /// Email of the user who started the import task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1beta1ImportDataRequest(); + + GoogleCloudDatalabelingV1beta1ImportDataRequest.fromJson(core.Map _json) { + if (_json.containsKey('inputConfig')) { + inputConfig = GoogleCloudDatalabelingV1beta1InputConfig.fromJson( + _json['inputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputConfig != null) { + _json['inputConfig'] = inputConfig.toJson(); + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// The configuration of input data, including data type, location, etc. +class GoogleCloudDatalabelingV1beta1InputConfig { + /// The type of annotation to be performed on this data. + /// + /// You must specify this field if you are using this InputConfig in an + /// EvaluationJob. + /// + /// Optional. + /// Possible string values are: + /// - "ANNOTATION_TYPE_UNSPECIFIED" + /// - "IMAGE_CLASSIFICATION_ANNOTATION" : Classification annotations in an + /// image. Allowed for continuous evaluation. + /// - "IMAGE_BOUNDING_BOX_ANNOTATION" : Bounding box annotations in an image. + /// A form of image object detection. Allowed for continuous evaluation. + /// - "IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION" : Oriented bounding box. The + /// box does not have to be parallel to horizontal line. + /// - "IMAGE_BOUNDING_POLY_ANNOTATION" : Bounding poly annotations in an + /// image. + /// - "IMAGE_POLYLINE_ANNOTATION" : Polyline annotations in an image. + /// - "IMAGE_SEGMENTATION_ANNOTATION" : Segmentation annotations in an image. + /// - "VIDEO_SHOTS_CLASSIFICATION_ANNOTATION" : Classification annotations in + /// video shots. + /// - "VIDEO_OBJECT_TRACKING_ANNOTATION" : Video object tracking annotation. + /// - "VIDEO_OBJECT_DETECTION_ANNOTATION" : Video object detection annotation. + /// - "VIDEO_EVENT_ANNOTATION" : Video event annotation. + /// - "TEXT_CLASSIFICATION_ANNOTATION" : Classification for text. Allowed for + /// continuous evaluation. + /// - "TEXT_ENTITY_EXTRACTION_ANNOTATION" : Entity extraction for text. + /// - "GENERAL_CLASSIFICATION_ANNOTATION" : General classification. Allowed + /// for continuous evaluation. + core.String annotationType; + + /// Source located in BigQuery. + /// + /// You must specify this field if you are using this InputConfig in an + /// EvaluationJob. + GoogleCloudDatalabelingV1beta1BigQuerySource bigquerySource; + + /// Metadata about annotations for the input. + /// + /// You must specify this field if you are using this InputConfig in an + /// EvaluationJob for a model version that performs classification. + /// + /// Optional. + GoogleCloudDatalabelingV1beta1ClassificationMetadata classificationMetadata; + + /// Data type must be specifed when user tries to import data. + /// + /// Required. + /// Possible string values are: + /// - "DATA_TYPE_UNSPECIFIED" : Data type is unspecified. + /// - "IMAGE" : Allowed for continuous evaluation. + /// - "VIDEO" : Video data type. + /// - "TEXT" : Allowed for continuous evaluation. + /// - "GENERAL_DATA" : Allowed for continuous evaluation. + core.String dataType; + + /// Source located in Cloud Storage. + GoogleCloudDatalabelingV1beta1GcsSource gcsSource; + + /// Required for text import, as language code must be specified. + GoogleCloudDatalabelingV1beta1TextMetadata textMetadata; + + GoogleCloudDatalabelingV1beta1InputConfig(); + + GoogleCloudDatalabelingV1beta1InputConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationType')) { + annotationType = _json['annotationType'] as core.String; + } + if (_json.containsKey('bigquerySource')) { + bigquerySource = GoogleCloudDatalabelingV1beta1BigQuerySource.fromJson( + _json['bigquerySource'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('classificationMetadata')) { + classificationMetadata = + GoogleCloudDatalabelingV1beta1ClassificationMetadata.fromJson( + _json['classificationMetadata'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dataType')) { + dataType = _json['dataType'] as core.String; + } + if (_json.containsKey('gcsSource')) { + gcsSource = GoogleCloudDatalabelingV1beta1GcsSource.fromJson( + _json['gcsSource'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textMetadata')) { + textMetadata = GoogleCloudDatalabelingV1beta1TextMetadata.fromJson( + _json['textMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationType != null) { + _json['annotationType'] = annotationType; + } + if (bigquerySource != null) { + _json['bigquerySource'] = bigquerySource.toJson(); + } + if (classificationMetadata != null) { + _json['classificationMetadata'] = classificationMetadata.toJson(); + } + if (dataType != null) { + _json['dataType'] = dataType; + } + if (gcsSource != null) { + _json['gcsSource'] = gcsSource.toJson(); + } + if (textMetadata != null) { + _json['textMetadata'] = textMetadata.toJson(); + } + return _json; + } +} + +/// Instruction of how to perform the labeling task for human operators. +/// +/// Currently only PDF instruction is supported. +class GoogleCloudDatalabelingV1beta1Instruction { + /// The names of any related resources that are blocking changes to the + /// instruction. + /// + /// Output only. + core.List<core.String> blockingResources; + + /// Creation time of instruction. + /// + /// Output only. + core.String createTime; + + /// Deprecated: this instruction format is not supported any more. + /// + /// Instruction from a CSV file, such as for classification task. The CSV file + /// should have exact two columns, in the following format: * The first column + /// is labeled data, such as an image reference, text. * The second column is + /// comma separated labels associated with data. + GoogleCloudDatalabelingV1beta1CsvInstruction csvInstruction; + + /// The data type of this instruction. + /// + /// Required. + /// Possible string values are: + /// - "DATA_TYPE_UNSPECIFIED" : Data type is unspecified. + /// - "IMAGE" : Allowed for continuous evaluation. + /// - "VIDEO" : Video data type. + /// - "TEXT" : Allowed for continuous evaluation. + /// - "GENERAL_DATA" : Allowed for continuous evaluation. + core.String dataType; + + /// User-provided description of the instruction. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String description; + + /// The display name of the instruction. + /// + /// Maximum of 64 characters. + /// + /// Required. + core.String displayName; + + /// Instruction resource name, format: + /// projects/{project_id}/instructions/{instruction_id} + /// + /// Output only. + core.String name; + + /// Instruction from a PDF document. + /// + /// The PDF should be in a Cloud Storage bucket. + GoogleCloudDatalabelingV1beta1PdfInstruction pdfInstruction; + + /// Last update time of instruction. + /// + /// Output only. + core.String updateTime; + + GoogleCloudDatalabelingV1beta1Instruction(); + + GoogleCloudDatalabelingV1beta1Instruction.fromJson(core.Map _json) { + if (_json.containsKey('blockingResources')) { + blockingResources = (_json['blockingResources'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('csvInstruction')) { + csvInstruction = GoogleCloudDatalabelingV1beta1CsvInstruction.fromJson( + _json['csvInstruction'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dataType')) { + dataType = _json['dataType'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('pdfInstruction')) { + pdfInstruction = GoogleCloudDatalabelingV1beta1PdfInstruction.fromJson( + _json['pdfInstruction'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (blockingResources != null) { + _json['blockingResources'] = blockingResources; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (csvInstruction != null) { + _json['csvInstruction'] = csvInstruction.toJson(); + } + if (dataType != null) { + _json['dataType'] = dataType; + } + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (pdfInstruction != null) { + _json['pdfInstruction'] = pdfInstruction.toJson(); + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Details of a LabelImageBoundingBox operation metadata. +class GoogleCloudDatalabelingV1beta1LabelImageBoundingBoxOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImageBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImageBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImageBoundingPoly operation metadata. +class GoogleCloudDatalabelingV1beta1LabelImageBoundingPolyOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImageBoundingPolyOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImageBoundingPolyOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a LabelImageClassification operation. +class GoogleCloudDatalabelingV1beta1LabelImageClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImageClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImageClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageOrientedBoundingBox operation metadata. +class GoogleCloudDatalabelingV1beta1LabelImageOrientedBoundingBoxOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImageOrientedBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImageOrientedBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImagePolyline operation metadata. +class GoogleCloudDatalabelingV1beta1LabelImagePolylineOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImagePolylineOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImagePolylineOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Request message for starting an image labeling task. +class GoogleCloudDatalabelingV1beta1LabelImageRequest { + /// Basic human annotation config. + /// + /// Required. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + /// Configuration for bounding box and bounding poly task. + /// + /// One of image_classification_config, bounding_poly_config, polyline_config + /// and segmentation_config are required. + GoogleCloudDatalabelingV1beta1BoundingPolyConfig boundingPolyConfig; + + /// The type of image labeling task. + /// + /// Required. + /// Possible string values are: + /// - "FEATURE_UNSPECIFIED" + /// - "CLASSIFICATION" : Label whole image with one or more of labels. + /// - "BOUNDING_BOX" : Label image with bounding boxes for labels. + /// - "ORIENTED_BOUNDING_BOX" : Label oriented bounding box. The box does not + /// have to be parallel to horizontal line. + /// - "BOUNDING_POLY" : Label images with bounding poly. A bounding poly is a + /// plane figure that is bounded by a finite chain of straight line segments + /// closing in a loop. + /// - "POLYLINE" : Label images with polyline. Polyline is formed by connected + /// line segments which are not in closed form. + /// - "SEGMENTATION" : Label images with segmentation. Segmentation is + /// different from bounding poly since it is more fine-grained, pixel level + /// annotation. + core.String feature; + + /// Configuration for image classification task. + /// + /// One of image_classification_config, bounding_poly_config, polyline_config + /// and segmentation_config are required. + GoogleCloudDatalabelingV1beta1ImageClassificationConfig + imageClassificationConfig; + + /// Configuration for polyline task. + /// + /// One of image_classification_config, bounding_poly_config, polyline_config + /// and segmentation_config are required. + GoogleCloudDatalabelingV1beta1PolylineConfig polylineConfig; + + /// Configuration for segmentation task. + /// + /// One of image_classification_config, bounding_poly_config, polyline_config + /// and segmentation_config are required. + GoogleCloudDatalabelingV1beta1SegmentationConfig segmentationConfig; + + GoogleCloudDatalabelingV1beta1LabelImageRequest(); + + GoogleCloudDatalabelingV1beta1LabelImageRequest.fromJson(core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('boundingPolyConfig')) { + boundingPolyConfig = + GoogleCloudDatalabelingV1beta1BoundingPolyConfig.fromJson( + _json['boundingPolyConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('feature')) { + feature = _json['feature'] as core.String; + } + if (_json.containsKey('imageClassificationConfig')) { + imageClassificationConfig = + GoogleCloudDatalabelingV1beta1ImageClassificationConfig.fromJson( + _json['imageClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('polylineConfig')) { + polylineConfig = GoogleCloudDatalabelingV1beta1PolylineConfig.fromJson( + _json['polylineConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('segmentationConfig')) { + segmentationConfig = + GoogleCloudDatalabelingV1beta1SegmentationConfig.fromJson( + _json['segmentationConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + if (boundingPolyConfig != null) { + _json['boundingPolyConfig'] = boundingPolyConfig.toJson(); + } + if (feature != null) { + _json['feature'] = feature; + } + if (imageClassificationConfig != null) { + _json['imageClassificationConfig'] = imageClassificationConfig.toJson(); + } + if (polylineConfig != null) { + _json['polylineConfig'] = polylineConfig.toJson(); + } + if (segmentationConfig != null) { + _json['segmentationConfig'] = segmentationConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageSegmentation operation metadata. +class GoogleCloudDatalabelingV1beta1LabelImageSegmentationOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelImageSegmentationOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelImageSegmentationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a labeling operation, such as LabelImage or LabelVideo. +/// +/// Next tag: 23 +class GoogleCloudDatalabelingV1beta1LabelOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when labeling request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be labeled. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Details of label image bounding box operation. + GoogleCloudDatalabelingV1beta1LabelImageBoundingBoxOperationMetadata + imageBoundingBoxDetails; + + /// Details of label image bounding poly operation. + GoogleCloudDatalabelingV1beta1LabelImageBoundingPolyOperationMetadata + imageBoundingPolyDetails; + + /// Details of label image classification operation. + GoogleCloudDatalabelingV1beta1LabelImageClassificationOperationMetadata + imageClassificationDetails; + + /// Details of label image oriented bounding box operation. + GoogleCloudDatalabelingV1beta1LabelImageOrientedBoundingBoxOperationMetadata + imageOrientedBoundingBoxDetails; + + /// Details of label image polyline operation. + GoogleCloudDatalabelingV1beta1LabelImagePolylineOperationMetadata + imagePolylineDetails; + + /// Details of label image segmentation operation. + GoogleCloudDatalabelingV1beta1LabelImageSegmentationOperationMetadata + imageSegmentationDetails; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + /// Progress of label operation. + /// + /// Range: \[0, 100\]. + /// + /// Output only. + core.int progressPercent; + + /// Details of label text classification operation. + GoogleCloudDatalabelingV1beta1LabelTextClassificationOperationMetadata + textClassificationDetails; + + /// Details of label text entity extraction operation. + GoogleCloudDatalabelingV1beta1LabelTextEntityExtractionOperationMetadata + textEntityExtractionDetails; + + /// Details of label video classification operation. + GoogleCloudDatalabelingV1beta1LabelVideoClassificationOperationMetadata + videoClassificationDetails; + + /// Details of label video event operation. + GoogleCloudDatalabelingV1beta1LabelVideoEventOperationMetadata + videoEventDetails; + + /// Details of label video object detection operation. + GoogleCloudDatalabelingV1beta1LabelVideoObjectDetectionOperationMetadata + videoObjectDetectionDetails; + + /// Details of label video object tracking operation. + GoogleCloudDatalabelingV1beta1LabelVideoObjectTrackingOperationMetadata + videoObjectTrackingDetails; + + GoogleCloudDatalabelingV1beta1LabelOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('imageBoundingBoxDetails')) { + imageBoundingBoxDetails = + GoogleCloudDatalabelingV1beta1LabelImageBoundingBoxOperationMetadata + .fromJson(_json['imageBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageBoundingPolyDetails')) { + imageBoundingPolyDetails = + GoogleCloudDatalabelingV1beta1LabelImageBoundingPolyOperationMetadata + .fromJson(_json['imageBoundingPolyDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationDetails')) { + imageClassificationDetails = + GoogleCloudDatalabelingV1beta1LabelImageClassificationOperationMetadata + .fromJson(_json['imageClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageOrientedBoundingBoxDetails')) { + imageOrientedBoundingBoxDetails = + GoogleCloudDatalabelingV1beta1LabelImageOrientedBoundingBoxOperationMetadata + .fromJson(_json['imageOrientedBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imagePolylineDetails')) { + imagePolylineDetails = + GoogleCloudDatalabelingV1beta1LabelImagePolylineOperationMetadata + .fromJson(_json['imagePolylineDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageSegmentationDetails')) { + imageSegmentationDetails = + GoogleCloudDatalabelingV1beta1LabelImageSegmentationOperationMetadata + .fromJson(_json['imageSegmentationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('progressPercent')) { + progressPercent = _json['progressPercent'] as core.int; + } + if (_json.containsKey('textClassificationDetails')) { + textClassificationDetails = + GoogleCloudDatalabelingV1beta1LabelTextClassificationOperationMetadata + .fromJson(_json['textClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionDetails')) { + textEntityExtractionDetails = + GoogleCloudDatalabelingV1beta1LabelTextEntityExtractionOperationMetadata + .fromJson(_json['textEntityExtractionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationDetails')) { + videoClassificationDetails = + GoogleCloudDatalabelingV1beta1LabelVideoClassificationOperationMetadata + .fromJson(_json['videoClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoEventDetails')) { + videoEventDetails = + GoogleCloudDatalabelingV1beta1LabelVideoEventOperationMetadata + .fromJson(_json['videoEventDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectDetectionDetails')) { + videoObjectDetectionDetails = + GoogleCloudDatalabelingV1beta1LabelVideoObjectDetectionOperationMetadata + .fromJson(_json['videoObjectDetectionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectTrackingDetails')) { + videoObjectTrackingDetails = + GoogleCloudDatalabelingV1beta1LabelVideoObjectTrackingOperationMetadata + .fromJson(_json['videoObjectTrackingDetails'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (imageBoundingBoxDetails != null) { + _json['imageBoundingBoxDetails'] = imageBoundingBoxDetails.toJson(); + } + if (imageBoundingPolyDetails != null) { + _json['imageBoundingPolyDetails'] = imageBoundingPolyDetails.toJson(); + } + if (imageClassificationDetails != null) { + _json['imageClassificationDetails'] = imageClassificationDetails.toJson(); + } + if (imageOrientedBoundingBoxDetails != null) { + _json['imageOrientedBoundingBoxDetails'] = + imageOrientedBoundingBoxDetails.toJson(); + } + if (imagePolylineDetails != null) { + _json['imagePolylineDetails'] = imagePolylineDetails.toJson(); + } + if (imageSegmentationDetails != null) { + _json['imageSegmentationDetails'] = imageSegmentationDetails.toJson(); + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + if (progressPercent != null) { + _json['progressPercent'] = progressPercent; + } + if (textClassificationDetails != null) { + _json['textClassificationDetails'] = textClassificationDetails.toJson(); + } + if (textEntityExtractionDetails != null) { + _json['textEntityExtractionDetails'] = + textEntityExtractionDetails.toJson(); + } + if (videoClassificationDetails != null) { + _json['videoClassificationDetails'] = videoClassificationDetails.toJson(); + } + if (videoEventDetails != null) { + _json['videoEventDetails'] = videoEventDetails.toJson(); + } + if (videoObjectDetectionDetails != null) { + _json['videoObjectDetectionDetails'] = + videoObjectDetectionDetails.toJson(); + } + if (videoObjectTrackingDetails != null) { + _json['videoObjectTrackingDetails'] = videoObjectTrackingDetails.toJson(); + } + return _json; + } +} + +/// Statistics about annotation specs. +class GoogleCloudDatalabelingV1beta1LabelStats { + /// Map of each annotation spec's example count. + /// + /// Key is the annotation spec name and value is the number of examples for + /// that annotation spec. If the annotated dataset does not have annotation + /// spec, the map will return a pair where the key is empty string and value + /// is the total number of annotations. + core.Map<core.String, core.String> exampleCount; + + GoogleCloudDatalabelingV1beta1LabelStats(); + + GoogleCloudDatalabelingV1beta1LabelStats.fromJson(core.Map _json) { + if (_json.containsKey('exampleCount')) { + exampleCount = (_json['exampleCount'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + return _json; + } +} + +/// Details of a LabelTextClassification operation metadata. +class GoogleCloudDatalabelingV1beta1LabelTextClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelTextClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelTextClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelTextEntityExtraction operation metadata. +class GoogleCloudDatalabelingV1beta1LabelTextEntityExtractionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelTextEntityExtractionOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelTextEntityExtractionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Request message for LabelText. +class GoogleCloudDatalabelingV1beta1LabelTextRequest { + /// Basic human annotation config. + /// + /// Required. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + /// The type of text labeling task. + /// + /// Required. + /// Possible string values are: + /// - "FEATURE_UNSPECIFIED" + /// - "TEXT_CLASSIFICATION" : Label text content to one of more labels. + /// - "TEXT_ENTITY_EXTRACTION" : Label entities and their span in text. + core.String feature; + + /// Configuration for text classification task. + /// + /// One of text_classification_config and text_entity_extraction_config is + /// required. + GoogleCloudDatalabelingV1beta1TextClassificationConfig + textClassificationConfig; + + /// Configuration for entity extraction task. + /// + /// One of text_classification_config and text_entity_extraction_config is + /// required. + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig + textEntityExtractionConfig; + + GoogleCloudDatalabelingV1beta1LabelTextRequest(); + + GoogleCloudDatalabelingV1beta1LabelTextRequest.fromJson(core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('feature')) { + feature = _json['feature'] as core.String; + } + if (_json.containsKey('textClassificationConfig')) { + textClassificationConfig = + GoogleCloudDatalabelingV1beta1TextClassificationConfig.fromJson( + _json['textClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionConfig')) { + textEntityExtractionConfig = + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig.fromJson( + _json['textEntityExtractionConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + if (feature != null) { + _json['feature'] = feature; + } + if (textClassificationConfig != null) { + _json['textClassificationConfig'] = textClassificationConfig.toJson(); + } + if (textEntityExtractionConfig != null) { + _json['textEntityExtractionConfig'] = textEntityExtractionConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoClassification operation metadata. +class GoogleCloudDatalabelingV1beta1LabelVideoClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelVideoClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelVideoClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoEvent operation metadata. +class GoogleCloudDatalabelingV1beta1LabelVideoEventOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelVideoEventOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelVideoEventOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectDetection operation metadata. +class GoogleCloudDatalabelingV1beta1LabelVideoObjectDetectionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelVideoObjectDetectionOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelVideoObjectDetectionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectTracking operation metadata. +class GoogleCloudDatalabelingV1beta1LabelVideoObjectTrackingOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1beta1LabelVideoObjectTrackingOperationMetadata(); + + GoogleCloudDatalabelingV1beta1LabelVideoObjectTrackingOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Request message for LabelVideo. +class GoogleCloudDatalabelingV1beta1LabelVideoRequest { + /// Basic human annotation config. + /// + /// Required. + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig basicConfig; + + /// Configuration for video event task. + /// + /// One of video_classification_config, object_detection_config, + /// object_tracking_config and event_config is required. + GoogleCloudDatalabelingV1beta1EventConfig eventConfig; + + /// The type of video labeling task. + /// + /// Required. + /// Possible string values are: + /// - "FEATURE_UNSPECIFIED" + /// - "CLASSIFICATION" : Label whole video or video segment with one or more + /// labels. + /// - "OBJECT_DETECTION" : Label objects with bounding box on image frames + /// extracted from the video. + /// - "OBJECT_TRACKING" : Label and track objects in video. + /// - "EVENT" : Label the range of video for the specified events. + core.String feature; + + /// Configuration for video object detection task. + /// + /// One of video_classification_config, object_detection_config, + /// object_tracking_config and event_config is required. + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig objectDetectionConfig; + + /// Configuration for video object tracking task. + /// + /// One of video_classification_config, object_detection_config, + /// object_tracking_config and event_config is required. + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig objectTrackingConfig; + + /// Configuration for video classification task. + /// + /// One of video_classification_config, object_detection_config, + /// object_tracking_config and event_config is required. + GoogleCloudDatalabelingV1beta1VideoClassificationConfig + videoClassificationConfig; + + GoogleCloudDatalabelingV1beta1LabelVideoRequest(); + + GoogleCloudDatalabelingV1beta1LabelVideoRequest.fromJson(core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1beta1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('eventConfig')) { + eventConfig = GoogleCloudDatalabelingV1beta1EventConfig.fromJson( + _json['eventConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('feature')) { + feature = _json['feature'] as core.String; + } + if (_json.containsKey('objectDetectionConfig')) { + objectDetectionConfig = + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig.fromJson( + _json['objectDetectionConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('objectTrackingConfig')) { + objectTrackingConfig = + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig.fromJson( + _json['objectTrackingConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationConfig')) { + videoClassificationConfig = + GoogleCloudDatalabelingV1beta1VideoClassificationConfig.fromJson( + _json['videoClassificationConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + if (eventConfig != null) { + _json['eventConfig'] = eventConfig.toJson(); + } + if (feature != null) { + _json['feature'] = feature; + } + if (objectDetectionConfig != null) { + _json['objectDetectionConfig'] = objectDetectionConfig.toJson(); + } + if (objectTrackingConfig != null) { + _json['objectTrackingConfig'] = objectTrackingConfig.toJson(); + } + if (videoClassificationConfig != null) { + _json['videoClassificationConfig'] = videoClassificationConfig.toJson(); + } + return _json; + } +} + +/// Results of listing annotated datasets for a dataset. +class GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse { + /// The list of annotated datasets to return. + core.List<GoogleCloudDatalabelingV1beta1AnnotatedDataset> annotatedDatasets; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse(); + + GoogleCloudDatalabelingV1beta1ListAnnotatedDatasetsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDatasets')) { + annotatedDatasets = (_json['annotatedDatasets'] as core.List) + .map<GoogleCloudDatalabelingV1beta1AnnotatedDataset>((value) => + GoogleCloudDatalabelingV1beta1AnnotatedDataset.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDatasets != null) { + _json['annotatedDatasets'] = + annotatedDatasets.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results of listing annotation spec set under a project. +class GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse { + /// The list of annotation spec sets. + core.List<GoogleCloudDatalabelingV1beta1AnnotationSpecSet> annotationSpecSets; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse(); + + GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpecSets')) { + annotationSpecSets = (_json['annotationSpecSets'] as core.List) + .map<GoogleCloudDatalabelingV1beta1AnnotationSpecSet>((value) => + GoogleCloudDatalabelingV1beta1AnnotationSpecSet.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSets != null) { + _json['annotationSpecSets'] = + annotationSpecSets.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results of listing data items in a dataset. +class GoogleCloudDatalabelingV1beta1ListDataItemsResponse { + /// The list of data items to return. + core.List<GoogleCloudDatalabelingV1beta1DataItem> dataItems; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListDataItemsResponse(); + + GoogleCloudDatalabelingV1beta1ListDataItemsResponse.fromJson(core.Map _json) { + if (_json.containsKey('dataItems')) { + dataItems = (_json['dataItems'] as core.List) + .map<GoogleCloudDatalabelingV1beta1DataItem>((value) => + GoogleCloudDatalabelingV1beta1DataItem.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataItems != null) { + _json['dataItems'] = dataItems.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results of listing datasets within a project. +class GoogleCloudDatalabelingV1beta1ListDatasetsResponse { + /// The list of datasets to return. + core.List<GoogleCloudDatalabelingV1beta1Dataset> datasets; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListDatasetsResponse(); + + GoogleCloudDatalabelingV1beta1ListDatasetsResponse.fromJson(core.Map _json) { + if (_json.containsKey('datasets')) { + datasets = (_json['datasets'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Dataset>((value) => + GoogleCloudDatalabelingV1beta1Dataset.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (datasets != null) { + _json['datasets'] = datasets.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results for listing evaluation jobs. +class GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse { + /// The list of evaluation jobs to return. + core.List<GoogleCloudDatalabelingV1beta1EvaluationJob> evaluationJobs; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse(); + + GoogleCloudDatalabelingV1beta1ListEvaluationJobsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('evaluationJobs')) { + evaluationJobs = (_json['evaluationJobs'] as core.List) + .map<GoogleCloudDatalabelingV1beta1EvaluationJob>((value) => + GoogleCloudDatalabelingV1beta1EvaluationJob.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (evaluationJobs != null) { + _json['evaluationJobs'] = + evaluationJobs.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results of listing Examples in and annotated dataset. +class GoogleCloudDatalabelingV1beta1ListExamplesResponse { + /// The list of examples to return. + core.List<GoogleCloudDatalabelingV1beta1Example> examples; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListExamplesResponse(); + + GoogleCloudDatalabelingV1beta1ListExamplesResponse.fromJson(core.Map _json) { + if (_json.containsKey('examples')) { + examples = (_json['examples'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Example>((value) => + GoogleCloudDatalabelingV1beta1Example.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (examples != null) { + _json['examples'] = examples.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results for listing FeedbackMessages. +class GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse { + /// The list of feedback messages to return. + core.List<GoogleCloudDatalabelingV1beta1FeedbackMessage> feedbackMessages; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse(); + + GoogleCloudDatalabelingV1beta1ListFeedbackMessagesResponse.fromJson( + core.Map _json) { + if (_json.containsKey('feedbackMessages')) { + feedbackMessages = (_json['feedbackMessages'] as core.List) + .map<GoogleCloudDatalabelingV1beta1FeedbackMessage>((value) => + GoogleCloudDatalabelingV1beta1FeedbackMessage.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (feedbackMessages != null) { + _json['feedbackMessages'] = + feedbackMessages.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results for listing FeedbackThreads. +class GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse { + /// The list of feedback threads to return. + core.List<GoogleCloudDatalabelingV1beta1FeedbackThread> feedbackThreads; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse(); + + GoogleCloudDatalabelingV1beta1ListFeedbackThreadsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('feedbackThreads')) { + feedbackThreads = (_json['feedbackThreads'] as core.List) + .map<GoogleCloudDatalabelingV1beta1FeedbackThread>((value) => + GoogleCloudDatalabelingV1beta1FeedbackThread.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (feedbackThreads != null) { + _json['feedbackThreads'] = + feedbackThreads.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Results of listing instructions under a project. +class GoogleCloudDatalabelingV1beta1ListInstructionsResponse { + /// The list of Instructions to return. + core.List<GoogleCloudDatalabelingV1beta1Instruction> instructions; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1ListInstructionsResponse(); + + GoogleCloudDatalabelingV1beta1ListInstructionsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('instructions')) { + instructions = (_json['instructions'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Instruction>((value) => + GoogleCloudDatalabelingV1beta1Instruction.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (instructions != null) { + _json['instructions'] = + instructions.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Normalized bounding polygon. +class GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly { + /// The bounding polygon normalized vertices. + core.List<GoogleCloudDatalabelingV1beta1NormalizedVertex> normalizedVertices; + + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly(); + + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly.fromJson( + core.Map _json) { + if (_json.containsKey('normalizedVertices')) { + normalizedVertices = (_json['normalizedVertices'] as core.List) + .map<GoogleCloudDatalabelingV1beta1NormalizedVertex>((value) => + GoogleCloudDatalabelingV1beta1NormalizedVertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (normalizedVertices != null) { + _json['normalizedVertices'] = + normalizedVertices.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Normalized polyline. +class GoogleCloudDatalabelingV1beta1NormalizedPolyline { + /// The normalized polyline vertices. + core.List<GoogleCloudDatalabelingV1beta1NormalizedVertex> normalizedVertices; + + GoogleCloudDatalabelingV1beta1NormalizedPolyline(); + + GoogleCloudDatalabelingV1beta1NormalizedPolyline.fromJson(core.Map _json) { + if (_json.containsKey('normalizedVertices')) { + normalizedVertices = (_json['normalizedVertices'] as core.List) + .map<GoogleCloudDatalabelingV1beta1NormalizedVertex>((value) => + GoogleCloudDatalabelingV1beta1NormalizedVertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (normalizedVertices != null) { + _json['normalizedVertices'] = + normalizedVertices.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A vertex represents a 2D point in the image. +/// +/// NOTE: the normalized vertex coordinates are relative to the original image +/// and range from 0 to 1. +class GoogleCloudDatalabelingV1beta1NormalizedVertex { + /// X coordinate. + core.double x; + + /// Y coordinate. + core.double y; + + GoogleCloudDatalabelingV1beta1NormalizedVertex(); + + GoogleCloudDatalabelingV1beta1NormalizedVertex.fromJson(core.Map _json) { + if (_json.containsKey('x')) { + x = (_json['x'] as core.num).toDouble(); + } + if (_json.containsKey('y')) { + y = (_json['y'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (x != null) { + _json['x'] = x; + } + if (y != null) { + _json['y'] = y; + } + return _json; + } +} + +/// Config for video object detection human labeling task. +/// +/// Object detection will be conducted on the images extracted from the video, +/// and those objects will be labeled with bounding boxes. User need to specify +/// the number of images to be extracted per second as the extraction frame +/// rate. +class GoogleCloudDatalabelingV1beta1ObjectDetectionConfig { + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// Number of frames per second to be extracted from the video. + /// + /// Required. + core.double extractionFrameRate; + + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig(); + + GoogleCloudDatalabelingV1beta1ObjectDetectionConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('extractionFrameRate')) { + extractionFrameRate = + (_json['extractionFrameRate'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (extractionFrameRate != null) { + _json['extractionFrameRate'] = extractionFrameRate; + } + return _json; + } +} + +/// Metrics calculated for an image object detection (bounding box) model. +class GoogleCloudDatalabelingV1beta1ObjectDetectionMetrics { + /// Precision-recall curve. + GoogleCloudDatalabelingV1beta1PrCurve prCurve; + + GoogleCloudDatalabelingV1beta1ObjectDetectionMetrics(); + + GoogleCloudDatalabelingV1beta1ObjectDetectionMetrics.fromJson( + core.Map _json) { + if (_json.containsKey('prCurve')) { + prCurve = GoogleCloudDatalabelingV1beta1PrCurve.fromJson( + _json['prCurve'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (prCurve != null) { + _json['prCurve'] = prCurve.toJson(); + } + return _json; + } +} + +/// Config for video object tracking human labeling task. +class GoogleCloudDatalabelingV1beta1ObjectTrackingConfig { + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// Videos will be cut to smaller clips to make it easier for labelers to work + /// on. + /// + /// Users can configure is field in seconds, if not set, default value is 20s. + core.int clipLength; + + /// The overlap length between different video clips. + /// + /// Users can configure is field in seconds, if not set, default value is + /// 0.3s. + core.int overlapLength; + + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig(); + + GoogleCloudDatalabelingV1beta1ObjectTrackingConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('clipLength')) { + clipLength = _json['clipLength'] as core.int; + } + if (_json.containsKey('overlapLength')) { + overlapLength = _json['overlapLength'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (clipLength != null) { + _json['clipLength'] = clipLength; + } + if (overlapLength != null) { + _json['overlapLength'] = overlapLength; + } + return _json; + } +} + +/// Video frame level annotation for object detection and tracking. +class GoogleCloudDatalabelingV1beta1ObjectTrackingFrame { + GoogleCloudDatalabelingV1beta1BoundingPoly boundingPoly; + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly normalizedBoundingPoly; + + /// The time offset of this frame relative to the beginning of the video. + core.String timeOffset; + + GoogleCloudDatalabelingV1beta1ObjectTrackingFrame(); + + GoogleCloudDatalabelingV1beta1ObjectTrackingFrame.fromJson(core.Map _json) { + if (_json.containsKey('boundingPoly')) { + boundingPoly = GoogleCloudDatalabelingV1beta1BoundingPoly.fromJson( + _json['boundingPoly'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('normalizedBoundingPoly')) { + normalizedBoundingPoly = + GoogleCloudDatalabelingV1beta1NormalizedBoundingPoly.fromJson( + _json['normalizedBoundingPoly'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('timeOffset')) { + timeOffset = _json['timeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boundingPoly != null) { + _json['boundingPoly'] = boundingPoly.toJson(); + } + if (normalizedBoundingPoly != null) { + _json['normalizedBoundingPoly'] = normalizedBoundingPoly.toJson(); + } + if (timeOffset != null) { + _json['timeOffset'] = timeOffset; + } + return _json; + } +} + +/// Metadata describing the feedback from the operator. +class GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata { + GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata(); + + GoogleCloudDatalabelingV1beta1OperatorFeedbackMetadata.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// General information useful for labels coming from contributors. +class GoogleCloudDatalabelingV1beta1OperatorMetadata { + /// Comments from contributors. + core.List<core.String> comments; + + /// The total number of contributors that choose this label. + core.int labelVotes; + + /// Confidence score corresponding to a label. + /// + /// For examle, if 3 contributors have answered the question and 2 of them + /// agree on the final label, the confidence score will be 0.67 (2/3). + core.double score; + + /// The total number of contributors that answer this question. + core.int totalVotes; + + GoogleCloudDatalabelingV1beta1OperatorMetadata(); + + GoogleCloudDatalabelingV1beta1OperatorMetadata.fromJson(core.Map _json) { + if (_json.containsKey('comments')) { + comments = (_json['comments'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('labelVotes')) { + labelVotes = _json['labelVotes'] as core.int; + } + if (_json.containsKey('score')) { + score = (_json['score'] as core.num).toDouble(); + } + if (_json.containsKey('totalVotes')) { + totalVotes = _json['totalVotes'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (comments != null) { + _json['comments'] = comments; + } + if (labelVotes != null) { + _json['labelVotes'] = labelVotes; + } + if (score != null) { + _json['score'] = score; + } + if (totalVotes != null) { + _json['totalVotes'] = totalVotes; + } + return _json; + } +} + +/// The configuration of output data. +class GoogleCloudDatalabelingV1beta1OutputConfig { + /// Output to a file in Cloud Storage. + /// + /// Should be used for labeling output other than image segmentation. + GoogleCloudDatalabelingV1beta1GcsDestination gcsDestination; + + /// Output to a folder in Cloud Storage. + /// + /// Should be used for image segmentation or document de-identification + /// labeling outputs. + GoogleCloudDatalabelingV1beta1GcsFolderDestination gcsFolderDestination; + + GoogleCloudDatalabelingV1beta1OutputConfig(); + + GoogleCloudDatalabelingV1beta1OutputConfig.fromJson(core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = GoogleCloudDatalabelingV1beta1GcsDestination.fromJson( + _json['gcsDestination'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('gcsFolderDestination')) { + gcsFolderDestination = + GoogleCloudDatalabelingV1beta1GcsFolderDestination.fromJson( + _json['gcsFolderDestination'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination.toJson(); + } + if (gcsFolderDestination != null) { + _json['gcsFolderDestination'] = gcsFolderDestination.toJson(); + } + return _json; + } +} + +/// Request message for PauseEvaluationJob. +class GoogleCloudDatalabelingV1beta1PauseEvaluationJobRequest { + GoogleCloudDatalabelingV1beta1PauseEvaluationJobRequest(); + + GoogleCloudDatalabelingV1beta1PauseEvaluationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Instruction from a PDF file. +class GoogleCloudDatalabelingV1beta1PdfInstruction { + /// PDF file for the instruction. + /// + /// Only gcs path is allowed. + core.String gcsFileUri; + + GoogleCloudDatalabelingV1beta1PdfInstruction(); + + GoogleCloudDatalabelingV1beta1PdfInstruction.fromJson(core.Map _json) { + if (_json.containsKey('gcsFileUri')) { + gcsFileUri = _json['gcsFileUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsFileUri != null) { + _json['gcsFileUri'] = gcsFileUri; + } + return _json; + } +} + +/// A line with multiple line segments. +class GoogleCloudDatalabelingV1beta1Polyline { + /// The polyline vertices. + core.List<GoogleCloudDatalabelingV1beta1Vertex> vertices; + + GoogleCloudDatalabelingV1beta1Polyline(); + + GoogleCloudDatalabelingV1beta1Polyline.fromJson(core.Map _json) { + if (_json.containsKey('vertices')) { + vertices = (_json['vertices'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Vertex>((value) => + GoogleCloudDatalabelingV1beta1Vertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vertices != null) { + _json['vertices'] = vertices.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Config for image polyline human labeling task. +class GoogleCloudDatalabelingV1beta1PolylineConfig { + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// Instruction message showed on contributors UI. + /// + /// Optional. + core.String instructionMessage; + + GoogleCloudDatalabelingV1beta1PolylineConfig(); + + GoogleCloudDatalabelingV1beta1PolylineConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('instructionMessage')) { + instructionMessage = _json['instructionMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (instructionMessage != null) { + _json['instructionMessage'] = instructionMessage; + } + return _json; + } +} + +class GoogleCloudDatalabelingV1beta1PrCurve { + /// The annotation spec of the label for which the precision-recall curve + /// calculated. + /// + /// If this field is empty, that means the precision-recall curve is an + /// aggregate curve for all labels. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// Area under the precision-recall curve. + /// + /// Not to be confused with area under a receiver operating characteristic + /// (ROC) curve. + core.double areaUnderCurve; + + /// Entries that make up the precision-recall graph. + /// + /// Each entry is a "point" on the graph drawn for a different + /// `confidence_threshold`. + core.List<GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry> + confidenceMetricsEntries; + + /// Mean average prcision of this curve. + core.double meanAveragePrecision; + + GoogleCloudDatalabelingV1beta1PrCurve(); + + GoogleCloudDatalabelingV1beta1PrCurve.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('areaUnderCurve')) { + areaUnderCurve = (_json['areaUnderCurve'] as core.num).toDouble(); + } + if (_json.containsKey('confidenceMetricsEntries')) { + confidenceMetricsEntries = (_json['confidenceMetricsEntries'] + as core.List) + .map<GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry>((value) => + GoogleCloudDatalabelingV1beta1ConfidenceMetricsEntry.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('meanAveragePrecision')) { + meanAveragePrecision = + (_json['meanAveragePrecision'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (areaUnderCurve != null) { + _json['areaUnderCurve'] = areaUnderCurve; + } + if (confidenceMetricsEntries != null) { + _json['confidenceMetricsEntries'] = + confidenceMetricsEntries.map((value) => value.toJson()).toList(); + } + if (meanAveragePrecision != null) { + _json['meanAveragePrecision'] = meanAveragePrecision; + } + return _json; + } +} + +/// Metadata describing the feedback from the labeling task requester. +class GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata { + GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata(); + + GoogleCloudDatalabelingV1beta1RequesterFeedbackMetadata.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message ResumeEvaluationJob. +class GoogleCloudDatalabelingV1beta1ResumeEvaluationJobRequest { + GoogleCloudDatalabelingV1beta1ResumeEvaluationJobRequest(); + + GoogleCloudDatalabelingV1beta1ResumeEvaluationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// A row in the confusion matrix. +/// +/// Each entry in this row has the same ground truth label. +class GoogleCloudDatalabelingV1beta1Row { + /// The annotation spec of the ground truth label for this row. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// A list of the confusion matrix entries. + /// + /// One entry for each possible predicted label. + core.List<GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry> entries; + + GoogleCloudDatalabelingV1beta1Row(); + + GoogleCloudDatalabelingV1beta1Row.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('entries')) { + entries = (_json['entries'] as core.List) + .map<GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry>((value) => + GoogleCloudDatalabelingV1beta1ConfusionMatrixEntry.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (entries != null) { + _json['entries'] = entries.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Results of searching evaluations. +class GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse { + /// The list of evaluations matching the search. + core.List<GoogleCloudDatalabelingV1beta1Evaluation> evaluations; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse(); + + GoogleCloudDatalabelingV1beta1SearchEvaluationsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('evaluations')) { + evaluations = (_json['evaluations'] as core.List) + .map<GoogleCloudDatalabelingV1beta1Evaluation>((value) => + GoogleCloudDatalabelingV1beta1Evaluation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (evaluations != null) { + _json['evaluations'] = + evaluations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Request message of SearchExampleComparisons. +class GoogleCloudDatalabelingV1beta1SearchExampleComparisonsRequest { + /// Requested page size. + /// + /// Server may return fewer results than requested. Default value is 100. + /// + /// Optional. + core.int pageSize; + + /// A token identifying a page of results for the server to return. + /// + /// Typically obtained by the nextPageToken of the response to a previous + /// search rquest. If you don't specify this field, the API call requests the + /// first page of the search. + /// + /// Optional. + core.String pageToken; + + GoogleCloudDatalabelingV1beta1SearchExampleComparisonsRequest(); + + GoogleCloudDatalabelingV1beta1SearchExampleComparisonsRequest.fromJson( + core.Map _json) { + if (_json.containsKey('pageSize')) { + pageSize = _json['pageSize'] as core.int; + } + if (_json.containsKey('pageToken')) { + pageToken = _json['pageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pageSize != null) { + _json['pageSize'] = pageSize; + } + if (pageToken != null) { + _json['pageToken'] = pageToken; + } + return _json; + } +} + +/// Results of searching example comparisons. +class GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse { + /// A list of example comparisons matching the search criteria. + core.List<GoogleCloudDatalabelingV1beta1ExampleComparison> exampleComparisons; + + /// A token to retrieve next page of results. + core.String nextPageToken; + + GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse(); + + GoogleCloudDatalabelingV1beta1SearchExampleComparisonsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('exampleComparisons')) { + exampleComparisons = (_json['exampleComparisons'] as core.List) + .map<GoogleCloudDatalabelingV1beta1ExampleComparison>((value) => + GoogleCloudDatalabelingV1beta1ExampleComparison.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exampleComparisons != null) { + _json['exampleComparisons'] = + exampleComparisons.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Config for image segmentation +class GoogleCloudDatalabelingV1beta1SegmentationConfig { + /// Annotation spec set resource name. + /// + /// format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} + /// + /// Required. + core.String annotationSpecSet; + + /// Instruction message showed on labelers UI. + core.String instructionMessage; + + GoogleCloudDatalabelingV1beta1SegmentationConfig(); + + GoogleCloudDatalabelingV1beta1SegmentationConfig.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('instructionMessage')) { + instructionMessage = _json['instructionMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (instructionMessage != null) { + _json['instructionMessage'] = instructionMessage; + } + return _json; + } +} + +/// Config for setting up sentiments. +class GoogleCloudDatalabelingV1beta1SentimentConfig { + /// If set to true, contributors will have the option to select sentiment of + /// the label they selected, to mark it as negative or positive label. + /// + /// Default is false. + core.bool enableLabelSentimentSelection; + + GoogleCloudDatalabelingV1beta1SentimentConfig(); + + GoogleCloudDatalabelingV1beta1SentimentConfig.fromJson(core.Map _json) { + if (_json.containsKey('enableLabelSentimentSelection')) { + enableLabelSentimentSelection = + _json['enableLabelSentimentSelection'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (enableLabelSentimentSelection != null) { + _json['enableLabelSentimentSelection'] = enableLabelSentimentSelection; + } + return _json; + } +} + +/// Start and end position in a sequence (e.g. text segment). +class GoogleCloudDatalabelingV1beta1SequentialSegment { + /// End position (exclusive). + core.int end; + + /// Start position (inclusive). + core.int start; + + GoogleCloudDatalabelingV1beta1SequentialSegment(); + + GoogleCloudDatalabelingV1beta1SequentialSegment.fromJson(core.Map _json) { + if (_json.containsKey('end')) { + end = _json['end'] as core.int; + } + if (_json.containsKey('start')) { + start = _json['start'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (end != null) { + _json['end'] = end; + } + if (start != null) { + _json['start'] = start; + } + return _json; + } +} + +/// Text classification annotation. +class GoogleCloudDatalabelingV1beta1TextClassificationAnnotation { + /// Label of the text. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + GoogleCloudDatalabelingV1beta1TextClassificationAnnotation(); + + GoogleCloudDatalabelingV1beta1TextClassificationAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + return _json; + } +} + +/// Config for text classification human labeling task. +class GoogleCloudDatalabelingV1beta1TextClassificationConfig { + /// If allow_multi_label is true, contributors are able to choose multiple + /// labels for one text segment. + /// + /// Optional. + core.bool allowMultiLabel; + + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + /// Configs for sentiment selection. + /// + /// We deprecate sentiment analysis in data labeling side as it is + /// incompatible with uCAIP. + /// + /// Optional. + GoogleCloudDatalabelingV1beta1SentimentConfig sentimentConfig; + + GoogleCloudDatalabelingV1beta1TextClassificationConfig(); + + GoogleCloudDatalabelingV1beta1TextClassificationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('allowMultiLabel')) { + allowMultiLabel = _json['allowMultiLabel'] as core.bool; + } + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + if (_json.containsKey('sentimentConfig')) { + sentimentConfig = GoogleCloudDatalabelingV1beta1SentimentConfig.fromJson( + _json['sentimentConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowMultiLabel != null) { + _json['allowMultiLabel'] = allowMultiLabel; + } + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + if (sentimentConfig != null) { + _json['sentimentConfig'] = sentimentConfig.toJson(); + } + return _json; + } +} + +/// Text entity extraction annotation. +class GoogleCloudDatalabelingV1beta1TextEntityExtractionAnnotation { + /// Label of the text entities. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// Position of the entity. + GoogleCloudDatalabelingV1beta1SequentialSegment sequentialSegment; + + GoogleCloudDatalabelingV1beta1TextEntityExtractionAnnotation(); + + GoogleCloudDatalabelingV1beta1TextEntityExtractionAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('sequentialSegment')) { + sequentialSegment = + GoogleCloudDatalabelingV1beta1SequentialSegment.fromJson( + _json['sequentialSegment'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (sequentialSegment != null) { + _json['sequentialSegment'] = sequentialSegment.toJson(); + } + return _json; + } +} + +/// Config for text entity extraction human labeling task. +class GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig { + /// Annotation spec set resource name. + /// + /// Required. + core.String annotationSpecSet; + + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig(); + + GoogleCloudDatalabelingV1beta1TextEntityExtractionConfig.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpecSet')) { + annotationSpecSet = _json['annotationSpecSet'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSet != null) { + _json['annotationSpecSet'] = annotationSpecSet; + } + return _json; + } +} + +/// Metadata for the text. +class GoogleCloudDatalabelingV1beta1TextMetadata { + /// The language of this text, as a + /// \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + /// Default value is en-US. + core.String languageCode; + + GoogleCloudDatalabelingV1beta1TextMetadata(); + + GoogleCloudDatalabelingV1beta1TextMetadata.fromJson(core.Map _json) { + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + return _json; + } +} + +/// Container of information about a piece of text. +class GoogleCloudDatalabelingV1beta1TextPayload { + /// Text content. + core.String textContent; + + GoogleCloudDatalabelingV1beta1TextPayload(); + + GoogleCloudDatalabelingV1beta1TextPayload.fromJson(core.Map _json) { + if (_json.containsKey('textContent')) { + textContent = _json['textContent'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (textContent != null) { + _json['textContent'] = textContent; + } + return _json; + } +} + +/// A time period inside of an example that has a time dimension (e.g. video). +class GoogleCloudDatalabelingV1beta1TimeSegment { + /// End of the time segment (exclusive), represented as the duration since the + /// example start. + core.String endTimeOffset; + + /// Start of the time segment (inclusive), represented as the duration since + /// the example start. + core.String startTimeOffset; + + GoogleCloudDatalabelingV1beta1TimeSegment(); + + GoogleCloudDatalabelingV1beta1TimeSegment.fromJson(core.Map _json) { + if (_json.containsKey('endTimeOffset')) { + endTimeOffset = _json['endTimeOffset'] as core.String; + } + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endTimeOffset != null) { + _json['endTimeOffset'] = endTimeOffset; + } + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + return _json; + } +} + +/// A vertex represents a 2D point in the image. +/// +/// NOTE: the vertex coordinates are in the same scale as the original image. +class GoogleCloudDatalabelingV1beta1Vertex { + /// X coordinate. + core.int x; + + /// Y coordinate. + core.int y; + + GoogleCloudDatalabelingV1beta1Vertex(); + + GoogleCloudDatalabelingV1beta1Vertex.fromJson(core.Map _json) { + if (_json.containsKey('x')) { + x = _json['x'] as core.int; + } + if (_json.containsKey('y')) { + y = _json['y'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (x != null) { + _json['x'] = x; + } + if (y != null) { + _json['y'] = y; + } + return _json; + } +} + +/// Video classification annotation. +class GoogleCloudDatalabelingV1beta1VideoClassificationAnnotation { + /// Label of the segment specified by time_segment. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// The time segment of the video to which the annotation applies. + GoogleCloudDatalabelingV1beta1TimeSegment timeSegment; + + GoogleCloudDatalabelingV1beta1VideoClassificationAnnotation(); + + GoogleCloudDatalabelingV1beta1VideoClassificationAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('timeSegment')) { + timeSegment = GoogleCloudDatalabelingV1beta1TimeSegment.fromJson( + _json['timeSegment'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (timeSegment != null) { + _json['timeSegment'] = timeSegment.toJson(); + } + return _json; + } +} + +/// Config for video classification human labeling task. +/// +/// Currently two types of video classification are supported: 1. Assign labels +/// on the entire video. 2. Split the video into multiple video clips based on +/// camera shot, and assign labels on each video clip. +class GoogleCloudDatalabelingV1beta1VideoClassificationConfig { + /// The list of annotation spec set configs. + /// + /// Since watching a video clip takes much longer time than an image, we + /// support label with multiple AnnotationSpecSet at the same time. Labels in + /// each AnnotationSpecSet will be shown in a group to contributors. + /// Contributors can select one or more (depending on whether to allow multi + /// label) from each group. + /// + /// Required. + core.List<GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig> + annotationSpecSetConfigs; + + /// Option to apply shot detection on the video. + /// + /// Optional. + core.bool applyShotDetection; + + GoogleCloudDatalabelingV1beta1VideoClassificationConfig(); + + GoogleCloudDatalabelingV1beta1VideoClassificationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpecSetConfigs')) { + annotationSpecSetConfigs = (_json['annotationSpecSetConfigs'] + as core.List) + .map<GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig>((value) => + GoogleCloudDatalabelingV1beta1AnnotationSpecSetConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('applyShotDetection')) { + applyShotDetection = _json['applyShotDetection'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpecSetConfigs != null) { + _json['annotationSpecSetConfigs'] = + annotationSpecSetConfigs.map((value) => value.toJson()).toList(); + } + if (applyShotDetection != null) { + _json['applyShotDetection'] = applyShotDetection; + } + return _json; + } +} + +/// Video event annotation. +class GoogleCloudDatalabelingV1beta1VideoEventAnnotation { + /// Label of the event in this annotation. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// The time segment of the video to which the annotation applies. + GoogleCloudDatalabelingV1beta1TimeSegment timeSegment; + + GoogleCloudDatalabelingV1beta1VideoEventAnnotation(); + + GoogleCloudDatalabelingV1beta1VideoEventAnnotation.fromJson(core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('timeSegment')) { + timeSegment = GoogleCloudDatalabelingV1beta1TimeSegment.fromJson( + _json['timeSegment'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (timeSegment != null) { + _json['timeSegment'] = timeSegment.toJson(); + } + return _json; + } +} + +/// Video object tracking annotation. +class GoogleCloudDatalabelingV1beta1VideoObjectTrackingAnnotation { + /// Label of the object tracked in this annotation. + GoogleCloudDatalabelingV1beta1AnnotationSpec annotationSpec; + + /// The list of frames where this object track appears. + core.List<GoogleCloudDatalabelingV1beta1ObjectTrackingFrame> + objectTrackingFrames; + + /// The time segment of the video to which object tracking applies. + GoogleCloudDatalabelingV1beta1TimeSegment timeSegment; + + GoogleCloudDatalabelingV1beta1VideoObjectTrackingAnnotation(); + + GoogleCloudDatalabelingV1beta1VideoObjectTrackingAnnotation.fromJson( + core.Map _json) { + if (_json.containsKey('annotationSpec')) { + annotationSpec = GoogleCloudDatalabelingV1beta1AnnotationSpec.fromJson( + _json['annotationSpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('objectTrackingFrames')) { + objectTrackingFrames = (_json['objectTrackingFrames'] as core.List) + .map<GoogleCloudDatalabelingV1beta1ObjectTrackingFrame>((value) => + GoogleCloudDatalabelingV1beta1ObjectTrackingFrame.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('timeSegment')) { + timeSegment = GoogleCloudDatalabelingV1beta1TimeSegment.fromJson( + _json['timeSegment'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotationSpec != null) { + _json['annotationSpec'] = annotationSpec.toJson(); + } + if (objectTrackingFrames != null) { + _json['objectTrackingFrames'] = + objectTrackingFrames.map((value) => value.toJson()).toList(); + } + if (timeSegment != null) { + _json['timeSegment'] = timeSegment.toJson(); + } + return _json; + } +} + +/// Container of information of a video. +class GoogleCloudDatalabelingV1beta1VideoPayload { + /// FPS of the video. + core.double frameRate; + + /// Video format. + core.String mimeType; + + /// Signed uri of the video file in the service bucket. + core.String signedUri; + + /// The list of video thumbnails. + core.List<GoogleCloudDatalabelingV1beta1VideoThumbnail> videoThumbnails; + + /// Video uri from the user bucket. + core.String videoUri; + + GoogleCloudDatalabelingV1beta1VideoPayload(); + + GoogleCloudDatalabelingV1beta1VideoPayload.fromJson(core.Map _json) { + if (_json.containsKey('frameRate')) { + frameRate = (_json['frameRate'] as core.num).toDouble(); + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('signedUri')) { + signedUri = _json['signedUri'] as core.String; + } + if (_json.containsKey('videoThumbnails')) { + videoThumbnails = (_json['videoThumbnails'] as core.List) + .map<GoogleCloudDatalabelingV1beta1VideoThumbnail>((value) => + GoogleCloudDatalabelingV1beta1VideoThumbnail.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('videoUri')) { + videoUri = _json['videoUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (frameRate != null) { + _json['frameRate'] = frameRate; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (signedUri != null) { + _json['signedUri'] = signedUri; + } + if (videoThumbnails != null) { + _json['videoThumbnails'] = + videoThumbnails.map((value) => value.toJson()).toList(); + } + if (videoUri != null) { + _json['videoUri'] = videoUri; + } + return _json; + } +} + +/// Container of information of a video thumbnail. +class GoogleCloudDatalabelingV1beta1VideoThumbnail { + /// A byte string of the video frame. + core.String thumbnail; + core.List<core.int> get thumbnailAsBytes => convert.base64.decode(thumbnail); + + set thumbnailAsBytes(core.List<core.int> _bytes) { + thumbnail = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Time offset relative to the beginning of the video, corresponding to the + /// video frame where the thumbnail has been extracted from. + core.String timeOffset; + + GoogleCloudDatalabelingV1beta1VideoThumbnail(); + + GoogleCloudDatalabelingV1beta1VideoThumbnail.fromJson(core.Map _json) { + if (_json.containsKey('thumbnail')) { + thumbnail = _json['thumbnail'] as core.String; + } + if (_json.containsKey('timeOffset')) { + timeOffset = _json['timeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (thumbnail != null) { + _json['thumbnail'] = thumbnail; + } + if (timeOffset != null) { + _json['timeOffset'] = timeOffset; + } + return _json; + } +} + +/// Metadata of a CreateInstruction operation. +class GoogleCloudDatalabelingV1p1alpha1CreateInstructionMetadata { + /// Timestamp when create instruction request was created. + core.String createTime; + + /// The name of the created Instruction. + /// + /// projects/{project_id}/instructions/{instruction_id} + core.String instruction; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p1alpha1CreateInstructionMetadata(); + + GoogleCloudDatalabelingV1p1alpha1CreateInstructionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Metadata of an ExportData operation. +class GoogleCloudDatalabelingV1p1alpha1ExportDataOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when export dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be exported. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p1alpha1ExportDataOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1ExportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ExportDataset longrunning operation. +class GoogleCloudDatalabelingV1p1alpha1ExportDataOperationResponse { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Ouptut only. + /// + /// The name of dataset. "projects / * /datasets / * " + core.String dataset; + + /// Number of examples exported successfully. + /// + /// Output only. + core.int exportCount; + + /// Statistic infos of labels in the exported dataset. + /// + /// Output only. + GoogleCloudDatalabelingV1p1alpha1LabelStats labelStats; + + /// output_config in the ExportData request. + /// + /// Output only. + GoogleCloudDatalabelingV1p1alpha1OutputConfig outputConfig; + + /// Total number of examples requested to export + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1p1alpha1ExportDataOperationResponse(); + + GoogleCloudDatalabelingV1p1alpha1ExportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('exportCount')) { + exportCount = _json['exportCount'] as core.int; + } + if (_json.containsKey('labelStats')) { + labelStats = GoogleCloudDatalabelingV1p1alpha1LabelStats.fromJson( + _json['labelStats'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputConfig')) { + outputConfig = GoogleCloudDatalabelingV1p1alpha1OutputConfig.fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (exportCount != null) { + _json['exportCount'] = exportCount; + } + if (labelStats != null) { + _json['labelStats'] = labelStats.toJson(); + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Export destination of the data.Only gcs path is allowed in output_uri. +class GoogleCloudDatalabelingV1p1alpha1GcsDestination { + /// The format of the gcs destination. + /// + /// Only "text/csv" and "application/json" are supported. + /// + /// Required. + core.String mimeType; + + /// The output uri of destination file. + /// + /// Required. + core.String outputUri; + + GoogleCloudDatalabelingV1p1alpha1GcsDestination(); + + GoogleCloudDatalabelingV1p1alpha1GcsDestination.fromJson(core.Map _json) { + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('outputUri')) { + outputUri = _json['outputUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (outputUri != null) { + _json['outputUri'] = outputUri; + } + return _json; + } +} + +/// Export folder destination of the data. +class GoogleCloudDatalabelingV1p1alpha1GcsFolderDestination { + /// Cloud Storage directory to export data to. + /// + /// Required. + core.String outputFolderUri; + + GoogleCloudDatalabelingV1p1alpha1GcsFolderDestination(); + + GoogleCloudDatalabelingV1p1alpha1GcsFolderDestination.fromJson( + core.Map _json) { + if (_json.containsKey('outputFolderUri')) { + outputFolderUri = _json['outputFolderUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (outputFolderUri != null) { + _json['outputFolderUri'] = outputFolderUri; + } + return _json; + } +} + +/// Metadata of an GenerateAnalysisReport operation. +class GoogleCloudDatalabelingV1p1alpha1GenerateAnalysisReportOperationMetadata { + /// Timestamp when generate report request was created. + core.String createTime; + + /// The name of the dataset for which the analysis report is generated. + /// + /// Format: "projects / * /datasets / * " + core.String dataset; + + GoogleCloudDatalabelingV1p1alpha1GenerateAnalysisReportOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1GenerateAnalysisReportOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + return _json; + } +} + +/// Configuration for how human labeling task should be done. +class GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig { + /// A human-readable description for AnnotatedDataset. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String annotatedDatasetDescription; + + /// A human-readable name for AnnotatedDataset defined by users. + /// + /// Maximum of 64 characters . + /// + /// Required. + core.String annotatedDatasetDisplayName; + + /// If you want your own labeling contributors to manage and work on this + /// labeling request, you can set these contributors here. + /// + /// We will give them access to the question types in crowdcompute. Note that + /// these emails must be registered in crowdcompute worker UI: + /// https://crowd-compute.appspot.com/ + /// + /// Optional. + core.List<core.String> contributorEmails; + + /// Instruction resource name. + /// + /// Required. + core.String instruction; + + /// A human-readable label used to logically group labeling tasks. + /// + /// This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + /// + /// Optional. + core.String labelGroup; + + /// The Language of this question, as a + /// \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + /// Default value is en-US. Only need to set this when task is language + /// related. For example, French text classification. + /// + /// Optional. + core.String languageCode; + + /// Maximum duration for contributors to answer a question. + /// + /// Maximum is 3600 seconds. Default is 3600 seconds. + /// + /// Optional. + core.String questionDuration; + + /// Replication of questions. + /// + /// Each question will be sent to up to this number of contributors to label. + /// Aggregated answers will be returned. Default is set to 1. For image + /// related labeling, valid values are 1, 3, 5. + /// + /// Optional. + core.int replicaCount; + + /// Email of the user who started the labeling task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig(); + + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDatasetDescription')) { + annotatedDatasetDescription = + _json['annotatedDatasetDescription'] as core.String; + } + if (_json.containsKey('annotatedDatasetDisplayName')) { + annotatedDatasetDisplayName = + _json['annotatedDatasetDisplayName'] as core.String; + } + if (_json.containsKey('contributorEmails')) { + contributorEmails = (_json['contributorEmails'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('labelGroup')) { + labelGroup = _json['labelGroup'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('questionDuration')) { + questionDuration = _json['questionDuration'] as core.String; + } + if (_json.containsKey('replicaCount')) { + replicaCount = _json['replicaCount'] as core.int; + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDatasetDescription != null) { + _json['annotatedDatasetDescription'] = annotatedDatasetDescription; + } + if (annotatedDatasetDisplayName != null) { + _json['annotatedDatasetDisplayName'] = annotatedDatasetDisplayName; + } + if (contributorEmails != null) { + _json['contributorEmails'] = contributorEmails; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (labelGroup != null) { + _json['labelGroup'] = labelGroup; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (questionDuration != null) { + _json['questionDuration'] = questionDuration; + } + if (replicaCount != null) { + _json['replicaCount'] = replicaCount; + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// Metadata of an ImportData operation. +class GoogleCloudDatalabelingV1p1alpha1ImportDataOperationMetadata { + /// Timestamp when import dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of imported dataset. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p1alpha1ImportDataOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1ImportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ImportData longrunning operation. +class GoogleCloudDatalabelingV1p1alpha1ImportDataOperationResponse { + /// Ouptut only. + /// + /// The name of imported dataset. + core.String dataset; + + /// Number of examples imported successfully. + /// + /// Output only. + core.int importCount; + + /// Total number of examples requested to import + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1p1alpha1ImportDataOperationResponse(); + + GoogleCloudDatalabelingV1p1alpha1ImportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('importCount')) { + importCount = _json['importCount'] as core.int; + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataset != null) { + _json['dataset'] = dataset; + } + if (importCount != null) { + _json['importCount'] = importCount; + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Details of a LabelImageBoundingBox operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingBoxOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImageBoundingPoly operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingPolyOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingPolyOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingPolyOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a LabelImageClassification operation. +class GoogleCloudDatalabelingV1p1alpha1LabelImageClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImageClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImageClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageOrientedBoundingBox operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelImageOrientedBoundingBoxOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImageOrientedBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImageOrientedBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImagePolyline operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelImagePolylineOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImagePolylineOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImagePolylineOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageSegmentation operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelImageSegmentationOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelImageSegmentationOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelImageSegmentationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a labeling operation, such as LabelImage or LabelVideo. +/// +/// Next tag: 23 +class GoogleCloudDatalabelingV1p1alpha1LabelOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when labeling request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be labeled. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Details of label image bounding box operation. + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingBoxOperationMetadata + imageBoundingBoxDetails; + + /// Details of label image bounding poly operation. + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingPolyOperationMetadata + imageBoundingPolyDetails; + + /// Details of label image classification operation. + GoogleCloudDatalabelingV1p1alpha1LabelImageClassificationOperationMetadata + imageClassificationDetails; + + /// Details of label image oriented bounding box operation. + GoogleCloudDatalabelingV1p1alpha1LabelImageOrientedBoundingBoxOperationMetadata + imageOrientedBoundingBoxDetails; + + /// Details of label image polyline operation. + GoogleCloudDatalabelingV1p1alpha1LabelImagePolylineOperationMetadata + imagePolylineDetails; + + /// Details of label image segmentation operation. + GoogleCloudDatalabelingV1p1alpha1LabelImageSegmentationOperationMetadata + imageSegmentationDetails; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + /// Progress of label operation. + /// + /// Range: \[0, 100\]. + /// + /// Output only. + core.int progressPercent; + + /// Details of label text classification operation. + GoogleCloudDatalabelingV1p1alpha1LabelTextClassificationOperationMetadata + textClassificationDetails; + + /// Details of label text entity extraction operation. + GoogleCloudDatalabelingV1p1alpha1LabelTextEntityExtractionOperationMetadata + textEntityExtractionDetails; + + /// Details of label video classification operation. + GoogleCloudDatalabelingV1p1alpha1LabelVideoClassificationOperationMetadata + videoClassificationDetails; + + /// Details of label video event operation. + GoogleCloudDatalabelingV1p1alpha1LabelVideoEventOperationMetadata + videoEventDetails; + + /// Details of label video object detection operation. + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectDetectionOperationMetadata + videoObjectDetectionDetails; + + /// Details of label video object tracking operation. + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectTrackingOperationMetadata + videoObjectTrackingDetails; + + GoogleCloudDatalabelingV1p1alpha1LabelOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('imageBoundingBoxDetails')) { + imageBoundingBoxDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingBoxOperationMetadata + .fromJson(_json['imageBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageBoundingPolyDetails')) { + imageBoundingPolyDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImageBoundingPolyOperationMetadata + .fromJson(_json['imageBoundingPolyDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationDetails')) { + imageClassificationDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImageClassificationOperationMetadata + .fromJson(_json['imageClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageOrientedBoundingBoxDetails')) { + imageOrientedBoundingBoxDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImageOrientedBoundingBoxOperationMetadata + .fromJson(_json['imageOrientedBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imagePolylineDetails')) { + imagePolylineDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImagePolylineOperationMetadata + .fromJson(_json['imagePolylineDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageSegmentationDetails')) { + imageSegmentationDetails = + GoogleCloudDatalabelingV1p1alpha1LabelImageSegmentationOperationMetadata + .fromJson(_json['imageSegmentationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('progressPercent')) { + progressPercent = _json['progressPercent'] as core.int; + } + if (_json.containsKey('textClassificationDetails')) { + textClassificationDetails = + GoogleCloudDatalabelingV1p1alpha1LabelTextClassificationOperationMetadata + .fromJson(_json['textClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionDetails')) { + textEntityExtractionDetails = + GoogleCloudDatalabelingV1p1alpha1LabelTextEntityExtractionOperationMetadata + .fromJson(_json['textEntityExtractionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationDetails')) { + videoClassificationDetails = + GoogleCloudDatalabelingV1p1alpha1LabelVideoClassificationOperationMetadata + .fromJson(_json['videoClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoEventDetails')) { + videoEventDetails = + GoogleCloudDatalabelingV1p1alpha1LabelVideoEventOperationMetadata + .fromJson(_json['videoEventDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectDetectionDetails')) { + videoObjectDetectionDetails = + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectDetectionOperationMetadata + .fromJson(_json['videoObjectDetectionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectTrackingDetails')) { + videoObjectTrackingDetails = + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectTrackingOperationMetadata + .fromJson(_json['videoObjectTrackingDetails'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (imageBoundingBoxDetails != null) { + _json['imageBoundingBoxDetails'] = imageBoundingBoxDetails.toJson(); + } + if (imageBoundingPolyDetails != null) { + _json['imageBoundingPolyDetails'] = imageBoundingPolyDetails.toJson(); + } + if (imageClassificationDetails != null) { + _json['imageClassificationDetails'] = imageClassificationDetails.toJson(); + } + if (imageOrientedBoundingBoxDetails != null) { + _json['imageOrientedBoundingBoxDetails'] = + imageOrientedBoundingBoxDetails.toJson(); + } + if (imagePolylineDetails != null) { + _json['imagePolylineDetails'] = imagePolylineDetails.toJson(); + } + if (imageSegmentationDetails != null) { + _json['imageSegmentationDetails'] = imageSegmentationDetails.toJson(); + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + if (progressPercent != null) { + _json['progressPercent'] = progressPercent; + } + if (textClassificationDetails != null) { + _json['textClassificationDetails'] = textClassificationDetails.toJson(); + } + if (textEntityExtractionDetails != null) { + _json['textEntityExtractionDetails'] = + textEntityExtractionDetails.toJson(); + } + if (videoClassificationDetails != null) { + _json['videoClassificationDetails'] = videoClassificationDetails.toJson(); + } + if (videoEventDetails != null) { + _json['videoEventDetails'] = videoEventDetails.toJson(); + } + if (videoObjectDetectionDetails != null) { + _json['videoObjectDetectionDetails'] = + videoObjectDetectionDetails.toJson(); + } + if (videoObjectTrackingDetails != null) { + _json['videoObjectTrackingDetails'] = videoObjectTrackingDetails.toJson(); + } + return _json; + } +} + +/// Statistics about annotation specs. +class GoogleCloudDatalabelingV1p1alpha1LabelStats { + /// Map of each annotation spec's example count. + /// + /// Key is the annotation spec name and value is the number of examples for + /// that annotation spec. If the annotated dataset does not have annotation + /// spec, the map will return a pair where the key is empty string and value + /// is the total number of annotations. + core.Map<core.String, core.String> exampleCount; + + GoogleCloudDatalabelingV1p1alpha1LabelStats(); + + GoogleCloudDatalabelingV1p1alpha1LabelStats.fromJson(core.Map _json) { + if (_json.containsKey('exampleCount')) { + exampleCount = (_json['exampleCount'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + return _json; + } +} + +/// Details of a LabelTextClassification operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelTextClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelTextClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelTextClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelTextEntityExtraction operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelTextEntityExtractionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelTextEntityExtractionOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelTextEntityExtractionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoClassification operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelVideoClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelVideoClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelVideoClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoEvent operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelVideoEventOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelVideoEventOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelVideoEventOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectDetection operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectDetectionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectDetectionOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectDetectionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectTracking operation metadata. +class GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectTrackingOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectTrackingOperationMetadata(); + + GoogleCloudDatalabelingV1p1alpha1LabelVideoObjectTrackingOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p1alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// The configuration of output data. +class GoogleCloudDatalabelingV1p1alpha1OutputConfig { + /// Output to a file in Cloud Storage. + /// + /// Should be used for labeling output other than image segmentation. + GoogleCloudDatalabelingV1p1alpha1GcsDestination gcsDestination; + + /// Output to a folder in Cloud Storage. + /// + /// Should be used for image segmentation or document de-identification + /// labeling outputs. + GoogleCloudDatalabelingV1p1alpha1GcsFolderDestination gcsFolderDestination; + + GoogleCloudDatalabelingV1p1alpha1OutputConfig(); + + GoogleCloudDatalabelingV1p1alpha1OutputConfig.fromJson(core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = GoogleCloudDatalabelingV1p1alpha1GcsDestination.fromJson( + _json['gcsDestination'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('gcsFolderDestination')) { + gcsFolderDestination = + GoogleCloudDatalabelingV1p1alpha1GcsFolderDestination.fromJson( + _json['gcsFolderDestination'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination.toJson(); + } + if (gcsFolderDestination != null) { + _json['gcsFolderDestination'] = gcsFolderDestination.toJson(); + } + return _json; + } +} + +/// Metadata of a CreateInstruction operation. +class GoogleCloudDatalabelingV1p2alpha1CreateInstructionMetadata { + /// Timestamp when create instruction request was created. + core.String createTime; + + /// The name of the created Instruction. + /// + /// projects/{project_id}/instructions/{instruction_id} + core.String instruction; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p2alpha1CreateInstructionMetadata(); + + GoogleCloudDatalabelingV1p2alpha1CreateInstructionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Metadata of an ExportData operation. +class GoogleCloudDatalabelingV1p2alpha1ExportDataOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when export dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be exported. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p2alpha1ExportDataOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1ExportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ExportDataset longrunning operation. +class GoogleCloudDatalabelingV1p2alpha1ExportDataOperationResponse { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Ouptut only. + /// + /// The name of dataset. "projects / * /datasets / * " + core.String dataset; + + /// Number of examples exported successfully. + /// + /// Output only. + core.int exportCount; + + /// Statistic infos of labels in the exported dataset. + /// + /// Output only. + GoogleCloudDatalabelingV1p2alpha1LabelStats labelStats; + + /// output_config in the ExportData request. + /// + /// Output only. + GoogleCloudDatalabelingV1p2alpha1OutputConfig outputConfig; + + /// Total number of examples requested to export + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1p2alpha1ExportDataOperationResponse(); + + GoogleCloudDatalabelingV1p2alpha1ExportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('exportCount')) { + exportCount = _json['exportCount'] as core.int; + } + if (_json.containsKey('labelStats')) { + labelStats = GoogleCloudDatalabelingV1p2alpha1LabelStats.fromJson( + _json['labelStats'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputConfig')) { + outputConfig = GoogleCloudDatalabelingV1p2alpha1OutputConfig.fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (exportCount != null) { + _json['exportCount'] = exportCount; + } + if (labelStats != null) { + _json['labelStats'] = labelStats.toJson(); + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Export destination of the data.Only gcs path is allowed in output_uri. +class GoogleCloudDatalabelingV1p2alpha1GcsDestination { + /// The format of the gcs destination. + /// + /// Only "text/csv" and "application/json" are supported. + /// + /// Required. + core.String mimeType; + + /// The output uri of destination file. + /// + /// Required. + core.String outputUri; + + GoogleCloudDatalabelingV1p2alpha1GcsDestination(); + + GoogleCloudDatalabelingV1p2alpha1GcsDestination.fromJson(core.Map _json) { + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('outputUri')) { + outputUri = _json['outputUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (outputUri != null) { + _json['outputUri'] = outputUri; + } + return _json; + } +} + +/// Export folder destination of the data. +class GoogleCloudDatalabelingV1p2alpha1GcsFolderDestination { + /// Cloud Storage directory to export data to. + /// + /// Required. + core.String outputFolderUri; + + GoogleCloudDatalabelingV1p2alpha1GcsFolderDestination(); + + GoogleCloudDatalabelingV1p2alpha1GcsFolderDestination.fromJson( + core.Map _json) { + if (_json.containsKey('outputFolderUri')) { + outputFolderUri = _json['outputFolderUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (outputFolderUri != null) { + _json['outputFolderUri'] = outputFolderUri; + } + return _json; + } +} + +/// Configuration for how human labeling task should be done. +class GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig { + /// A human-readable description for AnnotatedDataset. + /// + /// The description can be up to 10000 characters long. + /// + /// Optional. + core.String annotatedDatasetDescription; + + /// A human-readable name for AnnotatedDataset defined by users. + /// + /// Maximum of 64 characters . + /// + /// Required. + core.String annotatedDatasetDisplayName; + + /// If you want your own labeling contributors to manage and work on this + /// labeling request, you can set these contributors here. + /// + /// We will give them access to the question types in crowdcompute. Note that + /// these emails must be registered in crowdcompute worker UI: + /// https://crowd-compute.appspot.com/ + /// + /// Optional. + core.List<core.String> contributorEmails; + + /// Instruction resource name. + /// + /// Required. + core.String instruction; + + /// A human-readable label used to logically group labeling tasks. + /// + /// This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. + /// + /// Optional. + core.String labelGroup; + + /// The Language of this question, as a + /// \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + /// + /// Default value is en-US. Only need to set this when task is language + /// related. For example, French text classification. + /// + /// Optional. + core.String languageCode; + + /// Maximum duration for contributors to answer a question. + /// + /// Maximum is 3600 seconds. Default is 3600 seconds. + /// + /// Optional. + core.String questionDuration; + + /// Replication of questions. + /// + /// Each question will be sent to up to this number of contributors to label. + /// Aggregated answers will be returned. Default is set to 1. For image + /// related labeling, valid values are 1, 3, 5. + /// + /// Optional. + core.int replicaCount; + + /// Email of the user who started the labeling task and should be notified by + /// email. + /// + /// If empty no notification will be sent. + core.String userEmailAddress; + + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig(); + + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDatasetDescription')) { + annotatedDatasetDescription = + _json['annotatedDatasetDescription'] as core.String; + } + if (_json.containsKey('annotatedDatasetDisplayName')) { + annotatedDatasetDisplayName = + _json['annotatedDatasetDisplayName'] as core.String; + } + if (_json.containsKey('contributorEmails')) { + contributorEmails = (_json['contributorEmails'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('instruction')) { + instruction = _json['instruction'] as core.String; + } + if (_json.containsKey('labelGroup')) { + labelGroup = _json['labelGroup'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('questionDuration')) { + questionDuration = _json['questionDuration'] as core.String; + } + if (_json.containsKey('replicaCount')) { + replicaCount = _json['replicaCount'] as core.int; + } + if (_json.containsKey('userEmailAddress')) { + userEmailAddress = _json['userEmailAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDatasetDescription != null) { + _json['annotatedDatasetDescription'] = annotatedDatasetDescription; + } + if (annotatedDatasetDisplayName != null) { + _json['annotatedDatasetDisplayName'] = annotatedDatasetDisplayName; + } + if (contributorEmails != null) { + _json['contributorEmails'] = contributorEmails; + } + if (instruction != null) { + _json['instruction'] = instruction; + } + if (labelGroup != null) { + _json['labelGroup'] = labelGroup; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (questionDuration != null) { + _json['questionDuration'] = questionDuration; + } + if (replicaCount != null) { + _json['replicaCount'] = replicaCount; + } + if (userEmailAddress != null) { + _json['userEmailAddress'] = userEmailAddress; + } + return _json; + } +} + +/// Metadata of an ImportData operation. +class GoogleCloudDatalabelingV1p2alpha1ImportDataOperationMetadata { + /// Timestamp when import dataset request was created. + /// + /// Output only. + core.String createTime; + + /// The name of imported dataset. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + GoogleCloudDatalabelingV1p2alpha1ImportDataOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1ImportDataOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response used for ImportData longrunning operation. +class GoogleCloudDatalabelingV1p2alpha1ImportDataOperationResponse { + /// Ouptut only. + /// + /// The name of imported dataset. + core.String dataset; + + /// Number of examples imported successfully. + /// + /// Output only. + core.int importCount; + + /// Total number of examples requested to import + /// + /// Output only. + core.int totalCount; + + GoogleCloudDatalabelingV1p2alpha1ImportDataOperationResponse(); + + GoogleCloudDatalabelingV1p2alpha1ImportDataOperationResponse.fromJson( + core.Map _json) { + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('importCount')) { + importCount = _json['importCount'] as core.int; + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataset != null) { + _json['dataset'] = dataset; + } + if (importCount != null) { + _json['importCount'] = importCount; + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// Details of a LabelImageBoundingBox operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingBoxOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImageBoundingPoly operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingPolyOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingPolyOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingPolyOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a LabelImageClassification operation. +class GoogleCloudDatalabelingV1p2alpha1LabelImageClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImageClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImageClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageOrientedBoundingBox operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelImageOrientedBoundingBoxOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImageOrientedBoundingBoxOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImageOrientedBoundingBoxOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of LabelImagePolyline operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelImagePolylineOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImagePolylineOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImagePolylineOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelImageSegmentation operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelImageSegmentationOperationMetadata { + /// Basic human annotation config. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelImageSegmentationOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelImageSegmentationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Metadata of a labeling operation, such as LabelImage or LabelVideo. +/// +/// Next tag: 23 +class GoogleCloudDatalabelingV1p2alpha1LabelOperationMetadata { + /// The name of annotated dataset in format "projects / * /datasets / * + /// /annotatedDatasets / * ". + /// + /// Output only. + core.String annotatedDataset; + + /// Timestamp when labeling request was created. + /// + /// Output only. + core.String createTime; + + /// The name of dataset to be labeled. + /// + /// "projects / * /datasets / * " + /// + /// Output only. + core.String dataset; + + /// Details of label image bounding box operation. + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingBoxOperationMetadata + imageBoundingBoxDetails; + + /// Details of label image bounding poly operation. + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingPolyOperationMetadata + imageBoundingPolyDetails; + + /// Details of label image classification operation. + GoogleCloudDatalabelingV1p2alpha1LabelImageClassificationOperationMetadata + imageClassificationDetails; + + /// Details of label image oriented bounding box operation. + GoogleCloudDatalabelingV1p2alpha1LabelImageOrientedBoundingBoxOperationMetadata + imageOrientedBoundingBoxDetails; + + /// Details of label image polyline operation. + GoogleCloudDatalabelingV1p2alpha1LabelImagePolylineOperationMetadata + imagePolylineDetails; + + /// Details of label image segmentation operation. + GoogleCloudDatalabelingV1p2alpha1LabelImageSegmentationOperationMetadata + imageSegmentationDetails; + + /// Partial failures encountered. + /// + /// E.g. single files that couldn't be read. Status details field will contain + /// standard GCP error details. + /// + /// Output only. + core.List<GoogleRpcStatus> partialFailures; + + /// Progress of label operation. + /// + /// Range: \[0, 100\]. + /// + /// Output only. + core.int progressPercent; + + /// Details of label text classification operation. + GoogleCloudDatalabelingV1p2alpha1LabelTextClassificationOperationMetadata + textClassificationDetails; + + /// Details of label text entity extraction operation. + GoogleCloudDatalabelingV1p2alpha1LabelTextEntityExtractionOperationMetadata + textEntityExtractionDetails; + + /// Details of label video classification operation. + GoogleCloudDatalabelingV1p2alpha1LabelVideoClassificationOperationMetadata + videoClassificationDetails; + + /// Details of label video event operation. + GoogleCloudDatalabelingV1p2alpha1LabelVideoEventOperationMetadata + videoEventDetails; + + /// Details of label video object detection operation. + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectDetectionOperationMetadata + videoObjectDetectionDetails; + + /// Details of label video object tracking operation. + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectTrackingOperationMetadata + videoObjectTrackingDetails; + + GoogleCloudDatalabelingV1p2alpha1LabelOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('annotatedDataset')) { + annotatedDataset = _json['annotatedDataset'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dataset')) { + dataset = _json['dataset'] as core.String; + } + if (_json.containsKey('imageBoundingBoxDetails')) { + imageBoundingBoxDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingBoxOperationMetadata + .fromJson(_json['imageBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageBoundingPolyDetails')) { + imageBoundingPolyDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImageBoundingPolyOperationMetadata + .fromJson(_json['imageBoundingPolyDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageClassificationDetails')) { + imageClassificationDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImageClassificationOperationMetadata + .fromJson(_json['imageClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageOrientedBoundingBoxDetails')) { + imageOrientedBoundingBoxDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImageOrientedBoundingBoxOperationMetadata + .fromJson(_json['imageOrientedBoundingBoxDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imagePolylineDetails')) { + imagePolylineDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImagePolylineOperationMetadata + .fromJson(_json['imagePolylineDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('imageSegmentationDetails')) { + imageSegmentationDetails = + GoogleCloudDatalabelingV1p2alpha1LabelImageSegmentationOperationMetadata + .fromJson(_json['imageSegmentationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('partialFailures')) { + partialFailures = (_json['partialFailures'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('progressPercent')) { + progressPercent = _json['progressPercent'] as core.int; + } + if (_json.containsKey('textClassificationDetails')) { + textClassificationDetails = + GoogleCloudDatalabelingV1p2alpha1LabelTextClassificationOperationMetadata + .fromJson(_json['textClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textEntityExtractionDetails')) { + textEntityExtractionDetails = + GoogleCloudDatalabelingV1p2alpha1LabelTextEntityExtractionOperationMetadata + .fromJson(_json['textEntityExtractionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoClassificationDetails')) { + videoClassificationDetails = + GoogleCloudDatalabelingV1p2alpha1LabelVideoClassificationOperationMetadata + .fromJson(_json['videoClassificationDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoEventDetails')) { + videoEventDetails = + GoogleCloudDatalabelingV1p2alpha1LabelVideoEventOperationMetadata + .fromJson(_json['videoEventDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectDetectionDetails')) { + videoObjectDetectionDetails = + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectDetectionOperationMetadata + .fromJson(_json['videoObjectDetectionDetails'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoObjectTrackingDetails')) { + videoObjectTrackingDetails = + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectTrackingOperationMetadata + .fromJson(_json['videoObjectTrackingDetails'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (annotatedDataset != null) { + _json['annotatedDataset'] = annotatedDataset; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dataset != null) { + _json['dataset'] = dataset; + } + if (imageBoundingBoxDetails != null) { + _json['imageBoundingBoxDetails'] = imageBoundingBoxDetails.toJson(); + } + if (imageBoundingPolyDetails != null) { + _json['imageBoundingPolyDetails'] = imageBoundingPolyDetails.toJson(); + } + if (imageClassificationDetails != null) { + _json['imageClassificationDetails'] = imageClassificationDetails.toJson(); + } + if (imageOrientedBoundingBoxDetails != null) { + _json['imageOrientedBoundingBoxDetails'] = + imageOrientedBoundingBoxDetails.toJson(); + } + if (imagePolylineDetails != null) { + _json['imagePolylineDetails'] = imagePolylineDetails.toJson(); + } + if (imageSegmentationDetails != null) { + _json['imageSegmentationDetails'] = imageSegmentationDetails.toJson(); + } + if (partialFailures != null) { + _json['partialFailures'] = + partialFailures.map((value) => value.toJson()).toList(); + } + if (progressPercent != null) { + _json['progressPercent'] = progressPercent; + } + if (textClassificationDetails != null) { + _json['textClassificationDetails'] = textClassificationDetails.toJson(); + } + if (textEntityExtractionDetails != null) { + _json['textEntityExtractionDetails'] = + textEntityExtractionDetails.toJson(); + } + if (videoClassificationDetails != null) { + _json['videoClassificationDetails'] = videoClassificationDetails.toJson(); + } + if (videoEventDetails != null) { + _json['videoEventDetails'] = videoEventDetails.toJson(); + } + if (videoObjectDetectionDetails != null) { + _json['videoObjectDetectionDetails'] = + videoObjectDetectionDetails.toJson(); + } + if (videoObjectTrackingDetails != null) { + _json['videoObjectTrackingDetails'] = videoObjectTrackingDetails.toJson(); + } + return _json; + } +} + +/// Statistics about annotation specs. +class GoogleCloudDatalabelingV1p2alpha1LabelStats { + /// Map of each annotation spec's example count. + /// + /// Key is the annotation spec name and value is the number of examples for + /// that annotation spec. If the annotated dataset does not have annotation + /// spec, the map will return a pair where the key is empty string and value + /// is the total number of annotations. + core.Map<core.String, core.String> exampleCount; + + GoogleCloudDatalabelingV1p2alpha1LabelStats(); + + GoogleCloudDatalabelingV1p2alpha1LabelStats.fromJson(core.Map _json) { + if (_json.containsKey('exampleCount')) { + exampleCount = (_json['exampleCount'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exampleCount != null) { + _json['exampleCount'] = exampleCount; + } + return _json; + } +} + +/// Details of a LabelTextClassification operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelTextClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelTextClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelTextClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelTextEntityExtraction operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelTextEntityExtractionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelTextEntityExtractionOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelTextEntityExtractionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoClassification operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelVideoClassificationOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelVideoClassificationOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelVideoClassificationOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoEvent operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelVideoEventOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelVideoEventOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelVideoEventOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectDetection operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectDetectionOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectDetectionOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectDetectionOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// Details of a LabelVideoObjectTracking operation metadata. +class GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectTrackingOperationMetadata { + /// Basic human annotation config used in labeling request. + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig basicConfig; + + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectTrackingOperationMetadata(); + + GoogleCloudDatalabelingV1p2alpha1LabelVideoObjectTrackingOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('basicConfig')) { + basicConfig = + GoogleCloudDatalabelingV1p2alpha1HumanAnnotationConfig.fromJson( + _json['basicConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (basicConfig != null) { + _json['basicConfig'] = basicConfig.toJson(); + } + return _json; + } +} + +/// The configuration of output data. +class GoogleCloudDatalabelingV1p2alpha1OutputConfig { + /// Output to a file in Cloud Storage. + /// + /// Should be used for labeling output other than image segmentation. + GoogleCloudDatalabelingV1p2alpha1GcsDestination gcsDestination; + + /// Output to a folder in Cloud Storage. + /// + /// Should be used for image segmentation or document de-identification + /// labeling outputs. + GoogleCloudDatalabelingV1p2alpha1GcsFolderDestination gcsFolderDestination; + + GoogleCloudDatalabelingV1p2alpha1OutputConfig(); + + GoogleCloudDatalabelingV1p2alpha1OutputConfig.fromJson(core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = GoogleCloudDatalabelingV1p2alpha1GcsDestination.fromJson( + _json['gcsDestination'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('gcsFolderDestination')) { + gcsFolderDestination = + GoogleCloudDatalabelingV1p2alpha1GcsFolderDestination.fromJson( + _json['gcsFolderDestination'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination.toJson(); + } + if (gcsFolderDestination != null) { + _json['gcsFolderDestination'] = gcsFolderDestination.toJson(); + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<GoogleLongrunningOperation> operations; + + GoogleLongrunningListOperationsResponse(); + + GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<GoogleLongrunningOperation>((value) => + GoogleLongrunningOperation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class GoogleLongrunningOperation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + GoogleRpcStatus error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + GoogleLongrunningOperation(); + + GoogleLongrunningOperation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = GoogleRpcStatus.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class GoogleProtobufEmpty { + GoogleProtobufEmpty(); + + GoogleProtobufEmpty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class GoogleRpcStatus { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + GoogleRpcStatus(); + + GoogleRpcStatus.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/datamigration/v1beta1.dart b/generated/googleapis_beta/lib/datamigration/v1beta1.dart new file mode 100644 index 0000000..1619f09 --- /dev/null +++ b/generated/googleapis_beta/lib/datamigration/v1beta1.dart
@@ -0,0 +1,4450 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Database Migration API - v1beta1 +/// +/// Manage Cloud Database Migration Service resources on Google Cloud Platform. +/// +/// For more information, see <https://cloud.google.com/database-migration/> +/// +/// Create an instance of [DatabaseMigrationServiceApi] to access these +/// resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsConnectionProfilesResource] +/// - [ProjectsLocationsMigrationJobsResource] +/// - [ProjectsLocationsOperationsResource] +library datamigration.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Manage Cloud Database Migration Service resources on Google Cloud Platform. +class DatabaseMigrationServiceApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + DatabaseMigrationServiceApi(http.Client client, + {core.String rootUrl = 'https://datamigration.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsConnectionProfilesResource get connectionProfiles => + ProjectsLocationsConnectionProfilesResource(_requester); + ProjectsLocationsMigrationJobsResource get migrationJobs => + ProjectsLocationsMigrationJobsResource(_requester); + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsConnectionProfilesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsConnectionProfilesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new connection profile in a given project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent, which owns this collection of connection + /// profiles. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [connectionProfileId] - Required. The connection profile identifier. + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + ConnectionProfile request, + core.String parent, { + core.String connectionProfileId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (connectionProfileId != null) { + _queryParams['connectionProfileId'] = [connectionProfileId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/connectionProfiles'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a single Database Migration Service connection profile. + /// + /// A connection profile can only be deleted if it is not in use by any active + /// migration jobs. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the connection profile resource to delete. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [force] - In case of force delete, the CloudSQL replica database is also + /// deleted (only for CloudSQL connection profile). + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> delete( + core.String name, { + core.bool force, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (force != null) { + _queryParams['force'] = ['${force}']; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single connection profile. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the connection profile resource to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ConnectionProfile]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ConnectionProfile> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ConnectionProfile.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Retrieve a list of all connection profiles in a given project and + /// location. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent, which owns this collection of connection + /// profiles. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - A filter expression that filters connection profiles listed in + /// the response. The expression must specify the field name, a comparison + /// operator, and the value that you want to use for filtering. The value must + /// be a string, a number, or a boolean. The comparison operator must be + /// either =, !=, >, or <. For example, list connection profiles created this + /// year by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You + /// can also filter nested fields. For example, you could specify + /// **mySql.username = %lt;my_username%gt;** to list all connection profiles + /// configured to connect with a specific username. + /// + /// [orderBy] - the order by fields for the result. + /// + /// [pageSize] - The maximum number of connection profiles to return. The + /// service may return fewer than this value. If unspecified, at most 50 + /// connection profiles will be returned. The maximum value is 1000; values + /// above 1000 will be coerced to 1000. + /// + /// [pageToken] - A page token, received from a previous + /// `ListConnectionProfiles` call. Provide this to retrieve the subsequent + /// page. When paginating, all other parameters provided to + /// `ListConnectionProfiles` must match the call that provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListConnectionProfilesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListConnectionProfilesResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/connectionProfiles'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListConnectionProfilesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Update the configuration of a single connection profile. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The name of this connection profile resource in the form of + /// projects/{project}/locations/{location}/instances/{instance}. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [updateMask] - Required. Field mask is used to specify the fields to be + /// overwritten in the connection profile resource by the update. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + ConnectionProfile request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/connectionProfiles/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsMigrationJobsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsMigrationJobsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new migration job in a given project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent, which owns this collection of migration + /// jobs. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [migrationJobId] - Required. The ID of the instance to create. + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + MigrationJob request, + core.String parent, { + core.String migrationJobId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (migrationJobId != null) { + _queryParams['migrationJobId'] = [migrationJobId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/migrationJobs'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a single migration job. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the migration job resource to delete. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [force] - The destination CloudSQL connection profile is always deleted + /// with the migration job. In case of force delete, the destination CloudSQL + /// replica database is also deleted. + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> delete( + core.String name, { + core.bool force, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (force != null) { + _queryParams['force'] = ['${force}']; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Generate a SSH configuration script to configure the reverse SSH + /// connectivity. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [migrationJob] - Name of the migration job resource to generate the SSH + /// script. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SshScript]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SshScript> generateSshScript( + GenerateSshScriptRequest request, + core.String migrationJob, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (migrationJob == null) { + throw core.ArgumentError('Parameter migrationJob is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$migrationJob') + + ':generateSshScript'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SshScript.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single migration job. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the migration job resource to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [MigrationJob]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<MigrationJob> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + MigrationJob.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists migration jobs in a given project and location. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent, which owns this collection of + /// migrationJobs. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - A filter expression that filters migration jobs listed in the + /// response. The expression must specify the field name, a comparison + /// operator, and the value that you want to use for filtering. The value must + /// be a string, a number, or a boolean. The comparison operator must be + /// either =, !=, >, or <. For example, list migration jobs created this year + /// by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + /// also filter nested fields. For example, you could specify + /// **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration jobs + /// connecting through the specific SSH tunnel bastion. + /// + /// [orderBy] - Sort the results based on the migration job name. Valid values + /// are: "name", "name asc", and "name desc". + /// + /// [pageSize] - The maximum number of migration jobs to return. The service + /// may return fewer than this value. If unspecified, at most 50 migration + /// jobs will be returned. The maximum value is 1000; values above 1000 will + /// be coerced to 1000. + /// + /// [pageToken] - The nextPageToken value received in the previous call to + /// migrationJobs.list, used in the subsequent request to retrieve the next + /// page of results. On first call this should be left blank. When paginating, + /// all other parameters provided to migrationJobs.list must match the call + /// that provided the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListMigrationJobsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListMigrationJobsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/migrationJobs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListMigrationJobsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the parameters of a single migration job. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The name (URI) of this migration job resource, in the form of: + /// projects/{project}/locations/{location}/instances/{instance}. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [requestId] - A unique id used to identify the request. If the server + /// receives two requests with the same id, then the second request will be + /// ignored. It is recommended to always set this value to a UUID. The id must + /// contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + /// hyphens (-). The maximum length is 40 characters. + /// + /// [updateMask] - Required. Field mask is used to specify the fields to be + /// overwritten in the migration job resource by the update. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + MigrationJob request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Promote a migration job, stopping replication to the destination and + /// promoting the destination to be a standalone database. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to promote. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> promote( + PromoteMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':promote'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Restart a stopped or failed migration job, resetting the destination + /// instance to its original state and starting the migration process from + /// scratch. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to restart. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> restart( + RestartMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':restart'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Resume a migration job that is currently stopped and is resumable (was + /// stopped during CDC phase). + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to resume. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> resume( + ResumeMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':resume'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Start an already created migration job. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to start. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> start( + StartMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':start'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Stops a running migration job. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to stop. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> stop( + StopMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':stop'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Verify a migration job, making sure the destination can reach the source + /// and that all configuration and prerequisites are met. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Name of the migration job resource to verify. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/migrationJobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> verify( + VerifyMigrationJobRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':verify'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Starts asynchronous cancellation on a long-running operation. + /// + /// The server makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + /// or other methods to check whether the cancellation succeeded or whether + /// the operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with an + /// Operation.error value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be cancelled. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> cancel( + CancelOperationRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Specifies the audit configuration for a service. +/// +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. An AuditConfig must have one +/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` +/// and a specific service, the union of the two AuditConfigs is used for that +/// service: the log_types specified in each AuditConfig are enabled, and the +/// exempted_members in each AuditLogConfig are exempted. Example Policy with +/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", +/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ +/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": +/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", +/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": +/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +class AuditConfig { + /// The configuration for logging of each type of permission. + core.List<AuditLogConfig> auditLogConfigs; + + /// Specifies a service that will be enabled for audit logging. + /// + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + core.String service; + + AuditConfig(); + + AuditConfig.fromJson(core.Map _json) { + if (_json.containsKey('auditLogConfigs')) { + auditLogConfigs = (_json['auditLogConfigs'] as core.List) + .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('service')) { + service = _json['service'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditLogConfigs != null) { + _json['auditLogConfigs'] = + auditLogConfigs.map((value) => value.toJson()).toList(); + } + if (service != null) { + _json['service'] = service; + } + return _json; + } +} + +/// Provides the configuration for logging a type of permissions. +/// +/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", +/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": +/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while +/// exempting jose@example.com from DATA_READ logging. +class AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// + /// Follows the same format of Binding.members. + core.List<core.String> exemptedMembers; + + /// The log type that this config enables. + /// Possible string values are: + /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. + /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy + /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create + /// - "DATA_READ" : Data reads. Example: CloudSQL Users list + core.String logType; + + AuditLogConfig(); + + AuditLogConfig.fromJson(core.Map _json) { + if (_json.containsKey('exemptedMembers')) { + exemptedMembers = (_json['exemptedMembers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('logType')) { + logType = _json['logType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exemptedMembers != null) { + _json['exemptedMembers'] = exemptedMembers; + } + if (logType != null) { + _json['logType'] = logType; + } + return _json; + } +} + +/// Associates `members` with a `role`. +class Binding { + /// The condition that is associated with this binding. + /// + /// If the condition evaluates to `true`, then this binding applies to the + /// current request. If the condition evaluates to `false`, then this binding + /// does not apply to the current request. However, a different role binding + /// might grant the same role to one or more of the members in this binding. + /// To learn which resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition; + + /// Specifies the identities requesting access for a Cloud Platform resource. + /// + /// `members` can have the following values: * `allUsers`: A special + /// identifier that represents anyone who is on the internet; with or without + /// a Google account. * `allAuthenticatedUsers`: A special identifier that + /// represents anyone who is authenticated with a Google account or a service + /// account. * `user:{emailid}`: An email address that represents a specific + /// Google account. For example, `alice@example.com` . * + /// `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * + /// `group:{emailid}`: An email address that represents a Google group. For + /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a user that has + /// been recently deleted. For example, + /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, + /// this value reverts to `user:{emailid}` and the recovered user retains the + /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a service account + /// that has been recently deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If + /// the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email + /// address (plus unique identifier) representing a Google group that has been + /// recently deleted. For example, + /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, + /// this value reverts to `group:{emailid}` and the recovered group retains + /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) + /// that represents all the users of that domain. For example, `google.com` or + /// `example.com`. + core.List<core.String> members; + + /// Role that is assigned to `members`. + /// + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + core.String role; + + Binding(); + + Binding.fromJson(core.Map _json) { + if (_json.containsKey('condition')) { + condition = Expr.fromJson( + _json['condition'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('members')) { + members = (_json['members'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('role')) { + role = _json['role'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (condition != null) { + _json['condition'] = condition.toJson(); + } + if (members != null) { + _json['members'] = members; + } + if (role != null) { + _json['role'] = role; + } + return _json; + } +} + +/// The request message for Operations.CancelOperation. +class CancelOperationRequest { + CancelOperationRequest(); + + CancelOperationRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Specifies required connection parameters, and, optionally, the parameters +/// required to create a Cloud SQL destination database instance. +class CloudSqlConnectionProfile { + /// The Cloud SQL instance ID that this connection profile is associated with. + /// + /// Output only. + core.String cloudSqlId; + + /// The Cloud SQL database instance's private IP. + /// + /// Output only. + core.String privateIp; + + /// The Cloud SQL database instance's public IP. + /// + /// Output only. + core.String publicIp; + + /// Metadata used to create the destination Cloud SQL database. + /// + /// Immutable. + CloudSqlSettings settings; + + CloudSqlConnectionProfile(); + + CloudSqlConnectionProfile.fromJson(core.Map _json) { + if (_json.containsKey('cloudSqlId')) { + cloudSqlId = _json['cloudSqlId'] as core.String; + } + if (_json.containsKey('privateIp')) { + privateIp = _json['privateIp'] as core.String; + } + if (_json.containsKey('publicIp')) { + publicIp = _json['publicIp'] as core.String; + } + if (_json.containsKey('settings')) { + settings = CloudSqlSettings.fromJson( + _json['settings'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cloudSqlId != null) { + _json['cloudSqlId'] = cloudSqlId; + } + if (privateIp != null) { + _json['privateIp'] = privateIp; + } + if (publicIp != null) { + _json['publicIp'] = publicIp; + } + if (settings != null) { + _json['settings'] = settings.toJson(); + } + return _json; + } +} + +/// Settings for creating a Cloud SQL database instance. +class CloudSqlSettings { + /// The activation policy specifies when the instance is activated; it is + /// applicable only when the instance state is 'RUNNABLE'. + /// + /// Valid values: 'ALWAYS': The instance is on, and remains so even in the + /// absence of connection requests. `NEVER`: The instance is off; it is not + /// activated, even if a connection request arrives. + /// Possible string values are: + /// - "SQL_ACTIVATION_POLICY_UNSPECIFIED" : unspecified policy. + /// - "ALWAYS" : The instance is always up and running. + /// - "NEVER" : The instance should never spin up. + core.String activationPolicy; + + /// \[default: ON\] If you enable this setting, Cloud SQL checks your + /// available storage every 30 seconds. + /// + /// If the available storage falls below a threshold size, Cloud SQL + /// automatically adds additional storage capacity. If the available storage + /// repeatedly falls below the threshold size, Cloud SQL continues to add + /// storage until it reaches the maximum of 30 TB. + core.bool autoStorageIncrease; + + /// The storage capacity available to the database, in GB. + /// + /// The minimum (and default) size is 10GB. + core.String dataDiskSizeGb; + + /// The type of storage: `PD_SSD` (default) or `PD_HDD`. + /// Possible string values are: + /// - "SQL_DATA_DISK_TYPE_UNSPECIFIED" : Unspecified. + /// - "PD_SSD" : SSD disk. + /// - "PD_HDD" : HDD disk. + core.String dataDiskType; + + /// The database flags passed to the Cloud SQL instance at startup. + /// + /// An object containing a list of "key": value pairs. Example: { "name": + /// "wrench", "mass": "1.3kg", "count": "3" }. + core.Map<core.String, core.String> databaseFlags; + + /// The database engine type and version. + /// Possible string values are: + /// - "SQL_DATABASE_VERSION_UNSPECIFIED" : Unspecified version. + /// - "MYSQL_5_6" : MySQL 5.6. + /// - "MYSQL_5_7" : MySQL 5.7. + /// - "MYSQL_8_0" : MySQL 8.0. + core.String databaseVersion; + + /// The settings for IP Management. + /// + /// This allows to enable or disable the instance IP and manage which external + /// networks can connect to the instance. The IPv4 address cannot be disabled. + SqlIpConfig ipConfig; + + /// Input only. + /// + /// Initial root password. + core.String rootPassword; + + /// Indicates If this connection profile root password is stored. + /// + /// Output only. + core.bool rootPasswordSet; + + /// The Database Migration Service source connection profile ID, in the + /// format: + /// `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID` + core.String sourceId; + + /// The maximum size to which storage capacity can be automatically increased. + /// + /// The default value is 0, which specifies that there is no limit. + core.String storageAutoResizeLimit; + + /// The tier (or machine type) for this instance, for example: + /// `db-n1-standard-1` (MySQL instances). + /// + /// For more information, see + /// [Cloud SQL Instance Settings](https://cloud.google.com/sql/docs/mysql/instance-settings). + core.String tier; + + /// The resource labels for a Cloud SQL instance to use to annotate any + /// related underlying resources such as Compute Engine VMs. + /// + /// An object containing a list of "key": "value" pairs. Example: `{ "name": + /// "wrench", "mass": "18kg", "count": "3" }`. + core.Map<core.String, core.String> userLabels; + + /// The Google Cloud Platform zone where your Cloud SQL datdabse instance is + /// located. + core.String zone; + + CloudSqlSettings(); + + CloudSqlSettings.fromJson(core.Map _json) { + if (_json.containsKey('activationPolicy')) { + activationPolicy = _json['activationPolicy'] as core.String; + } + if (_json.containsKey('autoStorageIncrease')) { + autoStorageIncrease = _json['autoStorageIncrease'] as core.bool; + } + if (_json.containsKey('dataDiskSizeGb')) { + dataDiskSizeGb = _json['dataDiskSizeGb'] as core.String; + } + if (_json.containsKey('dataDiskType')) { + dataDiskType = _json['dataDiskType'] as core.String; + } + if (_json.containsKey('databaseFlags')) { + databaseFlags = (_json['databaseFlags'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('databaseVersion')) { + databaseVersion = _json['databaseVersion'] as core.String; + } + if (_json.containsKey('ipConfig')) { + ipConfig = SqlIpConfig.fromJson( + _json['ipConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rootPassword')) { + rootPassword = _json['rootPassword'] as core.String; + } + if (_json.containsKey('rootPasswordSet')) { + rootPasswordSet = _json['rootPasswordSet'] as core.bool; + } + if (_json.containsKey('sourceId')) { + sourceId = _json['sourceId'] as core.String; + } + if (_json.containsKey('storageAutoResizeLimit')) { + storageAutoResizeLimit = _json['storageAutoResizeLimit'] as core.String; + } + if (_json.containsKey('tier')) { + tier = _json['tier'] as core.String; + } + if (_json.containsKey('userLabels')) { + userLabels = (_json['userLabels'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('zone')) { + zone = _json['zone'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (activationPolicy != null) { + _json['activationPolicy'] = activationPolicy; + } + if (autoStorageIncrease != null) { + _json['autoStorageIncrease'] = autoStorageIncrease; + } + if (dataDiskSizeGb != null) { + _json['dataDiskSizeGb'] = dataDiskSizeGb; + } + if (dataDiskType != null) { + _json['dataDiskType'] = dataDiskType; + } + if (databaseFlags != null) { + _json['databaseFlags'] = databaseFlags; + } + if (databaseVersion != null) { + _json['databaseVersion'] = databaseVersion; + } + if (ipConfig != null) { + _json['ipConfig'] = ipConfig.toJson(); + } + if (rootPassword != null) { + _json['rootPassword'] = rootPassword; + } + if (rootPasswordSet != null) { + _json['rootPasswordSet'] = rootPasswordSet; + } + if (sourceId != null) { + _json['sourceId'] = sourceId; + } + if (storageAutoResizeLimit != null) { + _json['storageAutoResizeLimit'] = storageAutoResizeLimit; + } + if (tier != null) { + _json['tier'] = tier; + } + if (userLabels != null) { + _json['userLabels'] = userLabels; + } + if (zone != null) { + _json['zone'] = zone; + } + return _json; + } +} + +/// A connection profile definition. +class ConnectionProfile { + /// A CloudSQL database connection profile. + CloudSqlConnectionProfile cloudsql; + + /// The timestamp when the resource was created. + /// + /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + /// Example: "2014-10-02T15:01:23.045123456Z". + /// + /// Output only. + core.String createTime; + + /// The connection profile display name. + core.String displayName; + + /// The error details in case of state FAILED. + /// + /// Output only. + Status error; + + /// The resource labels for connection profile to use to annotate any related + /// underlying resources such as Compute Engine VMs. + /// + /// An object containing a list of "key": "value" pairs. Example: `{ "name": + /// "wrench", "mass": "1.3kg", "count": "3" }`. + core.Map<core.String, core.String> labels; + + /// A MySQL database connection profile. + MySqlConnectionProfile mysql; + + /// The name of this connection profile resource in the form of + /// projects/{project}/locations/{location}/instances/{instance}. + core.String name; + + /// The database provider. + /// Possible string values are: + /// - "DATABASE_PROVIDER_UNSPECIFIED" : The database provider is unknown. + /// - "CLOUDSQL" : CloudSQL runs the database. + /// - "RDS" : RDS runs the database. + core.String provider; + + /// The current connection profile state (e.g. DRAFT, READY, or FAILED). + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state of the connection profile is unknown. + /// - "DRAFT" : The connection profile is in draft mode and fully editable. + /// - "CREATING" : The connection profile is being created. + /// - "READY" : The connection profile is ready. + /// - "UPDATING" : The connection profile is being updated. + /// - "DELETING" : The connection profile is being deleted. + /// - "DELETED" : The connection profile has been deleted. + /// - "FAILED" : The last action on the connection profile failed. + core.String state; + + /// The timestamp when the resource was last updated. + /// + /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + /// Example: "2014-10-02T15:01:23.045123456Z". + /// + /// Output only. + core.String updateTime; + + ConnectionProfile(); + + ConnectionProfile.fromJson(core.Map _json) { + if (_json.containsKey('cloudsql')) { + cloudsql = CloudSqlConnectionProfile.fromJson( + _json['cloudsql'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('mysql')) { + mysql = MySqlConnectionProfile.fromJson( + _json['mysql'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('provider')) { + provider = _json['provider'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cloudsql != null) { + _json['cloudsql'] = cloudsql.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (labels != null) { + _json['labels'] = labels; + } + if (mysql != null) { + _json['mysql'] = mysql.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (provider != null) { + _json['provider'] = provider; + } + if (state != null) { + _json['state'] = state; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A message defining the database engine and provider. +class DatabaseType { + /// The database engine. + /// Possible string values are: + /// - "DATABASE_ENGINE_UNSPECIFIED" : The source database engine of the + /// migration job is unknown. + /// - "MYSQL" : The source engine is MySQL. + core.String engine; + + /// The database provider. + /// Possible string values are: + /// - "DATABASE_PROVIDER_UNSPECIFIED" : The database provider is unknown. + /// - "CLOUDSQL" : CloudSQL runs the database. + /// - "RDS" : RDS runs the database. + core.String provider; + + DatabaseType(); + + DatabaseType.fromJson(core.Map _json) { + if (_json.containsKey('engine')) { + engine = _json['engine'] as core.String; + } + if (_json.containsKey('provider')) { + provider = _json['provider'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (engine != null) { + _json['engine'] = engine; + } + if (provider != null) { + _json['provider'] = provider; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. +/// +/// CEL is a C-like expression language. The syntax and semantics of CEL are +/// documented at https://github.com/google/cel-spec. Example (Comparison): +/// title: "Summary size limit" description: "Determines if a summary is less +/// than 100 chars" expression: "document.summary.size() < 100" Example +/// (Equality): title: "Requestor is owner" description: "Determines if +/// requestor is the document owner" expression: "document.owner == +/// request.auth.claims.email" Example (Logic): title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): title: "Notification string" description: +/// "Create a notification string with a timestamp." expression: "'New message +/// received at ' + string(document.create_time)" The exact variables and +/// functions that may be referenced within an expression are determined by the +/// service that evaluates it. See the service documentation for additional +/// information. +class Expr { + /// Description of the expression. + /// + /// This is a longer text which describes the expression, e.g. when hovered + /// over it in a UI. + /// + /// Optional. + core.String description; + + /// Textual representation of an expression in Common Expression Language + /// syntax. + core.String expression; + + /// String indicating the location of the expression for error reporting, e.g. + /// a file name and a position in the file. + /// + /// Optional. + core.String location; + + /// Title for the expression, i.e. a short string describing its purpose. + /// + /// This can be used e.g. in UIs which allow to enter the expression. + /// + /// Optional. + core.String title; + + Expr(); + + Expr.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('location')) { + location = _json['location'] as core.String; + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (location != null) { + _json['location'] = location; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// Request message for 'GenerateSshScript' request. +class GenerateSshScriptRequest { + /// Bastion VM Instance name to use or to create. + /// + /// Required. + core.String vm; + + /// The VM creation configuration + VmCreationConfig vmCreationConfig; + + /// The port that will be open on the bastion host + core.int vmPort; + + /// The VM selection configuration + VmSelectionConfig vmSelectionConfig; + + GenerateSshScriptRequest(); + + GenerateSshScriptRequest.fromJson(core.Map _json) { + if (_json.containsKey('vm')) { + vm = _json['vm'] as core.String; + } + if (_json.containsKey('vmCreationConfig')) { + vmCreationConfig = VmCreationConfig.fromJson( + _json['vmCreationConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('vmPort')) { + vmPort = _json['vmPort'] as core.int; + } + if (_json.containsKey('vmSelectionConfig')) { + vmSelectionConfig = VmSelectionConfig.fromJson( + _json['vmSelectionConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vm != null) { + _json['vm'] = vm; + } + if (vmCreationConfig != null) { + _json['vmCreationConfig'] = vmCreationConfig.toJson(); + } + if (vmPort != null) { + _json['vmPort'] = vmPort; + } + if (vmSelectionConfig != null) { + _json['vmSelectionConfig'] = vmSelectionConfig.toJson(); + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +class GoogleCloudClouddmsV1beta1OperationMetadata { + /// API version used to start the operation. + /// + /// Output only. + core.String apiVersion; + + /// The time the operation was created. + /// + /// Output only. + core.String createTime; + + /// The time the operation finished running. + /// + /// Output only. + core.String endTime; + + /// Identifies whether the user has requested cancellation of the operation. + /// + /// Operations that have successfully been cancelled have Operation.error + /// value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// Output only. + core.bool requestedCancellation; + + /// Human-readable status of the operation, if any. + /// + /// Output only. + core.String statusMessage; + + /// Server-defined resource path for the target of the operation. + /// + /// Output only. + core.String target; + + /// Name of the verb executed by the operation. + /// + /// Output only. + core.String verb; + + GoogleCloudClouddmsV1beta1OperationMetadata(); + + GoogleCloudClouddmsV1beta1OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('requestedCancellation')) { + requestedCancellation = _json['requestedCancellation'] as core.bool; + } + if (_json.containsKey('statusMessage')) { + statusMessage = _json['statusMessage'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (requestedCancellation != null) { + _json['requestedCancellation'] = requestedCancellation; + } + if (statusMessage != null) { + _json['statusMessage'] = statusMessage; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// Response message for 'ListConnectionProfiles' request. +class ListConnectionProfilesResponse { + /// The response list of connection profiles. + core.List<ConnectionProfile> connectionProfiles; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListConnectionProfilesResponse(); + + ListConnectionProfilesResponse.fromJson(core.Map _json) { + if (_json.containsKey('connectionProfiles')) { + connectionProfiles = (_json['connectionProfiles'] as core.List) + .map<ConnectionProfile>((value) => ConnectionProfile.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (connectionProfiles != null) { + _json['connectionProfiles'] = + connectionProfiles.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for 'ListMigrationJobs' request. +class ListMigrationJobsResponse { + /// The list of migration jobs objects. + core.List<MigrationJob> migrationJobs; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListMigrationJobsResponse(); + + ListMigrationJobsResponse.fromJson(core.Map _json) { + if (_json.containsKey('migrationJobs')) { + migrationJobs = (_json['migrationJobs'] as core.List) + .map<MigrationJob>((value) => MigrationJob.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (migrationJobs != null) { + _json['migrationJobs'] = + migrationJobs.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class ListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<Operation> operations; + + ListOperationsResponse(); + + ListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Represents a Database Migration Service migration job object. +class MigrationJob { + /// The timestamp when the migration job resource was created. + /// + /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + /// Example: "2014-10-02T15:01:23.045123456Z". + /// + /// Output only. + core.String createTime; + + /// The resource name (URI) of the destination connection profile. + /// + /// Required. + core.String destination; + + /// The database engine type and provider of the destination. + DatabaseType destinationDatabase; + + /// The migration job display name. + core.String displayName; + + /// The path to the dump file in Google Cloud Storage, in the format: + /// (gs://\[BUCKET_NAME\]/\[OBJECT_NAME\]). + core.String dumpPath; + + /// The duration of the migration job (in seconds). + /// + /// A duration in seconds with up to nine fractional digits, terminated by + /// 's'. Example: "3.5s". + /// + /// Output only. + core.String duration; + + /// If the migration job is completed, the time when it was completed. + /// + /// Output only. + core.String endTime; + + /// The error details in case of state FAILED. + /// + /// Output only. + Status error; + + /// The resource labels for migration job to use to annotate any related + /// underlying resources such as Compute Engine VMs. + /// + /// An object containing a list of "key": "value" pairs. Example: `{ "name": + /// "wrench", "mass": "1.3kg", "count": "3" }`. + core.Map<core.String, core.String> labels; + + /// The name (URI) of this migration job resource, in the form of: + /// projects/{project}/locations/{location}/instances/{instance}. + core.String name; + + /// The current migration job phase. + /// + /// Output only. + /// Possible string values are: + /// - "PHASE_UNSPECIFIED" : The phase of the migration job is unknown. + /// - "FULL_DUMP" : The migration job is in the full dump phase. + /// - "CDC" : The migration job is CDC phase. + /// - "PROMOTE_IN_PROGRESS" : The migration job is running the promote phase. + /// - "WAITING_FOR_SOURCE_WRITES_TO_STOP" : Only RDS flow - waiting for source + /// writes to stop + /// - "PREPARING_THE_DUMP" : Only RDS flow - the sources writes stopped, + /// waiting for dump to begin + core.String phase; + + /// The details needed to communicate to the source over Reverse SSH tunnel + /// connectivity. + ReverseSshConnectivity reverseSshConnectivity; + + /// The resource name (URI) of the source connection profile. + /// + /// Required. + core.String source; + + /// The database engine type and provider of the source. + DatabaseType sourceDatabase; + + /// The current migration job state. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state of the migration job is unknown. + /// - "MAINTENANCE" : The migration job is down for maintenance. + /// - "DRAFT" : The migration job is in draft mode and no resources are + /// created. + /// - "CREATING" : The migration job is being created. + /// - "NOT_STARTED" : The migration job is created, not started and is fully + /// editable. + /// - "RUNNING" : The migration job is running. + /// - "FAILED" : The migration job failed. + /// - "COMPLETED" : The migration job has been completed. + /// - "DELETING" : The migration job is being deleted. + /// - "STOPPING" : The migration job is being stopped. + /// - "STOPPED" : The migration job is currently stopped. + /// - "DELETED" : The migration job has been deleted. + /// - "UPDATING" : The migration job is being updated. + /// - "STARTING" : The migration job is starting. + /// - "RESTARTING" : The migration job is restarting. + /// - "RESUMING" : The migration job is resuming. + core.String state; + + /// static ip connectivity data (default, no additional details needed). + StaticIpConnectivity staticIpConnectivity; + + /// The migration job type. + /// + /// Required. + /// Possible string values are: + /// - "TYPE_UNSPECIFIED" : The type of the migration job is unknown. + /// - "ONE_TIME" : The migration job is a one time migration. + /// - "CONTINUOUS" : The migration job is a continuous migration. + core.String type; + + /// The timestamp when the migration job resource was last updated. + /// + /// A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + /// Example: "2014-10-02T15:01:23.045123456Z". + /// + /// Output only. + core.String updateTime; + + /// The details of the VPC network that the source database is located in. + VpcPeeringConnectivity vpcPeeringConnectivity; + + MigrationJob(); + + MigrationJob.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('destination')) { + destination = _json['destination'] as core.String; + } + if (_json.containsKey('destinationDatabase')) { + destinationDatabase = DatabaseType.fromJson( + _json['destinationDatabase'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('dumpPath')) { + dumpPath = _json['dumpPath'] as core.String; + } + if (_json.containsKey('duration')) { + duration = _json['duration'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('phase')) { + phase = _json['phase'] as core.String; + } + if (_json.containsKey('reverseSshConnectivity')) { + reverseSshConnectivity = ReverseSshConnectivity.fromJson( + _json['reverseSshConnectivity'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('source')) { + source = _json['source'] as core.String; + } + if (_json.containsKey('sourceDatabase')) { + sourceDatabase = DatabaseType.fromJson( + _json['sourceDatabase'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('staticIpConnectivity')) { + staticIpConnectivity = StaticIpConnectivity.fromJson( + _json['staticIpConnectivity'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + if (_json.containsKey('vpcPeeringConnectivity')) { + vpcPeeringConnectivity = VpcPeeringConnectivity.fromJson( + _json['vpcPeeringConnectivity'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (destination != null) { + _json['destination'] = destination; + } + if (destinationDatabase != null) { + _json['destinationDatabase'] = destinationDatabase.toJson(); + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (dumpPath != null) { + _json['dumpPath'] = dumpPath; + } + if (duration != null) { + _json['duration'] = duration; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (phase != null) { + _json['phase'] = phase; + } + if (reverseSshConnectivity != null) { + _json['reverseSshConnectivity'] = reverseSshConnectivity.toJson(); + } + if (source != null) { + _json['source'] = source; + } + if (sourceDatabase != null) { + _json['sourceDatabase'] = sourceDatabase.toJson(); + } + if (state != null) { + _json['state'] = state; + } + if (staticIpConnectivity != null) { + _json['staticIpConnectivity'] = staticIpConnectivity.toJson(); + } + if (type != null) { + _json['type'] = type; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + if (vpcPeeringConnectivity != null) { + _json['vpcPeeringConnectivity'] = vpcPeeringConnectivity.toJson(); + } + return _json; + } +} + +/// Error message of a verification Migration job. +class MigrationJobVerificationError { + /// An instance of ErrorCode specifying the error that occurred. + /// + /// Output only. + /// Possible string values are: + /// - "ERROR_CODE_UNSPECIFIED" : An unknown error occurred + /// - "CONNECTION_FAILURE" : We failed to connect to one of the connection + /// profile. + /// - "AUTHENTICATION_FAILURE" : We failed to authenticate to one of the + /// connection profile. + /// - "INVALID_CONNECTION_PROFILE_CONFIG" : One of the involved connection + /// profiles has an invalid configuration. + /// - "VERSION_INCOMPATIBILITY" : The versions of the source and the + /// destination are incompatible. + /// - "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY" : The types of the source and + /// the destination are incompatible. + /// - "UNSUPPORTED_GTID_MODE" : The gtid_mode is not supported, applicable for + /// MySQL. + /// - "UNSUPPORTED_DEFINER" : The definer is not supported. + core.String errorCode; + + /// A specific detailed error message, if supplied by the engine. + /// + /// Output only. + core.String errorDetailMessage; + + /// A formatted message with further details about the error and a CTA. + /// + /// Output only. + core.String errorMessage; + + MigrationJobVerificationError(); + + MigrationJobVerificationError.fromJson(core.Map _json) { + if (_json.containsKey('errorCode')) { + errorCode = _json['errorCode'] as core.String; + } + if (_json.containsKey('errorDetailMessage')) { + errorDetailMessage = _json['errorDetailMessage'] as core.String; + } + if (_json.containsKey('errorMessage')) { + errorMessage = _json['errorMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (errorCode != null) { + _json['errorCode'] = errorCode; + } + if (errorDetailMessage != null) { + _json['errorDetailMessage'] = errorDetailMessage; + } + if (errorMessage != null) { + _json['errorMessage'] = errorMessage; + } + return _json; + } +} + +/// Specifies connection parameters required specifically for MySQL databases. +class MySqlConnectionProfile { + /// If the source is a Cloud SQL database, use this field to provide the Cloud + /// SQL instance ID of the source. + core.String cloudSqlId; + + /// The IP or hostname of the source MySQL database. + /// + /// Required. + core.String host; + + /// Input only. + /// + /// The password for the user that Database Migration Service will be using to + /// connect to the database. This field is not returned on request, and the + /// value is encrypted when stored in Database Migration Service. + /// + /// Required. + core.String password; + + /// Indicates If this connection profile password is stored. + /// + /// Output only. + core.bool passwordSet; + + /// The network port of the source MySQL database. + /// + /// Required. + core.int port; + + /// SSL configuration for the destination to connect to the source database. + SslConfig ssl; + + /// The username that Database Migration Service will use to connect to the + /// database. + /// + /// The value is encrypted when stored in Database Migration Service. + /// + /// Required. + core.String username; + + MySqlConnectionProfile(); + + MySqlConnectionProfile.fromJson(core.Map _json) { + if (_json.containsKey('cloudSqlId')) { + cloudSqlId = _json['cloudSqlId'] as core.String; + } + if (_json.containsKey('host')) { + host = _json['host'] as core.String; + } + if (_json.containsKey('password')) { + password = _json['password'] as core.String; + } + if (_json.containsKey('passwordSet')) { + passwordSet = _json['passwordSet'] as core.bool; + } + if (_json.containsKey('port')) { + port = _json['port'] as core.int; + } + if (_json.containsKey('ssl')) { + ssl = SslConfig.fromJson( + _json['ssl'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('username')) { + username = _json['username'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cloudSqlId != null) { + _json['cloudSqlId'] = cloudSqlId; + } + if (host != null) { + _json['host'] = host; + } + if (password != null) { + _json['password'] = password; + } + if (passwordSet != null) { + _json['passwordSet'] = passwordSet; + } + if (port != null) { + _json['port'] = port; + } + if (ssl != null) { + _json['ssl'] = ssl.toJson(); + } + if (username != null) { + _json['username'] = username; + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class Operation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + Status error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service +/// accounts, Google groups, and domains (such as G Suite). A `role` is a named +/// list of permissions; each `role` can be an IAM predefined role or a +/// user-created custom role. For some types of Google Cloud resources, a +/// `binding` can also specify a `condition`, which is a logical expression that +/// allows access to a resource only if the expression evaluates to `true`. A +/// condition can add constraints based on attributes of the request, the +/// resource, or both. To learn which resources support conditions in their IAM +/// policies, see the +/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +/// **JSON example:** { "bindings": \[ { "role": +/// "roles/resourcemanager.organizationAdmin", "members": \[ +/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": +/// "roles/resourcemanager.organizationViewer", "members": \[ +/// "user:eve@example.com" \], "condition": { "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", "expression": +/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": +/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - +/// user:mike@example.com - group:admins@example.com - domain:google.com - +/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer condition: title: expirable +/// access description: Does not grant access after Sep 2020 expression: +/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - +/// version: 3 For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +class Policy { + /// Specifies cloud audit logging configuration for this policy. + core.List<AuditConfig> auditConfigs; + + /// Associates a list of `members` to a `role`. + /// + /// Optionally, may specify a `condition` that determines how and when the + /// `bindings` are applied. Each of the `bindings` must contain at least one + /// member. + core.List<Binding> bindings; + + /// `etag` is used for optimistic concurrency control as a way to help prevent + /// simultaneous updates of a policy from overwriting each other. + /// + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the + /// policy. **Important:** If you use IAM Conditions, you must include the + /// `etag` field whenever you call `setIamPolicy`. If you omit this field, + /// then IAM allows you to overwrite a version `3` policy with a version `1` + /// policy, and all of the conditions in the version `3` policy are lost. + core.String etag; + core.List<core.int> get etagAsBytes => convert.base64.decode(etag); + + set etagAsBytes(core.List<core.int> _bytes) { + etag = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. Any operation that affects conditional role bindings must + /// specify version `3`. This requirement applies to the following operations: + /// * Getting a policy that includes a conditional role binding * Adding a + /// conditional role binding to a policy * Changing a conditional role binding + /// in a policy * Removing any role binding, with or without a condition, from + /// a policy that includes conditions **Important:** If you use IAM + /// Conditions, you must include the `etag` field whenever you call + /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a + /// version `3` policy with a version `1` policy, and all of the conditions in + /// the version `3` policy are lost. If a policy does not include any + /// conditions, operations on that policy may specify any valid version or + /// leave the field unset. To learn which resources support conditions in + /// their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + core.int version; + + Policy(); + + Policy.fromJson(core.Map _json) { + if (_json.containsKey('auditConfigs')) { + auditConfigs = (_json['auditConfigs'] as core.List) + .map<AuditConfig>((value) => AuditConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('bindings')) { + bindings = (_json['bindings'] as core.List) + .map<Binding>((value) => + Binding.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('etag')) { + etag = _json['etag'] as core.String; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditConfigs != null) { + _json['auditConfigs'] = + auditConfigs.map((value) => value.toJson()).toList(); + } + if (bindings != null) { + _json['bindings'] = bindings.map((value) => value.toJson()).toList(); + } + if (etag != null) { + _json['etag'] = etag; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// Request message for 'PromoteMigrationJob' request. +class PromoteMigrationJobRequest { + PromoteMigrationJobRequest(); + + PromoteMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for 'RestartMigrationJob' request. +class RestartMigrationJobRequest { + RestartMigrationJobRequest(); + + RestartMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for 'ResumeMigrationJob' request. +class ResumeMigrationJobRequest { + ResumeMigrationJobRequest(); + + ResumeMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The details needed to configure a reverse SSH tunnel between the source and +/// destination databases. +/// +/// These details will be used when calling the generateSshScript method (see +/// https://cloud.google.com/database-migration/docs/reference/rest/v1beta1/projects.locations.migrationJobs/generateSshScript) +/// to produce the script that will help set up the reverse SSH tunnel, and to +/// set up the VPC peering between the Cloud SQL private network and the VPC. +class ReverseSshConnectivity { + /// The name of the virtual machine (Compute Engine) used as the bastion + /// server for the SSH tunnel. + core.String vm; + + /// The IP of the virtual machine (Compute Engine) used as the bastion server + /// for the SSH tunnel. + /// + /// Required. + core.String vmIp; + + /// The forwarding port of the virtual machine (Compute Engine) used as the + /// bastion server for the SSH tunnel. + /// + /// Required. + core.int vmPort; + + /// The name of the VPC to peer with the Cloud SQL private network. + core.String vpc; + + ReverseSshConnectivity(); + + ReverseSshConnectivity.fromJson(core.Map _json) { + if (_json.containsKey('vm')) { + vm = _json['vm'] as core.String; + } + if (_json.containsKey('vmIp')) { + vmIp = _json['vmIp'] as core.String; + } + if (_json.containsKey('vmPort')) { + vmPort = _json['vmPort'] as core.int; + } + if (_json.containsKey('vpc')) { + vpc = _json['vpc'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vm != null) { + _json['vm'] = vm; + } + if (vmIp != null) { + _json['vmIp'] = vmIp; + } + if (vmPort != null) { + _json['vmPort'] = vmPort; + } + if (vpc != null) { + _json['vpc'] = vpc; + } + return _json; + } +} + +/// Request message for `SetIamPolicy` method. +class SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. + /// + /// The size of the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) might + /// reject them. + Policy policy; + + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. + /// + /// Only the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: `paths: "bindings, etag"` + core.String updateMask; + + SetIamPolicyRequest(); + + SetIamPolicyRequest.fromJson(core.Map _json) { + if (_json.containsKey('policy')) { + policy = Policy.fromJson( + _json['policy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (policy != null) { + _json['policy'] = policy.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// An entry for an Access Control list. +class SqlAclEntry { + /// The time when this access control entry expires in + /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example: + /// `2012-11-15T16:19:00.094Z`. + core.String expireTime; + + /// A label to identify this entry. + core.String label; + + /// Input only. + /// + /// The time-to-leave of this access control entry. + core.String ttl; + + /// The allowlisted value for the access control list. + core.String value; + + SqlAclEntry(); + + SqlAclEntry.fromJson(core.Map _json) { + if (_json.containsKey('expireTime')) { + expireTime = _json['expireTime'] as core.String; + } + if (_json.containsKey('label')) { + label = _json['label'] as core.String; + } + if (_json.containsKey('ttl')) { + ttl = _json['ttl'] as core.String; + } + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (expireTime != null) { + _json['expireTime'] = expireTime; + } + if (label != null) { + _json['label'] = label; + } + if (ttl != null) { + _json['ttl'] = ttl; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// IP Management configuration. +class SqlIpConfig { + /// The list of external networks that are allowed to connect to the instance + /// using the IP. + /// + /// See https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation, also known + /// as 'slash' notation (e.g. `192.168.100.0/24`). + core.List<SqlAclEntry> authorizedNetworks; + + /// Whether the instance should be assigned an IPv4 address or not. + core.bool enableIpv4; + + /// The resource link for the VPC network from which the Cloud SQL instance is + /// accessible for private IP. + /// + /// For example, `/projects/myProject/global/networks/default`. This setting + /// can be updated, but it cannot be removed after it is set. + core.String privateNetwork; + + /// Whether SSL connections over IP should be enforced or not. + core.bool requireSsl; + + SqlIpConfig(); + + SqlIpConfig.fromJson(core.Map _json) { + if (_json.containsKey('authorizedNetworks')) { + authorizedNetworks = (_json['authorizedNetworks'] as core.List) + .map<SqlAclEntry>((value) => SqlAclEntry.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('enableIpv4')) { + enableIpv4 = _json['enableIpv4'] as core.bool; + } + if (_json.containsKey('privateNetwork')) { + privateNetwork = _json['privateNetwork'] as core.String; + } + if (_json.containsKey('requireSsl')) { + requireSsl = _json['requireSsl'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (authorizedNetworks != null) { + _json['authorizedNetworks'] = + authorizedNetworks.map((value) => value.toJson()).toList(); + } + if (enableIpv4 != null) { + _json['enableIpv4'] = enableIpv4; + } + if (privateNetwork != null) { + _json['privateNetwork'] = privateNetwork; + } + if (requireSsl != null) { + _json['requireSsl'] = requireSsl; + } + return _json; + } +} + +/// Response message for 'GenerateSshScript' request. +class SshScript { + /// The ssh configuration script. + core.String script; + + SshScript(); + + SshScript.fromJson(core.Map _json) { + if (_json.containsKey('script')) { + script = _json['script'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (script != null) { + _json['script'] = script; + } + return _json; + } +} + +/// SSL configuration information. +class SslConfig { + /// Input only. + /// + /// The x509 PEM-encoded certificate of the CA that signed the source database + /// server's certificate. The replica will use this certificate to verify it's + /// connecting to the right host. + /// + /// Required. + core.String caCertificate; + + /// Input only. + /// + /// The x509 PEM-encoded certificate that will be used by the replica to + /// authenticate against the source database server.If this field is used then + /// the 'client_key' field is mandatory. + core.String clientCertificate; + + /// Input only. + /// + /// The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with + /// the Client Certificate. If this field is used then the + /// 'client_certificate' field is mandatory. + core.String clientKey; + + /// The ssl config type according to 'client_key', 'client_certificate' and + /// 'ca_certificate'. + /// + /// Output only. + /// Possible string values are: + /// - "SSL_TYPE_UNSPECIFIED" : Unspecified. + /// - "SERVER_ONLY" : Only 'ca_certificate' specified. + /// - "SERVER_CLIENT" : Both server ('ca_certificate'), and client + /// ('client_key', 'client_certificate') specified. + core.String type; + + SslConfig(); + + SslConfig.fromJson(core.Map _json) { + if (_json.containsKey('caCertificate')) { + caCertificate = _json['caCertificate'] as core.String; + } + if (_json.containsKey('clientCertificate')) { + clientCertificate = _json['clientCertificate'] as core.String; + } + if (_json.containsKey('clientKey')) { + clientKey = _json['clientKey'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (caCertificate != null) { + _json['caCertificate'] = caCertificate; + } + if (clientCertificate != null) { + _json['clientCertificate'] = clientCertificate; + } + if (clientKey != null) { + _json['clientKey'] = clientKey; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Request message for 'StartMigrationJob' request. +class StartMigrationJobRequest { + StartMigrationJobRequest(); + + StartMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The source database will allow incoming connections from the destination +/// database's public IP. +/// +/// You can retrieve the Cloud SQL instance's public IP from the Cloud SQL +/// console or using Cloud SQL APIs. No additional configuration is required. +class StaticIpConnectivity { + StaticIpConnectivity(); + + StaticIpConnectivity.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class Status { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + Status(); + + Status.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// Request message for 'StopMigrationJob' request. +class StopMigrationJobRequest { + StopMigrationJobRequest(); + + StopMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for `TestIamPermissions` method. +class TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. + /// + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// For more information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + core.List<core.String> permissions; + + TestIamPermissionsRequest(); + + TestIamPermissionsRequest.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Response message for `TestIamPermissions` method. +class TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + core.List<core.String> permissions; + + TestIamPermissionsResponse(); + + TestIamPermissionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Request message for 'VerifyMigrationJob' request. +class VerifyMigrationJobRequest { + VerifyMigrationJobRequest(); + + VerifyMigrationJobRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// VM creation configuration message +class VmCreationConfig { + /// The subnet name the vm needs to be created in. + core.String subnet; + + /// VM instance machine type to create. + /// + /// Required. + core.String vmMachineType; + + /// The Google Cloud Platform zone to create the VM in. + core.String vmZone; + + VmCreationConfig(); + + VmCreationConfig.fromJson(core.Map _json) { + if (_json.containsKey('subnet')) { + subnet = _json['subnet'] as core.String; + } + if (_json.containsKey('vmMachineType')) { + vmMachineType = _json['vmMachineType'] as core.String; + } + if (_json.containsKey('vmZone')) { + vmZone = _json['vmZone'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (subnet != null) { + _json['subnet'] = subnet; + } + if (vmMachineType != null) { + _json['vmMachineType'] = vmMachineType; + } + if (vmZone != null) { + _json['vmZone'] = vmZone; + } + return _json; + } +} + +/// VM selection configuration message +class VmSelectionConfig { + /// The Google Cloud Platform zone the VM is located. + /// + /// Required. + core.String vmZone; + + VmSelectionConfig(); + + VmSelectionConfig.fromJson(core.Map _json) { + if (_json.containsKey('vmZone')) { + vmZone = _json['vmZone'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vmZone != null) { + _json['vmZone'] = vmZone; + } + return _json; + } +} + +/// The details of the VPC where the source database is located in Google Cloud. +/// +/// We will use this information to set up the VPC peering connection between +/// Cloud SQL and this VPC. +class VpcPeeringConnectivity { + /// The name of the VPC network to peer with the Cloud SQL private network. + core.String vpc; + + VpcPeeringConnectivity(); + + VpcPeeringConnectivity.fromJson(core.Map _json) { + if (_json.containsKey('vpc')) { + vpc = _json['vpc'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (vpc != null) { + _json['vpc'] = vpc; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/dialogflow/v2beta1.dart b/generated/googleapis_beta/lib/dialogflow/v2beta1.dart deleted file mode 100644 index 978f7ba..0000000 --- a/generated/googleapis_beta/lib/dialogflow/v2beta1.dart +++ /dev/null
@@ -1,21611 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Dialogflow API - v2beta1 -/// -/// Builds conversational interfaces (for example, chatbots, and voice-powered -/// apps and devices). -/// -/// For more information, see <https://cloud.google.com/dialogflow/> -/// -/// Create an instance of [DialogflowApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsAgentResource] -/// - [ProjectsAgentEntityTypesResource] -/// - [ProjectsAgentEntityTypesEntitiesResource] -/// - [ProjectsAgentEnvironmentsResource] -/// - [ProjectsAgentEnvironmentsUsersResource] -/// - [ProjectsAgentEnvironmentsUsersSessionsResource] -/// - [ProjectsAgentEnvironmentsUsersSessionsContextsResource] -/// - [ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource] -/// - [ProjectsAgentIntentsResource] -/// - [ProjectsAgentKnowledgeBasesResource] -/// - [ProjectsAgentKnowledgeBasesDocumentsResource] -/// - [ProjectsAgentSessionsResource] -/// - [ProjectsAgentSessionsContextsResource] -/// - [ProjectsAgentSessionsEntityTypesResource] -/// - [ProjectsKnowledgeBasesResource] -/// - [ProjectsKnowledgeBasesDocumentsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsAgentResource] -/// - [ProjectsLocationsAgentEntityTypesResource] -/// - [ProjectsLocationsAgentEntityTypesEntitiesResource] -/// - [ProjectsLocationsAgentEnvironmentsResource] -/// - [ProjectsLocationsAgentEnvironmentsUsersResource] -/// - [ProjectsLocationsAgentEnvironmentsUsersSessionsResource] -/// - [ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource] -/// - [ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource] -/// - [ProjectsLocationsAgentIntentsResource] -/// - [ProjectsLocationsAgentSessionsResource] -/// - [ProjectsLocationsAgentSessionsContextsResource] -/// - [ProjectsLocationsAgentSessionsEntityTypesResource] -/// - [ProjectsLocationsOperationsResource] -/// - [ProjectsOperationsResource] -library dialogflow.v2beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Builds conversational interfaces (for example, chatbots, and voice-powered -/// apps and devices). -class DialogflowApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View, manage and query your Dialogflow agents - static const dialogflowScope = 'https://www.googleapis.com/auth/dialogflow'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - DialogflowApi(http.Client client, - {core.String rootUrl = 'https://dialogflow.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsAgentResource get agent => ProjectsAgentResource(_requester); - ProjectsKnowledgeBasesResource get knowledgeBases => - ProjectsKnowledgeBasesResource(_requester); - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - ProjectsOperationsResource get operations => - ProjectsOperationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; - - /// Deletes the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to delete is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteAgent( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to fetch is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Agent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Agent> getAgent( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Agent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates/updates the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project of this agent. Format: `projects/` or - /// `projects//locations/` - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Agent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Agent> setAgent( - GoogleCloudDialogflowV2beta1Agent request, - core.String parent, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Agent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentResource { - final commons.ApiRequester _requester; - - ProjectsAgentEntityTypesResource get entityTypes => - ProjectsAgentEntityTypesResource(_requester); - ProjectsAgentEnvironmentsResource get environments => - ProjectsAgentEnvironmentsResource(_requester); - ProjectsAgentIntentsResource get intents => - ProjectsAgentIntentsResource(_requester); - ProjectsAgentKnowledgeBasesResource get knowledgeBases => - ProjectsAgentKnowledgeBasesResource(_requester); - ProjectsAgentSessionsResource get sessions => - ProjectsAgentSessionsResource(_requester); - - ProjectsAgentResource(commons.ApiRequester client) : _requester = client; - - /// Exports the specified agent to a ZIP file. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to export is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> export( - GoogleCloudDialogflowV2beta1ExportAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:export'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the fulfillment. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the fulfillment. Supported formats: - - /// `projects//agent/fulfillment` - `projects//locations//agent/fulfillment` - /// Value must have pattern `^projects/\[^/\]+/agent/fulfillment$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Fulfillment]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Fulfillment> getFulfillment( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Fulfillment.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets agent validation result. - /// - /// Agent validation is performed during training time and is updated - /// automatically when training is completed. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent is associated with. - /// Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language for which you want a validation - /// result. If not specified, the agent's default language is used. - /// [Many languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they - /// can be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ValidationResult]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ValidationResult> - getValidationResult( - core.String parent, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent/validationResult'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ValidationResult.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Imports the specified agent from a ZIP file. - /// - /// Uploads new intents and entity types without deleting the existing ones. - /// Intents and entity types with the same name are replaced with the new - /// versions from ImportAgentRequest. After the import, the imported draft - /// agent will be trained automatically (unless disabled in agent settings). - /// However, once the import is done, training may not be completed yet. - /// Please call TrainAgent and wait for the operation it returns in order to - /// train explicitly. Operation An operation which tracks when importing is - /// complete. It only tracks when the draft agent is updated not when it is - /// done training. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to import is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> import( - GoogleCloudDialogflowV2beta1ImportAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:import'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Restores the specified agent from a ZIP file. - /// - /// Replaces the current agent version with a new one. All the intents and - /// entity types in the older version are deleted. After the restore, the - /// restored draft agent will be trained automatically (unless disabled in - /// agent settings). However, once the restore is done, training may not be - /// completed yet. Please call TrainAgent and wait for the operation it - /// returns in order to train explicitly. Operation An operation which tracks - /// when restoring is complete. It only tracks when the draft agent is updated - /// not when it is done training. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to restore is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> restore( - GoogleCloudDialogflowV2beta1RestoreAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:restore'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of agents. - /// - /// Since there is at most one conversational agent per project, this method - /// is useful primarily for listing all agents across projects the caller has - /// access to. One can achieve that with a wildcard project collection id "-". - /// Refer to \[List - /// Sub-Collections\](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - /// - /// Request parameters: - /// - /// [parent] - Required. The project to list agents from. Format: `projects/` - /// or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SearchAgentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SearchAgentsResponse> search( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:search'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SearchAgentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Trains the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to train is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> train( - GoogleCloudDialogflowV2beta1TrainAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:train'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the fulfillment. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the fulfillment. Supported - /// formats: - `projects//agent/fulfillment` - - /// `projects//locations//agent/fulfillment` - /// Value must have pattern `^projects/\[^/\]+/agent/fulfillment$`. - /// - /// [updateMask] - Required. The mask to control which fields get updated. If - /// the mask is not present, all fields will be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Fulfillment]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Fulfillment> updateFulfillment( - GoogleCloudDialogflowV2beta1Fulfillment request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Fulfillment.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsAgentEntityTypesEntitiesResource get entities => - ProjectsAgentEntityTypesEntitiesResource(_requester); - - ProjectsAgentEntityTypesResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes entity types in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to delete all entities types - /// for. Supported formats: - `projects//agent`, - - /// `projects//locations//agent`. - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates/Creates multiple entity types in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to update or create entity - /// types in. Supported formats: - `projects//agent` - - /// `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates an entity type in the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to create a entity type for. Supported - /// formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> create( - GoogleCloudDialogflowV2beta1EntityType request, - core.String parent, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified entity type. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified entity type. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type. Supported formats: - - /// `projects//agent/entityTypes/` - `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> get( - core.String name, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all entity types in the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all entity types from. Supported - /// formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListEntityTypesResponse> list( - core.String parent, { - core.String languageCode, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified entity type. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The unique identifier of the entity type. Required for - /// EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes - /// methods. Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> patch( - GoogleCloudDialogflowV2beta1EntityType request, - core.String name, { - core.String languageCode, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEntityTypesEntitiesResource { - final commons.ApiRequester _requester; - - ProjectsAgentEntityTypesEntitiesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates multiple new entities in the specified entity type. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to create entities in. - /// Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchCreate( - GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchCreate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes entities in the specified entity type. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to delete entries for. - /// Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates or creates multiple entities in the specified entity type. - /// - /// This method does not affect entities in the entity type that aren't - /// explicitly specified in the request. Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to update or create - /// entities in. Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern `^projects/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEnvironmentsResource { - final commons.ApiRequester _requester; - - ProjectsAgentEnvironmentsUsersResource get users => - ProjectsAgentEnvironmentsUsersResource(_requester); - - ProjectsAgentEnvironmentsResource(commons.ApiRequester client) - : _requester = client; - - /// Returns the list of all non-draft environments of the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all environments from. Format: - - /// `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListEnvironmentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListEnvironmentsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/environments'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListEnvironmentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEnvironmentsUsersResource { - final commons.ApiRequester _requester; - - ProjectsAgentEnvironmentsUsersSessionsResource get sessions => - ProjectsAgentEnvironmentsUsersSessionsResource(_requester); - - ProjectsAgentEnvironmentsUsersResource(commons.ApiRequester client) - : _requester = client; -} - -class ProjectsAgentEnvironmentsUsersSessionsResource { - final commons.ApiRequester _requester; - - ProjectsAgentEnvironmentsUsersSessionsContextsResource get contexts => - ProjectsAgentEnvironmentsUsersSessionsContextsResource(_requester); - ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource get entityTypes => - ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource(_requester); - - ProjectsAgentEnvironmentsUsersSessionsResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes all active contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the session to delete all contexts from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified we assume default 'draft' environment. - /// If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteContexts( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Processes a natural language query and returns structured, actionable data - /// as a result. - /// - /// This method is not idempotent, because it may cause contexts and session - /// entity types to be updated, which in turn might affect results of future - /// queries. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [session] - Required. The name of the session this query is sent to. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we are using "-". It's up to - /// the API caller to choose an appropriate \`Session ID\` and \`User Id\`. - /// They can be a random number or some type of user and session identifiers - /// (preferably hashed). The length of the \`Session ID\` and \`User ID\` must - /// not exceed 36 characters. For more information, see the - /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1DetectIntentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1DetectIntentResponse> detectIntent( - GoogleCloudDialogflowV2beta1DetectIntentRequest request, - core.String session, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (session == null) { - throw core.ArgumentError('Parameter session is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$session') + - ':detectIntent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1DetectIntentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEnvironmentsUsersSessionsContextsResource { - final commons.ApiRequester _requester; - - ProjectsAgentEnvironmentsUsersSessionsContextsResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a context. - /// - /// If the specified context already exists, overrides the context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a context for. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> create( - GoogleCloudDialogflowV2beta1Context request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context to delete. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all contexts from. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListContextsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListContextsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListContextsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the context. Supported - /// formats: - `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, The - /// `Context ID` is always converted to lowercase, may only contain characters - /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> patch( - GoogleCloudDialogflowV2beta1Context request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsAgentEnvironmentsUsersSessionsEntityTypesResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the session - /// entity type. This method doesn't work with Google Assistant integration. - /// Contact Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a session entity type for. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> create( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the session entity type. Supported formats: - /// - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all session entity types in the specified session. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all session entity types from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a - /// [GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of this session entity type. - /// Supported formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> patch( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentIntentsResource { - final commons.ApiRequester _requester; - - ProjectsAgentIntentsResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes intents in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to delete all entities types - /// for. Supported formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates/Creates multiple intents in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to update or create intents in. - /// Supported formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates an intent in the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to create a intent for. Supported formats: - /// - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> create( - GoogleCloudDialogflowV2beta1Intent request, - core.String parent, { - core.String intentView, - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified intent and its direct or indirect followup intents. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the intent to delete. If this intent has - /// direct or indirect followup intents, we also delete them. Supported - /// formats: - `projects//agent/intents/` - - /// `projects//locations//agent/intents/` - /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified intent. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the intent. Supported formats: - - /// `projects//agent/intents/` - `projects//locations//agent/intents/` - /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> get( - core.String name, { - core.String intentView, - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all intents in the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all intents from. Format: - /// `projects//agent`. - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListIntentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListIntentsResponse> list( - core.String parent, { - core.String intentView, - core.String languageCode, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListIntentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified intent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Optional. The unique identifier of this intent. Required for - /// Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Supported - /// formats: - `projects//agent/intents/` - - /// `projects//locations//agent/intents/` - /// Value must have pattern `^projects/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> patch( - GoogleCloudDialogflowV2beta1Intent request, - core.String name, { - core.String intentView, - core.String languageCode, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentKnowledgeBasesResource { - final commons.ApiRequester _requester; - - ProjectsAgentKnowledgeBasesDocumentsResource get documents => - ProjectsAgentKnowledgeBasesDocumentsResource(_requester); - - ProjectsAgentKnowledgeBasesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project to create a knowledge base for. Format: - /// `projects/`. - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> create( - GoogleCloudDialogflowV2beta1KnowledgeBase request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/knowledgeBases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the knowledge base to delete. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. - /// - /// [force] - Optional. Force deletes the knowledge base. When set to true, - /// any documents in the knowledge base are also deleted. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.bool force, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (force != null) { - _queryParams['force'] = ['${force}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the knowledge base to retrieve. Format - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all knowledge bases of the specified agent. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [parent] - Required. The project to list of knowledge bases for. Format: - /// `projects/`. - /// Value must have pattern `^projects/\[^/\]+/agent$`. - /// - /// [filter] - The filter expression used to filter knowledge bases returned - /// by the list method. The expression has the following syntax: \[AND \] ... - /// The following fields and operators are supported: * display_name with - /// has(:) operator * language_code with equals(=) operator Examples: * - /// 'language_code=en-us' matches knowledge bases with en-us language code. * - /// 'display_name:articles' matches knowledge bases whose display name - /// contains "articles". * 'display_name:"Best Articles"' matches knowledge - /// bases whose display name contains "Best Articles". * 'language_code=en-gb - /// AND display_name=articles' matches all knowledge bases whose display name - /// contains "articles" and whose language code is "en-gb". Note: An empty - /// filter string (i.e. "") is a no-op and will result in no filtering. For - /// more information about filtering, see - /// [API Filtering](https://aip.dev/160). - /// - /// [pageSize] - The maximum number of items to return in a single page. By - /// default 10 and at most 100. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/knowledgeBases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The knowledge base resource name. The name must be empty when - /// creating a knowledge base. Format: `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. - /// - /// [updateMask] - Optional. Not specified means `update all`. Currently, only - /// `display_name` can be updated, an InvalidArgument will be returned for - /// attempting to update other fields. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> patch( - GoogleCloudDialogflowV2beta1KnowledgeBase request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentKnowledgeBasesDocumentsResource { - final commons.ApiRequester _requester; - - ProjectsAgentKnowledgeBasesDocumentsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The knoweldge base to create a document for. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> create( - GoogleCloudDialogflowV2beta1Document request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to delete. Format: - /// `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to retrieve. Format - /// `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Document]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Document> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Document.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all documents of the knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [parent] - Required. The knowledge base to list all documents for. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+$`. - /// - /// [filter] - The filter expression used to filter documents returned by the - /// list method. The expression has the following syntax: \[AND \] ... The - /// following fields and operators are supported: * knowledge_types with - /// has(:) operator * display_name with has(:) operator * state with equals(=) - /// operator Examples: * "knowledge_types:FAQ" matches documents with FAQ - /// knowledge type. * "display_name:customer" matches documents whose display - /// name contains "customer". * "state=ACTIVE" matches documents with ACTIVE - /// state. * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ - /// documents. For more information about filtering, see - /// [API Filtering](https://aip.dev/160). - /// - /// [pageSize] - The maximum number of items to return in a single page. By - /// default 10 and at most 100. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListDocumentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListDocumentsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListDocumentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Optional. The document resource name. The name must be empty when - /// creating a document. Format: `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [updateMask] - Optional. Not specified means `update all`. Currently, only - /// `display_name` can be updated, an InvalidArgument will be returned for - /// attempting to update other fields. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> patch( - GoogleCloudDialogflowV2beta1Document request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Reloads the specified document from its specified source, content_uri or - /// content. - /// - /// The previously loaded content of the document will be deleted. Note: Even - /// when the content of the document has not changed, there still may be side - /// effects because of internal implementation changes. Note: The - /// `projects.agent.knowledgeBases.documents` resource is deprecated; only use - /// `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to reload. Format: - /// `projects//knowledgeBases//documents/` - /// Value must have pattern - /// `^projects/\[^/\]+/agent/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> reload( - GoogleCloudDialogflowV2beta1ReloadDocumentRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':reload'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentSessionsResource { - final commons.ApiRequester _requester; - - ProjectsAgentSessionsContextsResource get contexts => - ProjectsAgentSessionsContextsResource(_requester); - ProjectsAgentSessionsEntityTypesResource get entityTypes => - ProjectsAgentSessionsEntityTypesResource(_requester); - - ProjectsAgentSessionsResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes all active contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the session to delete all contexts from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified we assume default 'draft' environment. - /// If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteContexts( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Processes a natural language query and returns structured, actionable data - /// as a result. - /// - /// This method is not idempotent, because it may cause contexts and session - /// entity types to be updated, which in turn might affect results of future - /// queries. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [session] - Required. The name of the session this query is sent to. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we are using "-". It's up to - /// the API caller to choose an appropriate \`Session ID\` and \`User Id\`. - /// They can be a random number or some type of user and session identifiers - /// (preferably hashed). The length of the \`Session ID\` and \`User ID\` must - /// not exceed 36 characters. For more information, see the - /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1DetectIntentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1DetectIntentResponse> detectIntent( - GoogleCloudDialogflowV2beta1DetectIntentRequest request, - core.String session, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (session == null) { - throw core.ArgumentError('Parameter session is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$session') + - ':detectIntent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1DetectIntentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentSessionsContextsResource { - final commons.ApiRequester _requester; - - ProjectsAgentSessionsContextsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a context. - /// - /// If the specified context already exists, overrides the context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a context for. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> create( - GoogleCloudDialogflowV2beta1Context request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context to delete. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all contexts from. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListContextsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListContextsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListContextsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the context. Supported - /// formats: - `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, The - /// `Context ID` is always converted to lowercase, may only contain characters - /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> patch( - GoogleCloudDialogflowV2beta1Context request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsAgentSessionsEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsAgentSessionsEntityTypesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the session - /// entity type. This method doesn't work with Google Assistant integration. - /// Contact Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a session entity type for. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> create( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the session entity type. Supported formats: - /// - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all session entity types in the specified session. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all session entity types from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern `^projects/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a - /// [GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of this session entity type. - /// Supported formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// Value must have pattern - /// `^projects/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> patch( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsKnowledgeBasesResource { - final commons.ApiRequester _requester; - - ProjectsKnowledgeBasesDocumentsResource get documents => - ProjectsKnowledgeBasesDocumentsResource(_requester); - - ProjectsKnowledgeBasesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project to create a knowledge base for. Format: - /// `projects/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> create( - GoogleCloudDialogflowV2beta1KnowledgeBase request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/knowledgeBases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the knowledge base to delete. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. - /// - /// [force] - Optional. Force deletes the knowledge base. When set to true, - /// any documents in the knowledge base are also deleted. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.bool force, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (force != null) { - _queryParams['force'] = ['${force}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the knowledge base to retrieve. Format - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all knowledge bases of the specified agent. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// Request parameters: - /// - /// [parent] - Required. The project to list of knowledge bases for. Format: - /// `projects/`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The filter expression used to filter knowledge bases returned - /// by the list method. The expression has the following syntax: \[AND \] ... - /// The following fields and operators are supported: * display_name with - /// has(:) operator * language_code with equals(=) operator Examples: * - /// 'language_code=en-us' matches knowledge bases with en-us language code. * - /// 'display_name:articles' matches knowledge bases whose display name - /// contains "articles". * 'display_name:"Best Articles"' matches knowledge - /// bases whose display name contains "Best Articles". * 'language_code=en-gb - /// AND display_name=articles' matches all knowledge bases whose display name - /// contains "articles" and whose language code is "en-gb". Note: An empty - /// filter string (i.e. "") is a no-op and will result in no filtering. For - /// more information about filtering, see - /// [API Filtering](https://aip.dev/160). - /// - /// [pageSize] - The maximum number of items to return in a single page. By - /// default 10 and at most 100. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/knowledgeBases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use - /// `projects.knowledgeBases`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The knowledge base resource name. The name must be empty when - /// creating a knowledge base. Format: `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. - /// - /// [updateMask] - Optional. Not specified means `update all`. Currently, only - /// `display_name` can be updated, an InvalidArgument will be returned for - /// attempting to update other fields. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1KnowledgeBase]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1KnowledgeBase> patch( - GoogleCloudDialogflowV2beta1KnowledgeBase request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsKnowledgeBasesDocumentsResource { - final commons.ApiRequester _requester; - - ProjectsKnowledgeBasesDocumentsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The knoweldge base to create a document for. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> create( - GoogleCloudDialogflowV2beta1Document request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to delete. Format: - /// `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to retrieve. Format - /// `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Document]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Document> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Document.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all documents of the knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// Request parameters: - /// - /// [parent] - Required. The knowledge base to list all documents for. Format: - /// `projects//knowledgeBases/`. - /// Value must have pattern `^projects/\[^/\]+/knowledgeBases/\[^/\]+$`. - /// - /// [filter] - The filter expression used to filter documents returned by the - /// list method. The expression has the following syntax: \[AND \] ... The - /// following fields and operators are supported: * knowledge_types with - /// has(:) operator * display_name with has(:) operator * state with equals(=) - /// operator Examples: * "knowledge_types:FAQ" matches documents with FAQ - /// knowledge type. * "display_name:customer" matches documents whose display - /// name contains "customer". * "state=ACTIVE" matches documents with ACTIVE - /// state. * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ - /// documents. For more information about filtering, see - /// [API Filtering](https://aip.dev/160). - /// - /// [pageSize] - The maximum number of items to return in a single page. By - /// default 10 and at most 100. - /// - /// [pageToken] - The next_page_token value returned from a previous list - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListDocumentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListDocumentsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListDocumentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is - /// deprecated; only use `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Optional. The document resource name. The name must be empty when - /// creating a document. Format: `projects//knowledgeBases//documents/`. - /// Value must have pattern - /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [updateMask] - Optional. Not specified means `update all`. Currently, only - /// `display_name` can be updated, an InvalidArgument will be returned for - /// attempting to update other fields. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> patch( - GoogleCloudDialogflowV2beta1Document request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Reloads the specified document from its specified source, content_uri or - /// content. - /// - /// The previously loaded content of the document will be deleted. Note: Even - /// when the content of the document has not changed, there still may be side - /// effects because of internal implementation changes. Note: The - /// `projects.agent.knowledgeBases.documents` resource is deprecated; only use - /// `projects.knowledgeBases.documents`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the document to reload. Format: - /// `projects//knowledgeBases//documents/` - /// Value must have pattern - /// `^projects/\[^/\]+/knowledgeBases/\[^/\]+/documents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> reload( - GoogleCloudDialogflowV2beta1ReloadDocumentRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':reload'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentResource get agent => - ProjectsLocationsAgentResource(_requester); - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Deletes the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to delete is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteAgent( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to fetch is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Agent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Agent> getAgent( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Agent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates/updates the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project of this agent. Format: `projects/` or - /// `projects//locations/` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Agent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Agent> setAgent( - GoogleCloudDialogflowV2beta1Agent request, - core.String parent, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Agent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEntityTypesResource get entityTypes => - ProjectsLocationsAgentEntityTypesResource(_requester); - ProjectsLocationsAgentEnvironmentsResource get environments => - ProjectsLocationsAgentEnvironmentsResource(_requester); - ProjectsLocationsAgentIntentsResource get intents => - ProjectsLocationsAgentIntentsResource(_requester); - ProjectsLocationsAgentSessionsResource get sessions => - ProjectsLocationsAgentSessionsResource(_requester); - - ProjectsLocationsAgentResource(commons.ApiRequester client) - : _requester = client; - - /// Exports the specified agent to a ZIP file. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to export is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> export( - GoogleCloudDialogflowV2beta1ExportAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:export'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the fulfillment. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the fulfillment. Supported formats: - - /// `projects//agent/fulfillment` - `projects//locations//agent/fulfillment` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/fulfillment$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Fulfillment]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Fulfillment> getFulfillment( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Fulfillment.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets agent validation result. - /// - /// Agent validation is performed during training time and is updated - /// automatically when training is completed. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent is associated with. - /// Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language for which you want a validation - /// result. If not specified, the agent's default language is used. - /// [Many languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they - /// can be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ValidationResult]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ValidationResult> - getValidationResult( - core.String parent, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent/validationResult'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ValidationResult.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Imports the specified agent from a ZIP file. - /// - /// Uploads new intents and entity types without deleting the existing ones. - /// Intents and entity types with the same name are replaced with the new - /// versions from ImportAgentRequest. After the import, the imported draft - /// agent will be trained automatically (unless disabled in agent settings). - /// However, once the import is done, training may not be completed yet. - /// Please call TrainAgent and wait for the operation it returns in order to - /// train explicitly. Operation An operation which tracks when importing is - /// complete. It only tracks when the draft agent is updated not when it is - /// done training. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to import is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> import( - GoogleCloudDialogflowV2beta1ImportAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:import'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Restores the specified agent from a ZIP file. - /// - /// Replaces the current agent version with a new one. All the intents and - /// entity types in the older version are deleted. After the restore, the - /// restored draft agent will be trained automatically (unless disabled in - /// agent settings). However, once the restore is done, training may not be - /// completed yet. Please call TrainAgent and wait for the operation it - /// returns in order to train explicitly. Operation An operation which tracks - /// when restoring is complete. It only tracks when the draft agent is updated - /// not when it is done training. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to restore is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> restore( - GoogleCloudDialogflowV2beta1RestoreAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:restore'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of agents. - /// - /// Since there is at most one conversational agent per project, this method - /// is useful primarily for listing all agents across projects the caller has - /// access to. One can achieve that with a wildcard project collection id "-". - /// Refer to \[List - /// Sub-Collections\](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - /// - /// Request parameters: - /// - /// [parent] - Required. The project to list agents from. Format: `projects/` - /// or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SearchAgentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SearchAgentsResponse> search( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:search'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SearchAgentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Trains the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The project that the agent to train is associated - /// with. Format: `projects/` or `projects//locations/`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> train( - GoogleCloudDialogflowV2beta1TrainAgentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/agent:train'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the fulfillment. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the fulfillment. Supported - /// formats: - `projects//agent/fulfillment` - - /// `projects//locations//agent/fulfillment` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/fulfillment$`. - /// - /// [updateMask] - Required. The mask to control which fields get updated. If - /// the mask is not present, all fields will be updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Fulfillment]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Fulfillment> updateFulfillment( - GoogleCloudDialogflowV2beta1Fulfillment request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Fulfillment.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEntityTypesEntitiesResource get entities => - ProjectsLocationsAgentEntityTypesEntitiesResource(_requester); - - ProjectsLocationsAgentEntityTypesResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes entity types in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to delete all entities types - /// for. Supported formats: - `projects//agent`, - - /// `projects//locations//agent`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates/Creates multiple entity types in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to update or create entity - /// types in. Supported formats: - `projects//agent` - - /// `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates an entity type in the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to create a entity type for. Supported - /// formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> create( - GoogleCloudDialogflowV2beta1EntityType request, - core.String parent, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified entity type. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified entity type. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type. Supported formats: - - /// `projects//agent/entityTypes/` - `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> get( - core.String name, { - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all entity types in the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all entity types from. Supported - /// formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListEntityTypesResponse> list( - core.String parent, { - core.String languageCode, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified entity type. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The unique identifier of the entity type. Required for - /// EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes - /// methods. Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1EntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1EntityType> patch( - GoogleCloudDialogflowV2beta1EntityType request, - core.String name, { - core.String languageCode, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1EntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEntityTypesEntitiesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEntityTypesEntitiesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates multiple new entities in the specified entity type. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to create entities in. - /// Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchCreate( - GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchCreate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes entities in the specified entity type. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to delete entries for. - /// Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates or creates multiple entities in the specified entity type. - /// - /// This method does not affect entities in the entity type that aren't - /// explicitly specified in the request. Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the entity type to update or create - /// entities in. Supported formats: - `projects//agent/entityTypes/` - - /// `projects//locations//agent/entityTypes/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entities:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEnvironmentsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEnvironmentsUsersResource get users => - ProjectsLocationsAgentEnvironmentsUsersResource(_requester); - - ProjectsLocationsAgentEnvironmentsResource(commons.ApiRequester client) - : _requester = client; - - /// Returns the list of all non-draft environments of the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all environments from. Format: - - /// `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListEnvironmentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListEnvironmentsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/environments'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListEnvironmentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEnvironmentsUsersResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEnvironmentsUsersSessionsResource get sessions => - ProjectsLocationsAgentEnvironmentsUsersSessionsResource(_requester); - - ProjectsLocationsAgentEnvironmentsUsersResource(commons.ApiRequester client) - : _requester = client; -} - -class ProjectsLocationsAgentEnvironmentsUsersSessionsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource - get contexts => - ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource( - _requester); - ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource - get entityTypes => - ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource( - _requester); - - ProjectsLocationsAgentEnvironmentsUsersSessionsResource( - commons.ApiRequester client) - : _requester = client; - - /// Deletes all active contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the session to delete all contexts from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified we assume default 'draft' environment. - /// If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteContexts( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Processes a natural language query and returns structured, actionable data - /// as a result. - /// - /// This method is not idempotent, because it may cause contexts and session - /// entity types to be updated, which in turn might affect results of future - /// queries. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [session] - Required. The name of the session this query is sent to. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we are using "-". It's up to - /// the API caller to choose an appropriate \`Session ID\` and \`User Id\`. - /// They can be a random number or some type of user and session identifiers - /// (preferably hashed). The length of the \`Session ID\` and \`User ID\` must - /// not exceed 36 characters. For more information, see the - /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1DetectIntentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1DetectIntentResponse> detectIntent( - GoogleCloudDialogflowV2beta1DetectIntentRequest request, - core.String session, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (session == null) { - throw core.ArgumentError('Parameter session is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$session') + - ':detectIntent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1DetectIntentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEnvironmentsUsersSessionsContextsResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a context. - /// - /// If the specified context already exists, overrides the context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a context for. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> create( - GoogleCloudDialogflowV2beta1Context request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context to delete. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all contexts from. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListContextsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListContextsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListContextsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the context. Supported - /// formats: - `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, The - /// `Context ID` is always converted to lowercase, may only contain characters - /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> patch( - GoogleCloudDialogflowV2beta1Context request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the session - /// entity type. This method doesn't work with Google Assistant integration. - /// Contact Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a session entity type for. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> create( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the session entity type. Supported formats: - /// - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all session entity types in the specified session. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all session entity types from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a - /// [GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of this session entity type. - /// Supported formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/environments/\[^/\]+/users/\[^/\]+/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> patch( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentIntentsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentIntentsResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes intents in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to delete all entities types - /// for. Supported formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchDelete( - GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents:batchDelete'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates/Creates multiple intents in the specified agent. - /// - /// Operation - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the agent to update or create intents in. - /// Supported formats: - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchUpdate( - GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents:batchUpdate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates an intent in the specified agent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to create a intent for. Supported formats: - /// - `projects//agent` - `projects//locations//agent` - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> create( - GoogleCloudDialogflowV2beta1Intent request, - core.String parent, { - core.String intentView, - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified intent and its direct or indirect followup intents. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the intent to delete. If this intent has - /// direct or indirect followup intents, we also delete them. Supported - /// formats: - `projects//agent/intents/` - - /// `projects//locations//agent/intents/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified intent. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the intent. Supported formats: - - /// `projects//agent/intents/` - `projects//locations//agent/intents/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> get( - core.String name, { - core.String intentView, - core.String languageCode, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all intents in the specified agent. - /// - /// Request parameters: - /// - /// [parent] - Required. The agent to list all intents from. Format: - /// `projects//agent`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+/agent$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListIntentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListIntentsResponse> list( - core.String parent, { - core.String intentView, - core.String languageCode, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/intents'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListIntentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified intent. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Optional. The unique identifier of this intent. Required for - /// Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Supported - /// formats: - `projects//agent/intents/` - - /// `projects//locations//agent/intents/` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/intents/\[^/\]+$`. - /// - /// [intentView] - Optional. The resource view to apply to the returned - /// intent. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - /// - /// [languageCode] - Optional. The language used to access language-specific - /// data. If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Intent]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Intent> patch( - GoogleCloudDialogflowV2beta1Intent request, - core.String name, { - core.String intentView, - core.String languageCode, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (intentView != null) { - _queryParams['intentView'] = [intentView]; - } - if (languageCode != null) { - _queryParams['languageCode'] = [languageCode]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Intent.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentSessionsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentSessionsContextsResource get contexts => - ProjectsLocationsAgentSessionsContextsResource(_requester); - ProjectsLocationsAgentSessionsEntityTypesResource get entityTypes => - ProjectsLocationsAgentSessionsEntityTypesResource(_requester); - - ProjectsLocationsAgentSessionsResource(commons.ApiRequester client) - : _requester = client; - - /// Deletes all active contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the session to delete all contexts from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified we assume default 'draft' environment. - /// If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> deleteContexts( - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Processes a natural language query and returns structured, actionable data - /// as a result. - /// - /// This method is not idempotent, because it may cause contexts and session - /// entity types to be updated, which in turn might affect results of future - /// queries. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [session] - Required. The name of the session this query is sent to. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we are using "-". It's up to - /// the API caller to choose an appropriate \`Session ID\` and \`User Id\`. - /// They can be a random number or some type of user and session identifiers - /// (preferably hashed). The length of the \`Session ID\` and \`User ID\` must - /// not exceed 36 characters. For more information, see the - /// [API interactions guide](https://cloud.google.com/dialogflow/docs/api-overview). - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1DetectIntentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1DetectIntentResponse> detectIntent( - GoogleCloudDialogflowV2beta1DetectIntentRequest request, - core.String session, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (session == null) { - throw core.ArgumentError('Parameter session is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$session') + - ':detectIntent'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1DetectIntentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentSessionsContextsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentSessionsContextsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a context. - /// - /// If the specified context already exists, overrides the context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a context for. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> create( - GoogleCloudDialogflowV2beta1Context request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context to delete. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified context. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the context. Supported formats: - - /// `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, If - /// `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all contexts in the specified session. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all contexts from. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1ListContextsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListContextsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/contexts'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1ListContextsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified context. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of the context. Supported - /// formats: - `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, The - /// `Context ID` is always converted to lowercase, may only contain characters - /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/contexts/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1Context]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1Context> patch( - GoogleCloudDialogflowV2beta1Context request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1Context.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAgentSessionsEntityTypesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAgentSessionsEntityTypesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the session - /// entity type. This method doesn't work with Google Assistant integration. - /// Contact Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to create a session entity type for. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> create( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the entity type to delete. Supported - /// formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the session entity type. Supported formats: - /// - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns the list of all session entity types in the specified session. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// Request parameters: - /// - /// [parent] - Required. The session to list all session entity types from. - /// Supported formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, If - /// \`Location ID\` is not specified we assume default 'us' location. If - /// \`Environment ID\` is not specified, we assume default 'draft' - /// environment. If \`User ID\` is not specified, we assume default '-' user. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+$`. - /// - /// [pageSize] - Optional. The maximum number of items to return in a single - /// page. By default 100 and at most 1000. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a - /// [GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/entityTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified session entity type. - /// - /// This method doesn't work with Google Assistant integration. Contact - /// Dialogflow support if you need to use session entities with Google - /// Assistant integration. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The unique identifier of this session entity type. - /// Supported formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/agent/sessions/\[^/\]+/entityTypes/\[^/\]+$`. - /// - /// [updateMask] - Optional. The mask to control which fields get updated. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDialogflowV2beta1SessionEntityType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDialogflowV2beta1SessionEntityType> patch( - GoogleCloudDialogflowV2beta1SessionEntityType request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> cancel( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleProtobufEmpty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleProtobufEmpty> cancel( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleProtobufEmpty.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Metadata associated with the long running operation for -/// Versions.CreateVersion. -class GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata { - /// Name of the created version. - /// - /// Format: `projects//locations//agents//flows//versions/`. - core.String version; - - GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata(); - - GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata.fromJson( - core.Map _json) { - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// The response message for Agents.ExportAgent. -class GoogleCloudDialogflowCxV3beta1ExportAgentResponse { - /// Uncompressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a file containing the exported agent. - /// - /// This field is populated only if `agent_uri` is specified in - /// ExportAgentRequest. - core.String agentUri; - - GoogleCloudDialogflowCxV3beta1ExportAgentResponse(); - - GoogleCloudDialogflowCxV3beta1ExportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// The response message for Agents.ImportAgent. -class GoogleCloudDialogflowCxV3beta1ImportAgentResponse { - /// The unique identifier of the new agent. - /// - /// Format: `projects//locations//agents/`. - core.String agent; - - GoogleCloudDialogflowCxV3beta1ImportAgentResponse(); - - GoogleCloudDialogflowCxV3beta1ImportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agent')) { - agent = _json['agent'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agent != null) { - _json['agent'] = agent; - } - return _json; - } -} - -/// Represents page information communicated to and from the webhook. -class GoogleCloudDialogflowCxV3beta1PageInfo { - /// Always present for WebhookRequest. - /// - /// Ignored for WebhookResponse. The unique identifier of the current page. - /// Format: `projects//locations//agents//flows//pages/`. - core.String currentPage; - - /// Optional for both WebhookRequest and WebhookResponse. - /// - /// Information about the form. - GoogleCloudDialogflowCxV3beta1PageInfoFormInfo formInfo; - - GoogleCloudDialogflowCxV3beta1PageInfo(); - - GoogleCloudDialogflowCxV3beta1PageInfo.fromJson(core.Map _json) { - if (_json.containsKey('currentPage')) { - currentPage = _json['currentPage'] as core.String; - } - if (_json.containsKey('formInfo')) { - formInfo = GoogleCloudDialogflowCxV3beta1PageInfoFormInfo.fromJson( - _json['formInfo'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (currentPage != null) { - _json['currentPage'] = currentPage; - } - if (formInfo != null) { - _json['formInfo'] = formInfo.toJson(); - } - return _json; - } -} - -/// Represents form information. -class GoogleCloudDialogflowCxV3beta1PageInfoFormInfo { - /// Optional for both WebhookRequest and WebhookResponse. - /// - /// The parameters contained in the form. Note that the webhook cannot add or - /// remove any form parameter. - core.List<GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo> - parameterInfo; - - GoogleCloudDialogflowCxV3beta1PageInfoFormInfo(); - - GoogleCloudDialogflowCxV3beta1PageInfoFormInfo.fromJson(core.Map _json) { - if (_json.containsKey('parameterInfo')) { - parameterInfo = (_json['parameterInfo'] as core.List) - .map<GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo>( - (value) => - GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (parameterInfo != null) { - _json['parameterInfo'] = - parameterInfo.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents parameter information. -class GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo { - /// Always present for WebhookRequest. - /// - /// Required for WebhookResponse. The human-readable name of the parameter, - /// unique within the form. This field cannot be modified by the webhook. - core.String displayName; - - /// Optional for WebhookRequest. - /// - /// Ignored for WebhookResponse. Indicates if the parameter value was just - /// collected on the last conversation turn. - core.bool justCollected; - - /// Optional for both WebhookRequest and WebhookResponse. - /// - /// Indicates whether the parameter is required. Optional parameters will not - /// trigger prompts; however, they are filled if the user specifies them. - /// Required parameters must be filled before form filling concludes. - core.bool required; - - /// Always present for WebhookRequest. - /// - /// Required for WebhookResponse. The state of the parameter. This field can - /// be set to INVALID by the webhook to invalidate the parameter; other values - /// set by the webhook will be ignored. - /// Possible string values are: - /// - "PARAMETER_STATE_UNSPECIFIED" : Not specified. This value should be - /// never used. - /// - "EMPTY" : Indicates that the parameter does not have a value. - /// - "INVALID" : Indicates that the parameter value is invalid. This field - /// can be used by the webhook to invalidate the parameter and ask the server - /// to collect it from the user again. - /// - "FILLED" : Indicates that the parameter has a value. - core.String state; - - /// Optional for both WebhookRequest and WebhookResponse. - /// - /// The value of the parameter. This field can be set by the webhook to change - /// the parameter value. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Object value; - - GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo(); - - GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo.fromJson( - core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('justCollected')) { - justCollected = _json['justCollected'] as core.bool; - } - if (_json.containsKey('required')) { - required = _json['required'] as core.bool; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('value')) { - value = _json['value'] as core.Object; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (justCollected != null) { - _json['justCollected'] = justCollected; - } - if (required != null) { - _json['required'] = required; - } - if (state != null) { - _json['state'] = state; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// Represents a response message that can be returned by a conversational -/// agent. -/// -/// Response messages are also used for output audio synthesis. The approach is -/// as follows: * If at least one OutputAudioText response is present, then all -/// OutputAudioText responses are linearly concatenated, and the result is used -/// for output audio synthesis. * If the OutputAudioText responses are a mixture -/// of text and SSML, then the concatenated result is treated as SSML; -/// otherwise, the result is treated as either text or SSML as appropriate. The -/// agent designer should ideally use either text or SSML consistently -/// throughout the bot design. * Otherwise, all Text responses are linearly -/// concatenated, and the result is used for output audio synthesis. This -/// approach allows for more sophisticated user experience scenarios, where the -/// text displayed to the user may differ from what is heard. -class GoogleCloudDialogflowCxV3beta1ResponseMessage { - /// Indicates that the conversation succeeded. - GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess - conversationSuccess; - - /// A signal that indicates the interaction with the Dialogflow agent has - /// ended. - /// - /// This message is generated by Dialogflow only when the conversation reaches - /// `END_SESSION` or `END_PAGE` page. It is not supposed to be defined by the - /// user. It's guaranteed that there is at most one such message in each - /// response. - /// - /// Output only. - GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction endInteraction; - - /// Hands off conversation to a human agent. - GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff - liveAgentHandoff; - - /// An audio response message composed of both the synthesized Dialogflow - /// agent responses and responses defined via play_audio. - /// - /// This message is generated by Dialogflow only and not supposed to be - /// defined by the user. - /// - /// Output only. - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio mixedAudio; - - /// A text or ssml response that is preferentially used for TTS output audio - /// synthesis, as described in the comment on the ResponseMessage message. - GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText outputAudioText; - - /// Returns a response containing a custom, platform-specific payload. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Signal that the client should play an audio clip hosted at a - /// client-specific URI. - /// - /// Dialogflow uses this to construct mixed_audio. However, Dialogflow itself - /// does not try to read or process the URI in any way. - GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio playAudio; - - /// Returns a text response. - GoogleCloudDialogflowCxV3beta1ResponseMessageText text; - - GoogleCloudDialogflowCxV3beta1ResponseMessage(); - - GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson(core.Map _json) { - if (_json.containsKey('conversationSuccess')) { - conversationSuccess = - GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess - .fromJson(_json['conversationSuccess'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('endInteraction')) { - endInteraction = - GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction.fromJson( - _json['endInteraction'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('liveAgentHandoff')) { - liveAgentHandoff = - GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff - .fromJson(_json['liveAgentHandoff'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('mixedAudio')) { - mixedAudio = - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio.fromJson( - _json['mixedAudio'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('outputAudioText')) { - outputAudioText = - GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText.fromJson( - _json['outputAudioText'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('playAudio')) { - playAudio = - GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio.fromJson( - _json['playAudio'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = GoogleCloudDialogflowCxV3beta1ResponseMessageText.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (conversationSuccess != null) { - _json['conversationSuccess'] = conversationSuccess.toJson(); - } - if (endInteraction != null) { - _json['endInteraction'] = endInteraction.toJson(); - } - if (liveAgentHandoff != null) { - _json['liveAgentHandoff'] = liveAgentHandoff.toJson(); - } - if (mixedAudio != null) { - _json['mixedAudio'] = mixedAudio.toJson(); - } - if (outputAudioText != null) { - _json['outputAudioText'] = outputAudioText.toJson(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (playAudio != null) { - _json['playAudio'] = playAudio.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// Indicates that the conversation succeeded, i.e., the bot handled the issue -/// that the customer talked to it about. -/// -/// Dialogflow only uses this to determine which conversations should be counted -/// as successful and doesn't process the metadata in this message in any way. -/// Note that Dialogflow also considers conversations that get to the -/// conversation end page as successful even if they don't return -/// ConversationSuccess. You may set this, for example: * In the -/// entry_fulfillment of a Page if entering the page indicates that the -/// conversation succeeded. * In a webhook response when you determine that you -/// handled the customer issue. -class GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess { - /// Custom metadata. - /// - /// Dialogflow doesn't impose any structure on this. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess.fromJson( - core.Map _json) { - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (metadata != null) { - _json['metadata'] = metadata; - } - return _json; - } -} - -/// Indicates that interaction with the Dialogflow agent has ended. -/// -/// This message is generated by Dialogflow only and not supposed to be defined -/// by the user. -class GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction { - GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Indicates that the conversation should be handed off to a live agent. -/// -/// Dialogflow only uses this to determine which conversations were handed off -/// to a human agent for measurement purposes. What else to do with this signal -/// is up to you and your handoff procedures. You may set this, for example: * -/// In the entry_fulfillment of a Page if entering the page indicates something -/// went extremely wrong in the conversation. * In a webhook response when you -/// determine that the customer issue can only be handled by a human. -class GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff { - /// Custom metadata for your handoff procedure. - /// - /// Dialogflow doesn't impose any structure on this. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff.fromJson( - core.Map _json) { - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (metadata != null) { - _json['metadata'] = metadata; - } - return _json; - } -} - -/// Represents an audio message that is composed of both segments synthesized -/// from the Dialogflow agent prompts and ones hosted externally at the -/// specified URIs. -/// -/// The external URIs are specified via play_audio. This message is generated by -/// Dialogflow only and not supposed to be defined by the user. -class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio { - /// Segments this audio response is composed of. - core.List<GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment> - segments; - - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio.fromJson( - core.Map _json) { - if (_json.containsKey('segments')) { - segments = (_json['segments'] as core.List) - .map<GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment>( - (value) => - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (segments != null) { - _json['segments'] = segments.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents one segment of audio. -class GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment { - /// Whether the playback of this segment can be interrupted by the end user's - /// speech and the client should then start the next Dialogflow request. - /// - /// Output only. - core.bool allowPlaybackInterruption; - - /// Raw audio synthesized from the Dialogflow agent's response using the - /// output config specified in the request. - core.String audio; - core.List<core.int> get audioAsBytes => convert.base64.decode(audio); - - set audioAsBytes(core.List<core.int> _bytes) { - audio = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Client-specific URI that points to an audio clip accessible to the client. - /// - /// Dialogflow does not impose any validation on it. - core.String uri; - - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment.fromJson( - core.Map _json) { - if (_json.containsKey('allowPlaybackInterruption')) { - allowPlaybackInterruption = - _json['allowPlaybackInterruption'] as core.bool; - } - if (_json.containsKey('audio')) { - audio = _json['audio'] as core.String; - } - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allowPlaybackInterruption != null) { - _json['allowPlaybackInterruption'] = allowPlaybackInterruption; - } - if (audio != null) { - _json['audio'] = audio; - } - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// A text or ssml response that is preferentially used for TTS output audio -/// synthesis, as described in the comment on the ResponseMessage message. -class GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText { - /// Whether the playback of this message can be interrupted by the end user's - /// speech and the client can then starts the next Dialogflow request. - /// - /// Output only. - core.bool allowPlaybackInterruption; - - /// The SSML text to be synthesized. - /// - /// For more information, see \[SSML\](/speech/text-to-speech/docs/ssml). - core.String ssml; - - /// The raw text to be synthesized. - core.String text; - - GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText.fromJson( - core.Map _json) { - if (_json.containsKey('allowPlaybackInterruption')) { - allowPlaybackInterruption = - _json['allowPlaybackInterruption'] as core.bool; - } - if (_json.containsKey('ssml')) { - ssml = _json['ssml'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allowPlaybackInterruption != null) { - _json['allowPlaybackInterruption'] = allowPlaybackInterruption; - } - if (ssml != null) { - _json['ssml'] = ssml; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Specifies an audio clip to be played by the client as part of the response. -class GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio { - /// Whether the playback of this message can be interrupted by the end user's - /// speech and the client can then starts the next Dialogflow request. - /// - /// Output only. - core.bool allowPlaybackInterruption; - - /// URI of the audio clip. - /// - /// Dialogflow does not impose any validation on this value. It is specific to - /// the client that reads it. - /// - /// Required. - core.String audioUri; - - GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio(); - - GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio.fromJson( - core.Map _json) { - if (_json.containsKey('allowPlaybackInterruption')) { - allowPlaybackInterruption = - _json['allowPlaybackInterruption'] as core.bool; - } - if (_json.containsKey('audioUri')) { - audioUri = _json['audioUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allowPlaybackInterruption != null) { - _json['allowPlaybackInterruption'] = allowPlaybackInterruption; - } - if (audioUri != null) { - _json['audioUri'] = audioUri; - } - return _json; - } -} - -/// The text response message. -class GoogleCloudDialogflowCxV3beta1ResponseMessageText { - /// Whether the playback of this message can be interrupted by the end user's - /// speech and the client can then starts the next Dialogflow request. - /// - /// Output only. - core.bool allowPlaybackInterruption; - - /// A collection of text responses. - /// - /// Required. - core.List<core.String> text; - - GoogleCloudDialogflowCxV3beta1ResponseMessageText(); - - GoogleCloudDialogflowCxV3beta1ResponseMessageText.fromJson(core.Map _json) { - if (_json.containsKey('allowPlaybackInterruption')) { - allowPlaybackInterruption = - _json['allowPlaybackInterruption'] as core.bool; - } - if (_json.containsKey('text')) { - text = (_json['text'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allowPlaybackInterruption != null) { - _json['allowPlaybackInterruption'] = allowPlaybackInterruption; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Represents session information communicated to and from the webhook. -class GoogleCloudDialogflowCxV3beta1SessionInfo { - /// Optional for WebhookRequest. - /// - /// Optional for WebhookResponse. All parameters collected from forms and - /// intents during the session. Parameters can be created, updated, or removed - /// by the webhook. To remove a parameter from the session, the webhook should - /// explicitly set the parameter value to null in WebhookResponse. The map is - /// keyed by parameters' display names. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - /// Always present for WebhookRequest. - /// - /// Ignored for WebhookResponse. The unique identifier of the session. This - /// field can be used by the webhook to identify a user. Format: - /// `projects//locations//agents//sessions/`. - core.String session; - - GoogleCloudDialogflowCxV3beta1SessionInfo(); - - GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson(core.Map _json) { - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('session')) { - session = _json['session'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (parameters != null) { - _json['parameters'] = parameters; - } - if (session != null) { - _json['session'] = session; - } - return _json; - } -} - -/// The request message for a webhook call. -class GoogleCloudDialogflowCxV3beta1WebhookRequest { - /// Always present. - /// - /// The unique identifier of the DetectIntentResponse that will be returned to - /// the API caller. - core.String detectIntentResponseId; - - /// Always present. - /// - /// Information about the fulfillment that triggered this webhook call. - GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo fulfillmentInfo; - - /// Information about the last matched intent. - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo intentInfo; - - /// The list of rich message responses to present to the user. - /// - /// Webhook can choose to append or replace this list in - /// WebhookResponse.fulfillment_response; - core.List<GoogleCloudDialogflowCxV3beta1ResponseMessage> messages; - - /// Information about page status. - GoogleCloudDialogflowCxV3beta1PageInfo pageInfo; - - /// Custom data set in QueryParameters.payload. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Information about session status. - GoogleCloudDialogflowCxV3beta1SessionInfo sessionInfo; - - GoogleCloudDialogflowCxV3beta1WebhookRequest(); - - GoogleCloudDialogflowCxV3beta1WebhookRequest.fromJson(core.Map _json) { - if (_json.containsKey('detectIntentResponseId')) { - detectIntentResponseId = _json['detectIntentResponseId'] as core.String; - } - if (_json.containsKey('fulfillmentInfo')) { - fulfillmentInfo = - GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo.fromJson( - _json['fulfillmentInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('intentInfo')) { - intentInfo = - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo.fromJson( - _json['intentInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('messages')) { - messages = (_json['messages'] as core.List) - .map<GoogleCloudDialogflowCxV3beta1ResponseMessage>((value) => - GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('pageInfo')) { - pageInfo = GoogleCloudDialogflowCxV3beta1PageInfo.fromJson( - _json['pageInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('sessionInfo')) { - sessionInfo = GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson( - _json['sessionInfo'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (detectIntentResponseId != null) { - _json['detectIntentResponseId'] = detectIntentResponseId; - } - if (fulfillmentInfo != null) { - _json['fulfillmentInfo'] = fulfillmentInfo.toJson(); - } - if (intentInfo != null) { - _json['intentInfo'] = intentInfo.toJson(); - } - if (messages != null) { - _json['messages'] = messages.map((value) => value.toJson()).toList(); - } - if (pageInfo != null) { - _json['pageInfo'] = pageInfo.toJson(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (sessionInfo != null) { - _json['sessionInfo'] = sessionInfo.toJson(); - } - return _json; - } -} - -/// Represents fulfillment information communicated to the webhook. -class GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo { - /// Always present. - /// - /// The tag used to identify which fulfillment is being called. - core.String tag; - - GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo(); - - GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo.fromJson( - core.Map _json) { - if (_json.containsKey('tag')) { - tag = _json['tag'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (tag != null) { - _json['tag'] = tag; - } - return _json; - } -} - -/// Represents intent information communicated to the webhook. -class GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo { - /// Always present. - /// - /// The unique identifier of the last matched intent. Format: - /// `projects//locations//agents//intents/`. - core.String lastMatchedIntent; - - /// Parameters identified as a result of intent matching. - /// - /// This is a map of the name of the identified parameter to the value of the - /// parameter identified from the user's utterance. All parameters defined in - /// the matched intent that are identified will be surfaced here. - core.Map<core.String, - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue> - parameters; - - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo(); - - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo.fromJson( - core.Map _json) { - if (_json.containsKey('lastMatchedIntent')) { - lastMatchedIntent = _json['lastMatchedIntent'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = - (_json['parameters'] as core.Map).cast<core.String, core.Map>().map( - (key, item) => core.MapEntry( - key, - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue - .fromJson(item as core.Map<core.String, core.dynamic>), - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lastMatchedIntent != null) { - _json['lastMatchedIntent'] = lastMatchedIntent; - } - if (parameters != null) { - _json['parameters'] = - parameters.map((key, item) => core.MapEntry(key, item.toJson())); - } - return _json; - } -} - -/// Represents a value for an intent parameter. -class GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue { - /// Always present. - /// - /// Original text value extracted from user utterance. - core.String originalValue; - - /// Always present. - /// - /// Structured value for the parameter extracted from user utterance. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Object resolvedValue; - - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue(); - - GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue.fromJson( - core.Map _json) { - if (_json.containsKey('originalValue')) { - originalValue = _json['originalValue'] as core.String; - } - if (_json.containsKey('resolvedValue')) { - resolvedValue = _json['resolvedValue'] as core.Object; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (originalValue != null) { - _json['originalValue'] = originalValue; - } - if (resolvedValue != null) { - _json['resolvedValue'] = resolvedValue; - } - return _json; - } -} - -/// The response message for a webhook call. -class GoogleCloudDialogflowCxV3beta1WebhookResponse { - /// The fulfillment response to send to the user. - /// - /// This field can be omitted by the webhook if it does not intend to send any - /// response to the user. - GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse - fulfillmentResponse; - - /// Information about page status. - /// - /// This field can be omitted by the webhook if it does not intend to modify - /// page status. - GoogleCloudDialogflowCxV3beta1PageInfo pageInfo; - - /// Value to append directly to QueryResult.webhook_payloads. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Information about session status. - /// - /// This field can be omitted by the webhook if it does not intend to modify - /// session status. - GoogleCloudDialogflowCxV3beta1SessionInfo sessionInfo; - - /// The target flow to transition to. - /// - /// Format: `projects//locations//agents//flows/`. - core.String targetFlow; - - /// The target page to transition to. - /// - /// Format: `projects//locations//agents//flows//pages/`. - core.String targetPage; - - GoogleCloudDialogflowCxV3beta1WebhookResponse(); - - GoogleCloudDialogflowCxV3beta1WebhookResponse.fromJson(core.Map _json) { - if (_json.containsKey('fulfillmentResponse')) { - fulfillmentResponse = - GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse - .fromJson(_json['fulfillmentResponse'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('pageInfo')) { - pageInfo = GoogleCloudDialogflowCxV3beta1PageInfo.fromJson( - _json['pageInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('sessionInfo')) { - sessionInfo = GoogleCloudDialogflowCxV3beta1SessionInfo.fromJson( - _json['sessionInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('targetFlow')) { - targetFlow = _json['targetFlow'] as core.String; - } - if (_json.containsKey('targetPage')) { - targetPage = _json['targetPage'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fulfillmentResponse != null) { - _json['fulfillmentResponse'] = fulfillmentResponse.toJson(); - } - if (pageInfo != null) { - _json['pageInfo'] = pageInfo.toJson(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (sessionInfo != null) { - _json['sessionInfo'] = sessionInfo.toJson(); - } - if (targetFlow != null) { - _json['targetFlow'] = targetFlow; - } - if (targetPage != null) { - _json['targetPage'] = targetPage; - } - return _json; - } -} - -/// Represents a fulfillment response to the user. -class GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse { - /// Merge behavior for `messages`. - /// Possible string values are: - /// - "MERGE_BEHAVIOR_UNSPECIFIED" : Not specified. `APPEND` will be used. - /// - "APPEND" : `messages` will be appended to the list of messages waiting - /// to be sent to the user. - /// - "REPLACE" : `messages` will replace the list of messages waiting to be - /// sent to the user. - core.String mergeBehavior; - - /// The list of rich message responses to present to the user. - core.List<GoogleCloudDialogflowCxV3beta1ResponseMessage> messages; - - GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse(); - - GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse.fromJson( - core.Map _json) { - if (_json.containsKey('mergeBehavior')) { - mergeBehavior = _json['mergeBehavior'] as core.String; - } - if (_json.containsKey('messages')) { - messages = (_json['messages'] as core.List) - .map<GoogleCloudDialogflowCxV3beta1ResponseMessage>((value) => - GoogleCloudDialogflowCxV3beta1ResponseMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mergeBehavior != null) { - _json['mergeBehavior'] = mergeBehavior; - } - if (messages != null) { - _json['messages'] = messages.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents a part of a message possibly annotated with an entity. -/// -/// The part can be an entity or purely a part of the message between two -/// entities or message start/end. -class GoogleCloudDialogflowV2AnnotatedMessagePart { - /// The - /// [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) - /// of this message part. - /// - /// If this is empty, Dialogflow could not annotate the phrase part with a - /// system entity. - core.String entityType; - - /// The - /// [Dialogflow system entity formatted value ](https://cloud.google.com/dialogflow/docs/reference/system-entities) - /// of this message part. - /// - /// For example for a system entity of type `@sys.unit-currency`, this may - /// contain: { "amount": 5, "currency": "USD" } - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Object formattedValue; - - /// A part of a message possibly annotated with an entity. - core.String text; - - GoogleCloudDialogflowV2AnnotatedMessagePart(); - - GoogleCloudDialogflowV2AnnotatedMessagePart.fromJson(core.Map _json) { - if (_json.containsKey('entityType')) { - entityType = _json['entityType'] as core.String; - } - if (_json.containsKey('formattedValue')) { - formattedValue = _json['formattedValue'] as core.Object; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityType != null) { - _json['entityType'] = entityType; - } - if (formattedValue != null) { - _json['formattedValue'] = formattedValue; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// The response message for EntityTypes.BatchUpdateEntityTypes. -class GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { - /// The collection of updated or created entity types. - core.List<GoogleCloudDialogflowV2EntityType> entityTypes; - - GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse(); - - GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('entityTypes')) { - entityTypes = (_json['entityTypes'] as core.List) - .map<GoogleCloudDialogflowV2EntityType>((value) => - GoogleCloudDialogflowV2EntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypes != null) { - _json['entityTypes'] = - entityTypes.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The response message for Intents.BatchUpdateIntents. -class GoogleCloudDialogflowV2BatchUpdateIntentsResponse { - /// The collection of updated or created intents. - core.List<GoogleCloudDialogflowV2Intent> intents; - - GoogleCloudDialogflowV2BatchUpdateIntentsResponse(); - - GoogleCloudDialogflowV2BatchUpdateIntentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('intents')) { - intents = (_json['intents'] as core.List) - .map<GoogleCloudDialogflowV2Intent>((value) => - GoogleCloudDialogflowV2Intent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intents != null) { - _json['intents'] = intents.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Dialogflow contexts are similar to natural language context. -/// -/// If a person says to you "they are orange", you need context in order to -/// understand what "they" is referring to. Similarly, for Dialogflow to handle -/// an end-user expression like that, it needs to be provided with context in -/// order to correctly match an intent. Using contexts, you can control the flow -/// of a conversation. You can configure contexts for an intent by setting input -/// and output contexts, which are identified by string names. When an intent is -/// matched, any configured output contexts for that intent become active. While -/// any contexts are active, Dialogflow is more likely to match intents that are -/// configured with input contexts that correspond to the currently active -/// contexts. For more information about context, see the -/// [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). -class GoogleCloudDialogflowV2Context { - /// The number of conversational query requests after which the context - /// expires. - /// - /// The default is `0`. If set to `0`, the context expires immediately. - /// Contexts expire automatically after 20 minutes if there are no matching - /// queries. - /// - /// Optional. - core.int lifespanCount; - - /// The unique identifier of the context. - /// - /// Format: `projects//agent/sessions//contexts/`, or - /// `projects//agent/environments//users//sessions//contexts/`. The `Context - /// ID` is always converted to lowercase, may only contain characters in - /// a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not - /// specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// - /// Required. - core.String name; - - /// The collection of parameters associated with this context. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - GoogleCloudDialogflowV2Context(); - - GoogleCloudDialogflowV2Context.fromJson(core.Map _json) { - if (_json.containsKey('lifespanCount')) { - lifespanCount = _json['lifespanCount'] as core.int; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lifespanCount != null) { - _json['lifespanCount'] = lifespanCount; - } - if (name != null) { - _json['name'] = name; - } - if (parameters != null) { - _json['parameters'] = parameters; - } - return _json; - } -} - -/// Represents a notification sent to Pub/Sub subscribers for conversation -/// lifecycle events. -class GoogleCloudDialogflowV2ConversationEvent { - /// The unique identifier of the conversation this notification refers to. - /// - /// Format: `projects//conversations/`. - core.String conversation; - - /// More detailed information about an error. - /// - /// Only set for type UNRECOVERABLE_ERROR_IN_PHONE_CALL. - GoogleRpcStatus errorStatus; - - /// Payload of NEW_MESSAGE event. - GoogleCloudDialogflowV2Message newMessagePayload; - - /// The type of the event that this notification refers to. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : Type not set. - /// - "CONVERSATION_STARTED" : A new conversation has been opened. This is - /// fired when a telephone call is answered, or a conversation is created via - /// the API. - /// - "CONVERSATION_FINISHED" : An existing conversation has closed. This is - /// fired when a telephone call is terminated, or a conversation is closed via - /// the API. - /// - "HUMAN_INTERVENTION_NEEDED" : An existing conversation has received - /// notification from Dialogflow that human intervention is required. - /// - "NEW_MESSAGE" : An existing conversation has received a new message, - /// either from API or telephony. It is configured in - /// ConversationProfile.new_message_event_notification_config - /// - "UNRECOVERABLE_ERROR" : Unrecoverable error during a telephone call. In - /// general non-recoverable errors only occur if something was misconfigured - /// in the ConversationProfile corresponding to the call. After a - /// non-recoverable error, Dialogflow may stop responding. We don't fire this - /// event: * in an API call because we can directly return the error, or, * - /// when we can recover from an error. - core.String type; - - GoogleCloudDialogflowV2ConversationEvent(); - - GoogleCloudDialogflowV2ConversationEvent.fromJson(core.Map _json) { - if (_json.containsKey('conversation')) { - conversation = _json['conversation'] as core.String; - } - if (_json.containsKey('errorStatus')) { - errorStatus = GoogleRpcStatus.fromJson( - _json['errorStatus'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('newMessagePayload')) { - newMessagePayload = GoogleCloudDialogflowV2Message.fromJson( - _json['newMessagePayload'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (conversation != null) { - _json['conversation'] = conversation; - } - if (errorStatus != null) { - _json['errorStatus'] = errorStatus.toJson(); - } - if (newMessagePayload != null) { - _json['newMessagePayload'] = newMessagePayload.toJson(); - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Each intent parameter has a type, called the entity type, which dictates -/// exactly how data from an end-user expression is extracted. -/// -/// Dialogflow provides predefined system entities that can match many common -/// types of data. For example, there are system entities for matching dates, -/// times, colors, email addresses, and so on. You can also create your own -/// custom entities for matching custom data. For example, you could define a -/// vegetable entity that can match the types of vegetables available for -/// purchase with a grocery store agent. For more information, see the -/// [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). -class GoogleCloudDialogflowV2EntityType { - /// Indicates whether the entity type can be automatically expanded. - /// - /// Optional. - /// Possible string values are: - /// - "AUTO_EXPANSION_MODE_UNSPECIFIED" : Auto expansion disabled for the - /// entity. - /// - "AUTO_EXPANSION_MODE_DEFAULT" : Allows an agent to recognize values that - /// have not been explicitly listed in the entity. - core.String autoExpansionMode; - - /// The name of the entity type. - /// - /// Required. - core.String displayName; - - /// Enables fuzzy entity extraction during classification. - /// - /// Optional. - core.bool enableFuzzyExtraction; - - /// The collection of entity entries associated with the entity type. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2EntityTypeEntity> entities; - - /// Indicates the kind of entity type. - /// - /// Required. - /// Possible string values are: - /// - "KIND_UNSPECIFIED" : Not specified. This value should be never used. - /// - "KIND_MAP" : Map entity types allow mapping of a group of synonyms to a - /// reference value. - /// - "KIND_LIST" : List entity types contain a set of entries that do not map - /// to reference values. However, list entity types can contain references to - /// other entity types (with or without aliases). - /// - "KIND_REGEXP" : Regexp entity types allow to specify regular expressions - /// in entries values. - core.String kind; - - /// The unique identifier of the entity type. - /// - /// Required for EntityTypes.UpdateEntityType and - /// EntityTypes.BatchUpdateEntityTypes methods. Format: - /// `projects//agent/entityTypes/`. - core.String name; - - GoogleCloudDialogflowV2EntityType(); - - GoogleCloudDialogflowV2EntityType.fromJson(core.Map _json) { - if (_json.containsKey('autoExpansionMode')) { - autoExpansionMode = _json['autoExpansionMode'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enableFuzzyExtraction')) { - enableFuzzyExtraction = _json['enableFuzzyExtraction'] as core.bool; - } - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => - GoogleCloudDialogflowV2EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('kind')) { - kind = _json['kind'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (autoExpansionMode != null) { - _json['autoExpansionMode'] = autoExpansionMode; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enableFuzzyExtraction != null) { - _json['enableFuzzyExtraction'] = enableFuzzyExtraction; - } - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (kind != null) { - _json['kind'] = kind; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// An **entity entry** for an associated entity type. -class GoogleCloudDialogflowV2EntityTypeEntity { - /// A collection of value synonyms. - /// - /// For example, if the entity type is *vegetable*, and `value` is - /// *scallions*, a synonym could be *green onions*. For `KIND_LIST` entity - /// types: * This collection must contain exactly one synonym equal to - /// `value`. - /// - /// Required. - core.List<core.String> synonyms; - - /// The primary value associated with this entity entry. - /// - /// For example, if the entity type is *vegetable*, the value could be - /// *scallions*. For `KIND_MAP` entity types: * A reference value to be used - /// in place of synonyms. For `KIND_LIST` entity types: * A string that can - /// contain references to other entity types (with or without aliases). - /// - /// Required. - core.String value; - - GoogleCloudDialogflowV2EntityTypeEntity(); - - GoogleCloudDialogflowV2EntityTypeEntity.fromJson(core.Map _json) { - if (_json.containsKey('synonyms')) { - synonyms = (_json['synonyms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (synonyms != null) { - _json['synonyms'] = synonyms; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// Events allow for matching intents by event name instead of the natural -/// language input. -/// -/// For instance, input `` can trigger a personalized welcome response. The -/// parameter `name` may be used by the agent in the response: `"Hello -/// #welcome_event.name! What can I do for you today?"`. -class GoogleCloudDialogflowV2EventInput { - /// The language of this query. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - /// - /// Required. - core.String languageCode; - - /// The unique identifier of the event. - /// - /// Required. - core.String name; - - /// The collection of parameters associated with the event. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - GoogleCloudDialogflowV2EventInput(); - - GoogleCloudDialogflowV2EventInput.fromJson(core.Map _json) { - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (name != null) { - _json['name'] = name; - } - if (parameters != null) { - _json['parameters'] = parameters; - } - return _json; - } -} - -/// The response message for Agents.ExportAgent. -class GoogleCloudDialogflowV2ExportAgentResponse { - /// Zip compressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a file containing the exported agent. - /// - /// This field is populated only if `agent_uri` is specified in - /// `ExportAgentRequest`. - core.String agentUri; - - GoogleCloudDialogflowV2ExportAgentResponse(); - - GoogleCloudDialogflowV2ExportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// Response message for Documents.ImportDocuments. -class GoogleCloudDialogflowV2ImportDocumentsResponse { - /// Includes details about skipped documents or any other warnings. - core.List<GoogleRpcStatus> warnings; - - GoogleCloudDialogflowV2ImportDocumentsResponse(); - - GoogleCloudDialogflowV2ImportDocumentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('warnings')) { - warnings = (_json['warnings'] as core.List) - .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (warnings != null) { - _json['warnings'] = warnings.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An intent categorizes an end-user's intention for one conversation turn. -/// -/// For each agent, you define many intents, where your combined intents can -/// handle a complete conversation. When an end-user writes or says something, -/// referred to as an end-user expression or end-user input, Dialogflow matches -/// the end-user input to the best intent in your agent. Matching an intent is -/// also known as intent classification. For more information, see the -/// [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview). -class GoogleCloudDialogflowV2Intent { - /// The name of the action associated with the intent. - /// - /// Note: The action name must not contain whitespaces. - /// - /// Optional. - core.String action; - - /// The list of platforms for which the first responses will be copied from - /// the messages in PLATFORM_UNSPECIFIED (i.e. default platform). - /// - /// Optional. - core.List<core.String> defaultResponsePlatforms; - - /// The name of this intent. - /// - /// Required. - core.String displayName; - - /// The collection of event names that trigger the intent. - /// - /// If the collection of input contexts is not empty, all of the contexts must - /// be present in the active user session for an event to trigger this intent. - /// Event names are limited to 150 characters. - /// - /// Optional. - core.List<core.String> events; - - /// Read-only. - /// - /// Information about all followup intents that have this intent as a direct - /// or indirect parent. We populate this field only in the output. - core.List<GoogleCloudDialogflowV2IntentFollowupIntentInfo> followupIntentInfo; - - /// The list of context names required for this intent to be triggered. - /// - /// Format: `projects//agent/sessions/-/contexts/`. - /// - /// Optional. - core.List<core.String> inputContextNames; - - /// Indicates whether this is a fallback intent. - /// - /// Optional. - core.bool isFallback; - - /// The collection of rich messages corresponding to the `Response` field in - /// the Dialogflow console. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessage> messages; - - /// Indicates whether Machine Learning is disabled for the intent. - /// - /// Note: If `ml_disabled` setting is set to true, then this intent is not - /// taken into account during inference in `ML ONLY` match mode. Also, - /// auto-markup in the UI is turned off. - /// - /// Optional. - core.bool mlDisabled; - - /// The unique identifier of this intent. - /// - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. - /// Format: `projects//agent/intents/`. - /// - /// Optional. - core.String name; - - /// The collection of contexts that are activated when the intent is matched. - /// - /// Context messages in this collection should not set the parameters field. - /// Setting the `lifespan_count` to 0 will reset the context when the intent - /// is matched. Format: `projects//agent/sessions/-/contexts/`. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2Context> outputContexts; - - /// The collection of parameters associated with the intent. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentParameter> parameters; - - /// Read-only after creation. - /// - /// The unique identifier of the parent intent in the chain of followup - /// intents. You can set this field when creating an intent, for example with - /// CreateIntent or BatchUpdateIntents, in order to make this intent a - /// followup intent. It identifies the parent followup intent. Format: - /// `projects//agent/intents/`. - core.String parentFollowupIntentName; - - /// The priority of this intent. - /// - /// Higher numbers represent higher priorities. - If the supplied value is - /// unspecified or 0, the service translates the value to 500,000, which - /// corresponds to the `Normal` priority in the console. - If the supplied - /// value is negative, the intent is ignored in runtime detect intent - /// requests. - /// - /// Optional. - core.int priority; - - /// Indicates whether to delete all contexts in the current session when this - /// intent is matched. - /// - /// Optional. - core.bool resetContexts; - - /// Read-only. - /// - /// The unique identifier of the root intent in the chain of followup intents. - /// It identifies the correct followup intents chain for this intent. We - /// populate this field only in the output. Format: - /// `projects//agent/intents/`. - core.String rootFollowupIntentName; - - /// The collection of examples that the agent is trained on. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentTrainingPhrase> trainingPhrases; - - /// Indicates whether webhooks are enabled for the intent. - /// - /// Optional. - /// Possible string values are: - /// - "WEBHOOK_STATE_UNSPECIFIED" : Webhook is disabled in the agent and in - /// the intent. - /// - "WEBHOOK_STATE_ENABLED" : Webhook is enabled in the agent and in the - /// intent. - /// - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" : Webhook is enabled in the - /// agent and in the intent. Also, each slot filling prompt is forwarded to - /// the webhook. - core.String webhookState; - - GoogleCloudDialogflowV2Intent(); - - GoogleCloudDialogflowV2Intent.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('defaultResponsePlatforms')) { - defaultResponsePlatforms = - (_json['defaultResponsePlatforms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('events')) { - events = (_json['events'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('followupIntentInfo')) { - followupIntentInfo = (_json['followupIntentInfo'] as core.List) - .map<GoogleCloudDialogflowV2IntentFollowupIntentInfo>((value) => - GoogleCloudDialogflowV2IntentFollowupIntentInfo.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('inputContextNames')) { - inputContextNames = (_json['inputContextNames'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('isFallback')) { - isFallback = _json['isFallback'] as core.bool; - } - if (_json.containsKey('messages')) { - messages = (_json['messages'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessage>((value) => - GoogleCloudDialogflowV2IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('mlDisabled')) { - mlDisabled = _json['mlDisabled'] as core.bool; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2Context>((value) => - GoogleCloudDialogflowV2Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.List) - .map<GoogleCloudDialogflowV2IntentParameter>((value) => - GoogleCloudDialogflowV2IntentParameter.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parentFollowupIntentName')) { - parentFollowupIntentName = - _json['parentFollowupIntentName'] as core.String; - } - if (_json.containsKey('priority')) { - priority = _json['priority'] as core.int; - } - if (_json.containsKey('resetContexts')) { - resetContexts = _json['resetContexts'] as core.bool; - } - if (_json.containsKey('rootFollowupIntentName')) { - rootFollowupIntentName = _json['rootFollowupIntentName'] as core.String; - } - if (_json.containsKey('trainingPhrases')) { - trainingPhrases = (_json['trainingPhrases'] as core.List) - .map<GoogleCloudDialogflowV2IntentTrainingPhrase>((value) => - GoogleCloudDialogflowV2IntentTrainingPhrase.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('webhookState')) { - webhookState = _json['webhookState'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (defaultResponsePlatforms != null) { - _json['defaultResponsePlatforms'] = defaultResponsePlatforms; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (events != null) { - _json['events'] = events; - } - if (followupIntentInfo != null) { - _json['followupIntentInfo'] = - followupIntentInfo.map((value) => value.toJson()).toList(); - } - if (inputContextNames != null) { - _json['inputContextNames'] = inputContextNames; - } - if (isFallback != null) { - _json['isFallback'] = isFallback; - } - if (messages != null) { - _json['messages'] = messages.map((value) => value.toJson()).toList(); - } - if (mlDisabled != null) { - _json['mlDisabled'] = mlDisabled; - } - if (name != null) { - _json['name'] = name; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (parameters != null) { - _json['parameters'] = parameters.map((value) => value.toJson()).toList(); - } - if (parentFollowupIntentName != null) { - _json['parentFollowupIntentName'] = parentFollowupIntentName; - } - if (priority != null) { - _json['priority'] = priority; - } - if (resetContexts != null) { - _json['resetContexts'] = resetContexts; - } - if (rootFollowupIntentName != null) { - _json['rootFollowupIntentName'] = rootFollowupIntentName; - } - if (trainingPhrases != null) { - _json['trainingPhrases'] = - trainingPhrases.map((value) => value.toJson()).toList(); - } - if (webhookState != null) { - _json['webhookState'] = webhookState; - } - return _json; - } -} - -/// Represents a single followup intent in the chain. -class GoogleCloudDialogflowV2IntentFollowupIntentInfo { - /// The unique identifier of the followup intent. - /// - /// Format: `projects//agent/intents/`. - core.String followupIntentName; - - /// The unique identifier of the followup intent's parent. - /// - /// Format: `projects//agent/intents/`. - core.String parentFollowupIntentName; - - GoogleCloudDialogflowV2IntentFollowupIntentInfo(); - - GoogleCloudDialogflowV2IntentFollowupIntentInfo.fromJson(core.Map _json) { - if (_json.containsKey('followupIntentName')) { - followupIntentName = _json['followupIntentName'] as core.String; - } - if (_json.containsKey('parentFollowupIntentName')) { - parentFollowupIntentName = - _json['parentFollowupIntentName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (followupIntentName != null) { - _json['followupIntentName'] = followupIntentName; - } - if (parentFollowupIntentName != null) { - _json['parentFollowupIntentName'] = parentFollowupIntentName; - } - return _json; - } -} - -/// A rich response message. -/// -/// Corresponds to the intent `Response` field in the Dialogflow console. For -/// more information, see -/// [Rich response messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). -class GoogleCloudDialogflowV2IntentMessage { - /// The basic card response for Actions on Google. - GoogleCloudDialogflowV2IntentMessageBasicCard basicCard; - - /// Browse carousel card for Actions on Google. - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard browseCarouselCard; - - /// The card response. - GoogleCloudDialogflowV2IntentMessageCard card; - - /// The carousel card response for Actions on Google. - GoogleCloudDialogflowV2IntentMessageCarouselSelect carouselSelect; - - /// The image response. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// The link out suggestion chip for Actions on Google. - GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion linkOutSuggestion; - - /// The list card response for Actions on Google. - GoogleCloudDialogflowV2IntentMessageListSelect listSelect; - - /// The media content card for Actions on Google. - GoogleCloudDialogflowV2IntentMessageMediaContent mediaContent; - - /// A custom platform-specific response. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// The platform that this message is intended for. - /// - /// Optional. - /// Possible string values are: - /// - "PLATFORM_UNSPECIFIED" : Default platform. - /// - "FACEBOOK" : Facebook. - /// - "SLACK" : Slack. - /// - "TELEGRAM" : Telegram. - /// - "KIK" : Kik. - /// - "SKYPE" : Skype. - /// - "LINE" : Line. - /// - "VIBER" : Viber. - /// - "ACTIONS_ON_GOOGLE" : Google Assistant See - /// [Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - /// - "GOOGLE_HANGOUTS" : Google Hangouts. - core.String platform; - - /// The quick replies response. - GoogleCloudDialogflowV2IntentMessageQuickReplies quickReplies; - - /// The voice and text-only responses for Actions on Google. - GoogleCloudDialogflowV2IntentMessageSimpleResponses simpleResponses; - - /// The suggestion chips for Actions on Google. - GoogleCloudDialogflowV2IntentMessageSuggestions suggestions; - - /// Table card for Actions on Google. - GoogleCloudDialogflowV2IntentMessageTableCard tableCard; - - /// The text response. - GoogleCloudDialogflowV2IntentMessageText text; - - GoogleCloudDialogflowV2IntentMessage(); - - GoogleCloudDialogflowV2IntentMessage.fromJson(core.Map _json) { - if (_json.containsKey('basicCard')) { - basicCard = GoogleCloudDialogflowV2IntentMessageBasicCard.fromJson( - _json['basicCard'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('browseCarouselCard')) { - browseCarouselCard = - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard.fromJson( - _json['browseCarouselCard'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('card')) { - card = GoogleCloudDialogflowV2IntentMessageCard.fromJson( - _json['card'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('carouselSelect')) { - carouselSelect = - GoogleCloudDialogflowV2IntentMessageCarouselSelect.fromJson( - _json['carouselSelect'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('linkOutSuggestion')) { - linkOutSuggestion = - GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion.fromJson( - _json['linkOutSuggestion'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('listSelect')) { - listSelect = GoogleCloudDialogflowV2IntentMessageListSelect.fromJson( - _json['listSelect'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('mediaContent')) { - mediaContent = GoogleCloudDialogflowV2IntentMessageMediaContent.fromJson( - _json['mediaContent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('platform')) { - platform = _json['platform'] as core.String; - } - if (_json.containsKey('quickReplies')) { - quickReplies = GoogleCloudDialogflowV2IntentMessageQuickReplies.fromJson( - _json['quickReplies'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('simpleResponses')) { - simpleResponses = - GoogleCloudDialogflowV2IntentMessageSimpleResponses.fromJson( - _json['simpleResponses'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('suggestions')) { - suggestions = GoogleCloudDialogflowV2IntentMessageSuggestions.fromJson( - _json['suggestions'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('tableCard')) { - tableCard = GoogleCloudDialogflowV2IntentMessageTableCard.fromJson( - _json['tableCard'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = GoogleCloudDialogflowV2IntentMessageText.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (basicCard != null) { - _json['basicCard'] = basicCard.toJson(); - } - if (browseCarouselCard != null) { - _json['browseCarouselCard'] = browseCarouselCard.toJson(); - } - if (card != null) { - _json['card'] = card.toJson(); - } - if (carouselSelect != null) { - _json['carouselSelect'] = carouselSelect.toJson(); - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (linkOutSuggestion != null) { - _json['linkOutSuggestion'] = linkOutSuggestion.toJson(); - } - if (listSelect != null) { - _json['listSelect'] = listSelect.toJson(); - } - if (mediaContent != null) { - _json['mediaContent'] = mediaContent.toJson(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (platform != null) { - _json['platform'] = platform; - } - if (quickReplies != null) { - _json['quickReplies'] = quickReplies.toJson(); - } - if (simpleResponses != null) { - _json['simpleResponses'] = simpleResponses.toJson(); - } - if (suggestions != null) { - _json['suggestions'] = suggestions.toJson(); - } - if (tableCard != null) { - _json['tableCard'] = tableCard.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// The basic card message. -/// -/// Useful for displaying information. -class GoogleCloudDialogflowV2IntentMessageBasicCard { - /// The collection of card buttons. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageBasicCardButton> buttons; - - /// Required, unless image is present. - /// - /// The body text of the card. - core.String formattedText; - - /// The image for the card. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// The subtitle of the card. - /// - /// Optional. - core.String subtitle; - - /// The title of the card. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2IntentMessageBasicCard(); - - GoogleCloudDialogflowV2IntentMessageBasicCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageBasicCardButton>((value) => - GoogleCloudDialogflowV2IntentMessageBasicCardButton.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('formattedText')) { - formattedText = _json['formattedText'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (formattedText != null) { - _json['formattedText'] = formattedText; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The button object that appears at the bottom of a card. -class GoogleCloudDialogflowV2IntentMessageBasicCardButton { - /// Action to take when a user taps on the button. - /// - /// Required. - GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction - openUriAction; - - /// The title of the button. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageBasicCardButton(); - - GoogleCloudDialogflowV2IntentMessageBasicCardButton.fromJson(core.Map _json) { - if (_json.containsKey('openUriAction')) { - openUriAction = - GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction - .fromJson(_json['openUriAction'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (openUriAction != null) { - _json['openUriAction'] = openUriAction.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Opens the given URI. -class GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { - /// The HTTP or HTTPS scheme URI. - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction(); - - GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction.fromJson( - core.Map _json) { - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// Browse Carousel Card for Actions on Google. -/// -/// https://developers.google.com/actions/assistant/responses#browsing_carousel -class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard { - /// Settings for displaying the image. - /// - /// Applies to every image in items. - /// - /// Optional. - /// Possible string values are: - /// - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : Fill the gaps between the image - /// and the image container with gray bars. - /// - "GRAY" : Fill the gaps between the image and the image container with - /// gray bars. - /// - "WHITE" : Fill the gaps between the image and the image container with - /// white bars. - /// - "CROPPED" : Image is scaled such that the image width and height match - /// or exceed the container dimensions. This may crop the top and bottom of - /// the image if the scaled image height is greater than the container height, - /// or crop the left and right of the image if the scaled image width is - /// greater than the container width. This is similar to "Zoom Mode" on a - /// widescreen TV when playing a 4:3 video. - /// - "BLURRED_BACKGROUND" : Pad the gaps between image and image frame with a - /// blurred copy of the same image. - core.String imageDisplayOptions; - - /// List of items in the Browse Carousel Card. - /// - /// Minimum of two items, maximum of ten. - /// - /// Required. - core.List< - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem> - items; - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard(); - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard.fromJson( - core.Map _json) { - if (_json.containsKey('imageDisplayOptions')) { - imageDisplayOptions = _json['imageDisplayOptions'] as core.String; - } - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem>( - (value) => - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (imageDisplayOptions != null) { - _json['imageDisplayOptions'] = imageDisplayOptions; - } - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Browsing carousel tile -class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem { - /// Description of the carousel item. - /// - /// Maximum of four lines of text. - /// - /// Optional. - core.String description; - - /// Text that appears at the bottom of the Browse Carousel Card. - /// - /// Maximum of one line of text. - /// - /// Optional. - core.String footer; - - /// Hero image for the carousel item. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// Action to present to the user. - /// - /// Required. - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction - openUriAction; - - /// Title of the carousel item. - /// - /// Maximum of two lines of text. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem(); - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('footer')) { - footer = _json['footer'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('openUriAction')) { - openUriAction = - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction - .fromJson(_json['openUriAction'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (footer != null) { - _json['footer'] = footer; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (openUriAction != null) { - _json['openUriAction'] = openUriAction.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Actions on Google action to open a given url. -class GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { - /// URL - /// - /// Required. - core.String url; - - /// Specifies the type of viewer that is used when opening the URL. - /// - /// Defaults to opening via web browser. - /// - /// Optional. - /// Possible string values are: - /// - "URL_TYPE_HINT_UNSPECIFIED" : Unspecified - /// - "AMP_ACTION" : Url would be an amp action - /// - "AMP_CONTENT" : URL that points directly to AMP content, or to a - /// canonical URL which refers to AMP content via . - core.String urlTypeHint; - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction(); - - GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.fromJson( - core.Map _json) { - if (_json.containsKey('url')) { - url = _json['url'] as core.String; - } - if (_json.containsKey('urlTypeHint')) { - urlTypeHint = _json['urlTypeHint'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (url != null) { - _json['url'] = url; - } - if (urlTypeHint != null) { - _json['urlTypeHint'] = urlTypeHint; - } - return _json; - } -} - -/// The card response message. -class GoogleCloudDialogflowV2IntentMessageCard { - /// The collection of card buttons. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageCardButton> buttons; - - /// The public URI to an image file for the card. - /// - /// Optional. - core.String imageUri; - - /// The subtitle of the card. - /// - /// Optional. - core.String subtitle; - - /// The title of the card. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2IntentMessageCard(); - - GoogleCloudDialogflowV2IntentMessageCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageCardButton>((value) => - GoogleCloudDialogflowV2IntentMessageCardButton.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('imageUri')) { - imageUri = _json['imageUri'] as core.String; - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (imageUri != null) { - _json['imageUri'] = imageUri; - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Contains information about a button. -class GoogleCloudDialogflowV2IntentMessageCardButton { - /// The text to send back to the Dialogflow API or a URI to open. - /// - /// Optional. - core.String postback; - - /// The text to show on the button. - /// - /// Optional. - core.String text; - - GoogleCloudDialogflowV2IntentMessageCardButton(); - - GoogleCloudDialogflowV2IntentMessageCardButton.fromJson(core.Map _json) { - if (_json.containsKey('postback')) { - postback = _json['postback'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (postback != null) { - _json['postback'] = postback; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// The card for presenting a carousel of options to select from. -class GoogleCloudDialogflowV2IntentMessageCarouselSelect { - /// Carousel items. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentMessageCarouselSelectItem> items; - - GoogleCloudDialogflowV2IntentMessageCarouselSelect(); - - GoogleCloudDialogflowV2IntentMessageCarouselSelect.fromJson(core.Map _json) { - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageCarouselSelectItem>( - (value) => GoogleCloudDialogflowV2IntentMessageCarouselSelectItem - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An item in the carousel. -class GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { - /// The body text of the card. - /// - /// Optional. - core.String description; - - /// The image to display. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// Additional info about the option item. - /// - /// Required. - GoogleCloudDialogflowV2IntentMessageSelectItemInfo info; - - /// Title of the carousel item. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageCarouselSelectItem(); - - GoogleCloudDialogflowV2IntentMessageCarouselSelectItem.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('info')) { - info = GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson( - _json['info'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (info != null) { - _json['info'] = info.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Column properties for TableCard. -class GoogleCloudDialogflowV2IntentMessageColumnProperties { - /// Column heading. - /// - /// Required. - core.String header; - - /// Defines text alignment for all cells in this column. - /// - /// Optional. - /// Possible string values are: - /// - "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : Text is aligned to the leading edge - /// of the column. - /// - "LEADING" : Text is aligned to the leading edge of the column. - /// - "CENTER" : Text is centered in the column. - /// - "TRAILING" : Text is aligned to the trailing edge of the column. - core.String horizontalAlignment; - - GoogleCloudDialogflowV2IntentMessageColumnProperties(); - - GoogleCloudDialogflowV2IntentMessageColumnProperties.fromJson( - core.Map _json) { - if (_json.containsKey('header')) { - header = _json['header'] as core.String; - } - if (_json.containsKey('horizontalAlignment')) { - horizontalAlignment = _json['horizontalAlignment'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (header != null) { - _json['header'] = header; - } - if (horizontalAlignment != null) { - _json['horizontalAlignment'] = horizontalAlignment; - } - return _json; - } -} - -/// The image response message. -class GoogleCloudDialogflowV2IntentMessageImage { - /// A text description of the image to be used for accessibility, e.g., screen - /// readers. - /// - /// Optional. - core.String accessibilityText; - - /// The public URI to an image file. - /// - /// Optional. - core.String imageUri; - - GoogleCloudDialogflowV2IntentMessageImage(); - - GoogleCloudDialogflowV2IntentMessageImage.fromJson(core.Map _json) { - if (_json.containsKey('accessibilityText')) { - accessibilityText = _json['accessibilityText'] as core.String; - } - if (_json.containsKey('imageUri')) { - imageUri = _json['imageUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (accessibilityText != null) { - _json['accessibilityText'] = accessibilityText; - } - if (imageUri != null) { - _json['imageUri'] = imageUri; - } - return _json; - } -} - -/// The suggestion chip message that allows the user to jump out to the app or -/// website associated with this agent. -class GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { - /// The name of the app or site this chip is linking to. - /// - /// Required. - core.String destinationName; - - /// The URI of the app or site to open when the user taps the suggestion chip. - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion(); - - GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion.fromJson( - core.Map _json) { - if (_json.containsKey('destinationName')) { - destinationName = _json['destinationName'] as core.String; - } - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (destinationName != null) { - _json['destinationName'] = destinationName; - } - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// The card for presenting a list of options to select from. -class GoogleCloudDialogflowV2IntentMessageListSelect { - /// List items. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentMessageListSelectItem> items; - - /// Subtitle of the list. - /// - /// Optional. - core.String subtitle; - - /// The overall title of the list. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2IntentMessageListSelect(); - - GoogleCloudDialogflowV2IntentMessageListSelect.fromJson(core.Map _json) { - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageListSelectItem>((value) => - GoogleCloudDialogflowV2IntentMessageListSelectItem.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// An item in the list. -class GoogleCloudDialogflowV2IntentMessageListSelectItem { - /// The main text describing the item. - /// - /// Optional. - core.String description; - - /// The image to display. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// Additional information about this option. - /// - /// Required. - GoogleCloudDialogflowV2IntentMessageSelectItemInfo info; - - /// The title of the list item. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageListSelectItem(); - - GoogleCloudDialogflowV2IntentMessageListSelectItem.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('info')) { - info = GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson( - _json['info'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (info != null) { - _json['info'] = info.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The media content card for Actions on Google. -class GoogleCloudDialogflowV2IntentMessageMediaContent { - /// List of media objects. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject> - mediaObjects; - - /// What type of media is the content (ie "audio"). - /// - /// Optional. - /// Possible string values are: - /// - "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : Unspecified. - /// - "AUDIO" : Response media type is audio. - core.String mediaType; - - GoogleCloudDialogflowV2IntentMessageMediaContent(); - - GoogleCloudDialogflowV2IntentMessageMediaContent.fromJson(core.Map _json) { - if (_json.containsKey('mediaObjects')) { - mediaObjects = (_json['mediaObjects'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject>( - (value) => - GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('mediaType')) { - mediaType = _json['mediaType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mediaObjects != null) { - _json['mediaObjects'] = - mediaObjects.map((value) => value.toJson()).toList(); - } - if (mediaType != null) { - _json['mediaType'] = mediaType; - } - return _json; - } -} - -/// Response media object for media content card. -class GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject { - /// Url where the media is stored. - /// - /// Required. - core.String contentUrl; - - /// Description of media card. - /// - /// Optional. - core.String description; - - /// Icon to display above media content. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage icon; - - /// Image to display above media content. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage largeImage; - - /// Name of media card. - /// - /// Required. - core.String name; - - GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject(); - - GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject.fromJson( - core.Map _json) { - if (_json.containsKey('contentUrl')) { - contentUrl = _json['contentUrl'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('icon')) { - icon = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['icon'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('largeImage')) { - largeImage = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['largeImage'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (contentUrl != null) { - _json['contentUrl'] = contentUrl; - } - if (description != null) { - _json['description'] = description; - } - if (icon != null) { - _json['icon'] = icon.toJson(); - } - if (largeImage != null) { - _json['largeImage'] = largeImage.toJson(); - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The quick replies response message. -class GoogleCloudDialogflowV2IntentMessageQuickReplies { - /// The collection of quick replies. - /// - /// Optional. - core.List<core.String> quickReplies; - - /// The title of the collection of quick replies. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2IntentMessageQuickReplies(); - - GoogleCloudDialogflowV2IntentMessageQuickReplies.fromJson(core.Map _json) { - if (_json.containsKey('quickReplies')) { - quickReplies = (_json['quickReplies'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (quickReplies != null) { - _json['quickReplies'] = quickReplies; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Additional info about the select item for when it is triggered in a dialog. -class GoogleCloudDialogflowV2IntentMessageSelectItemInfo { - /// A unique key that will be sent back to the agent if this response is - /// given. - /// - /// Required. - core.String key; - - /// A list of synonyms that can also be used to trigger this item in dialog. - /// - /// Optional. - core.List<core.String> synonyms; - - GoogleCloudDialogflowV2IntentMessageSelectItemInfo(); - - GoogleCloudDialogflowV2IntentMessageSelectItemInfo.fromJson(core.Map _json) { - if (_json.containsKey('key')) { - key = _json['key'] as core.String; - } - if (_json.containsKey('synonyms')) { - synonyms = (_json['synonyms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (key != null) { - _json['key'] = key; - } - if (synonyms != null) { - _json['synonyms'] = synonyms; - } - return _json; - } -} - -/// The simple response message containing speech or text. -class GoogleCloudDialogflowV2IntentMessageSimpleResponse { - /// The text to display. - /// - /// Optional. - core.String displayText; - - /// One of text_to_speech or ssml must be provided. - /// - /// Structured spoken response to the user in the SSML format. Mutually - /// exclusive with text_to_speech. - core.String ssml; - - /// One of text_to_speech or ssml must be provided. - /// - /// The plain text of the speech output. Mutually exclusive with ssml. - core.String textToSpeech; - - GoogleCloudDialogflowV2IntentMessageSimpleResponse(); - - GoogleCloudDialogflowV2IntentMessageSimpleResponse.fromJson(core.Map _json) { - if (_json.containsKey('displayText')) { - displayText = _json['displayText'] as core.String; - } - if (_json.containsKey('ssml')) { - ssml = _json['ssml'] as core.String; - } - if (_json.containsKey('textToSpeech')) { - textToSpeech = _json['textToSpeech'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayText != null) { - _json['displayText'] = displayText; - } - if (ssml != null) { - _json['ssml'] = ssml; - } - if (textToSpeech != null) { - _json['textToSpeech'] = textToSpeech; - } - return _json; - } -} - -/// The collection of simple response candidates. -/// -/// This message in `QueryResult.fulfillment_messages` and -/// `WebhookResponse.fulfillment_messages` should contain only one -/// `SimpleResponse`. -class GoogleCloudDialogflowV2IntentMessageSimpleResponses { - /// The list of simple responses. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentMessageSimpleResponse> simpleResponses; - - GoogleCloudDialogflowV2IntentMessageSimpleResponses(); - - GoogleCloudDialogflowV2IntentMessageSimpleResponses.fromJson(core.Map _json) { - if (_json.containsKey('simpleResponses')) { - simpleResponses = (_json['simpleResponses'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageSimpleResponse>((value) => - GoogleCloudDialogflowV2IntentMessageSimpleResponse.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (simpleResponses != null) { - _json['simpleResponses'] = - simpleResponses.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The suggestion chip message that the user can tap to quickly post a reply to -/// the conversation. -class GoogleCloudDialogflowV2IntentMessageSuggestion { - /// The text shown the in the suggestion chip. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageSuggestion(); - - GoogleCloudDialogflowV2IntentMessageSuggestion.fromJson(core.Map _json) { - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The collection of suggestions. -class GoogleCloudDialogflowV2IntentMessageSuggestions { - /// The list of suggested replies. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentMessageSuggestion> suggestions; - - GoogleCloudDialogflowV2IntentMessageSuggestions(); - - GoogleCloudDialogflowV2IntentMessageSuggestions.fromJson(core.Map _json) { - if (_json.containsKey('suggestions')) { - suggestions = (_json['suggestions'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageSuggestion>((value) => - GoogleCloudDialogflowV2IntentMessageSuggestion.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (suggestions != null) { - _json['suggestions'] = - suggestions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Table card for Actions on Google. -class GoogleCloudDialogflowV2IntentMessageTableCard { - /// List of buttons for the card. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageBasicCardButton> buttons; - - /// Display properties for the columns in this table. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageColumnProperties> - columnProperties; - - /// Image which should be displayed on the card. - /// - /// Optional. - GoogleCloudDialogflowV2IntentMessageImage image; - - /// Rows in this table of data. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageTableCardRow> rows; - - /// Subtitle to the title. - /// - /// Optional. - core.String subtitle; - - /// Title of the card. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2IntentMessageTableCard(); - - GoogleCloudDialogflowV2IntentMessageTableCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageBasicCardButton>((value) => - GoogleCloudDialogflowV2IntentMessageBasicCardButton.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('columnProperties')) { - columnProperties = (_json['columnProperties'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageColumnProperties>((value) => - GoogleCloudDialogflowV2IntentMessageColumnProperties.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('rows')) { - rows = (_json['rows'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageTableCardRow>((value) => - GoogleCloudDialogflowV2IntentMessageTableCardRow.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (columnProperties != null) { - _json['columnProperties'] = - columnProperties.map((value) => value.toJson()).toList(); - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (rows != null) { - _json['rows'] = rows.map((value) => value.toJson()).toList(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Cell of TableCardRow. -class GoogleCloudDialogflowV2IntentMessageTableCardCell { - /// Text in this cell. - /// - /// Required. - core.String text; - - GoogleCloudDialogflowV2IntentMessageTableCardCell(); - - GoogleCloudDialogflowV2IntentMessageTableCardCell.fromJson(core.Map _json) { - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Row of TableCard. -class GoogleCloudDialogflowV2IntentMessageTableCardRow { - /// List of cells that make up this row. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessageTableCardCell> cells; - - /// Whether to add a visual divider after this row. - /// - /// Optional. - core.bool dividerAfter; - - GoogleCloudDialogflowV2IntentMessageTableCardRow(); - - GoogleCloudDialogflowV2IntentMessageTableCardRow.fromJson(core.Map _json) { - if (_json.containsKey('cells')) { - cells = (_json['cells'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessageTableCardCell>((value) => - GoogleCloudDialogflowV2IntentMessageTableCardCell.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('dividerAfter')) { - dividerAfter = _json['dividerAfter'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cells != null) { - _json['cells'] = cells.map((value) => value.toJson()).toList(); - } - if (dividerAfter != null) { - _json['dividerAfter'] = dividerAfter; - } - return _json; - } -} - -/// The text response message. -class GoogleCloudDialogflowV2IntentMessageText { - /// The collection of the agent's responses. - /// - /// Optional. - core.List<core.String> text; - - GoogleCloudDialogflowV2IntentMessageText(); - - GoogleCloudDialogflowV2IntentMessageText.fromJson(core.Map _json) { - if (_json.containsKey('text')) { - text = (_json['text'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Represents intent parameters. -class GoogleCloudDialogflowV2IntentParameter { - /// The default value to use when the `value` yields an empty result. - /// - /// Default values can be extracted from contexts by using the following - /// syntax: `#context_name.parameter_name`. - /// - /// Optional. - core.String defaultValue; - - /// The name of the parameter. - /// - /// Required. - core.String displayName; - - /// The name of the entity type, prefixed with `@`, that describes values of - /// the parameter. - /// - /// If the parameter is required, this must be provided. - /// - /// Optional. - core.String entityTypeDisplayName; - - /// Indicates whether the parameter represents a list of values. - /// - /// Optional. - core.bool isList; - - /// Indicates whether the parameter is required. - /// - /// That is, whether the intent cannot be completed without collecting the - /// parameter value. - /// - /// Optional. - core.bool mandatory; - - /// The unique identifier of this parameter. - core.String name; - - /// The collection of prompts that the agent can present to the user in order - /// to collect a value for the parameter. - /// - /// Optional. - core.List<core.String> prompts; - - /// The definition of the parameter value. - /// - /// It can be: - a constant string, - a parameter value defined as - /// `$parameter_name`, - an original parameter value defined as - /// `$parameter_name.original`, - a parameter value from some context defined - /// as `#context_name.parameter_name`. - /// - /// Optional. - core.String value; - - GoogleCloudDialogflowV2IntentParameter(); - - GoogleCloudDialogflowV2IntentParameter.fromJson(core.Map _json) { - if (_json.containsKey('defaultValue')) { - defaultValue = _json['defaultValue'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('entityTypeDisplayName')) { - entityTypeDisplayName = _json['entityTypeDisplayName'] as core.String; - } - if (_json.containsKey('isList')) { - isList = _json['isList'] as core.bool; - } - if (_json.containsKey('mandatory')) { - mandatory = _json['mandatory'] as core.bool; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('prompts')) { - prompts = (_json['prompts'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (defaultValue != null) { - _json['defaultValue'] = defaultValue; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (entityTypeDisplayName != null) { - _json['entityTypeDisplayName'] = entityTypeDisplayName; - } - if (isList != null) { - _json['isList'] = isList; - } - if (mandatory != null) { - _json['mandatory'] = mandatory; - } - if (name != null) { - _json['name'] = name; - } - if (prompts != null) { - _json['prompts'] = prompts; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// Represents an example that the agent is trained on. -class GoogleCloudDialogflowV2IntentTrainingPhrase { - /// The unique identifier of this training phrase. - /// - /// Output only. - core.String name; - - /// The ordered list of training phrase parts. - /// - /// The parts are concatenated in order to form the training phrase. Note: The - /// API does not automatically annotate training phrases like the Dialogflow - /// Console does. Note: Do not forget to include whitespace at part - /// boundaries, so the training phrase is well formatted when the parts are - /// concatenated. If the training phrase does not need to be annotated with - /// parameters, you just need a single part with only the Part.text field set. - /// If you want to annotate the training phrase, you must create multiple - /// parts, where the fields of each part are populated in one of two ways: - - /// `Part.text` is set to a part of the phrase that has no parameters. - - /// `Part.text` is set to a part of the phrase that you want to annotate, and - /// the `entity_type`, `alias`, and `user_defined` fields are all set. - /// - /// Required. - core.List<GoogleCloudDialogflowV2IntentTrainingPhrasePart> parts; - - /// Indicates how many times this example was added to the intent. - /// - /// Each time a developer adds an existing sample by editing an intent or - /// training, this counter is increased. - /// - /// Optional. - core.int timesAddedCount; - - /// The type of the training phrase. - /// - /// Required. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : Not specified. This value should never be used. - /// - "EXAMPLE" : Examples do not contain @-prefixed entity type names, but - /// example parts can be annotated with entity types. - /// - "TEMPLATE" : Templates are not annotated with entity types, but they can - /// contain @-prefixed entity type names as substrings. Template mode has been - /// deprecated. Example mode is the only supported way to create new training - /// phrases. If you have existing training phrases that you've created in - /// template mode, those will continue to work. - core.String type; - - GoogleCloudDialogflowV2IntentTrainingPhrase(); - - GoogleCloudDialogflowV2IntentTrainingPhrase.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parts')) { - parts = (_json['parts'] as core.List) - .map<GoogleCloudDialogflowV2IntentTrainingPhrasePart>((value) => - GoogleCloudDialogflowV2IntentTrainingPhrasePart.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('timesAddedCount')) { - timesAddedCount = _json['timesAddedCount'] as core.int; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (parts != null) { - _json['parts'] = parts.map((value) => value.toJson()).toList(); - } - if (timesAddedCount != null) { - _json['timesAddedCount'] = timesAddedCount; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a part of a training phrase. -class GoogleCloudDialogflowV2IntentTrainingPhrasePart { - /// The parameter name for the value extracted from the annotated part of the - /// example. - /// - /// This field is required for annotated parts of the training phrase. - /// - /// Optional. - core.String alias; - - /// The entity type name prefixed with `@`. - /// - /// This field is required for annotated parts of the training phrase. - /// - /// Optional. - core.String entityType; - - /// The text for this part. - /// - /// Required. - core.String text; - - /// Indicates whether the text was manually annotated. - /// - /// This field is set to true when the Dialogflow Console is used to manually - /// annotate the part. When creating an annotated part with the API, you must - /// set this to true. - /// - /// Optional. - core.bool userDefined; - - GoogleCloudDialogflowV2IntentTrainingPhrasePart(); - - GoogleCloudDialogflowV2IntentTrainingPhrasePart.fromJson(core.Map _json) { - if (_json.containsKey('alias')) { - alias = _json['alias'] as core.String; - } - if (_json.containsKey('entityType')) { - entityType = _json['entityType'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - if (_json.containsKey('userDefined')) { - userDefined = _json['userDefined'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (alias != null) { - _json['alias'] = alias; - } - if (entityType != null) { - _json['entityType'] = entityType; - } - if (text != null) { - _json['text'] = text; - } - if (userDefined != null) { - _json['userDefined'] = userDefined; - } - return _json; - } -} - -/// Represents a message posted into a conversation. -class GoogleCloudDialogflowV2Message { - /// The message content. - /// - /// Required. - core.String content; - - /// The time when the message was created. - /// - /// Output only. - core.String createTime; - - /// The message language. - /// - /// This should be a \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - /// language tag. Example: "en-US". - /// - /// Optional. - core.String languageCode; - - /// The annotation for the message. - /// - /// Output only. - GoogleCloudDialogflowV2MessageAnnotation messageAnnotation; - - /// The unique identifier of the message. - /// - /// Format: `projects//conversations//messages/`. - core.String name; - - /// The participant that sends this message. - /// - /// Output only. - core.String participant; - - /// The role of the participant. - /// - /// Output only. - /// Possible string values are: - /// - "ROLE_UNSPECIFIED" : Participant role not set. - /// - "HUMAN_AGENT" : Participant is a human agent. - /// - "AUTOMATED_AGENT" : Participant is an automated agent, such as a - /// Dialogflow agent. - /// - "END_USER" : Participant is an end user that has called or chatted with - /// Dialogflow services. - core.String participantRole; - - GoogleCloudDialogflowV2Message(); - - GoogleCloudDialogflowV2Message.fromJson(core.Map _json) { - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('messageAnnotation')) { - messageAnnotation = GoogleCloudDialogflowV2MessageAnnotation.fromJson( - _json['messageAnnotation'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('participant')) { - participant = _json['participant'] as core.String; - } - if (_json.containsKey('participantRole')) { - participantRole = _json['participantRole'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (content != null) { - _json['content'] = content; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (messageAnnotation != null) { - _json['messageAnnotation'] = messageAnnotation.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (participant != null) { - _json['participant'] = participant; - } - if (participantRole != null) { - _json['participantRole'] = participantRole; - } - return _json; - } -} - -/// Represents the result of annotation for the message. -class GoogleCloudDialogflowV2MessageAnnotation { - /// Indicates whether the text message contains entities. - core.bool containEntities; - - /// The collection of annotated message parts ordered by their position in the - /// message. - /// - /// You can recover the annotated message by concatenating - /// \[AnnotatedMessagePart.text\]. - core.List<GoogleCloudDialogflowV2AnnotatedMessagePart> parts; - - GoogleCloudDialogflowV2MessageAnnotation(); - - GoogleCloudDialogflowV2MessageAnnotation.fromJson(core.Map _json) { - if (_json.containsKey('containEntities')) { - containEntities = _json['containEntities'] as core.bool; - } - if (_json.containsKey('parts')) { - parts = (_json['parts'] as core.List) - .map<GoogleCloudDialogflowV2AnnotatedMessagePart>((value) => - GoogleCloudDialogflowV2AnnotatedMessagePart.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (containEntities != null) { - _json['containEntities'] = containEntities; - } - if (parts != null) { - _json['parts'] = parts.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents the contents of the original request that was passed to the -/// `[Streaming]DetectIntent` call. -class GoogleCloudDialogflowV2OriginalDetectIntentRequest { - /// This field is set to the value of the `QueryParameters.payload` field - /// passed in the request. - /// - /// Some integrations that query a Dialogflow agent may provide additional - /// information in the payload. In particular, for the Dialogflow Phone - /// Gateway integration, this field has the form: { "telephony": { - /// "caller_id": "+18558363987" } } Note: The caller ID field (`caller_id`) - /// will be redacted for Trial Edition agents and populated with the caller ID - /// in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Essentials - /// Edition agents. - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// The source of this request, e.g., `google`, `facebook`, `slack`. - /// - /// It is set by Dialogflow-owned servers. - core.String source; - - /// The version of the protocol used for this request. - /// - /// This field is AoG-specific. - /// - /// Optional. - core.String version; - - GoogleCloudDialogflowV2OriginalDetectIntentRequest(); - - GoogleCloudDialogflowV2OriginalDetectIntentRequest.fromJson(core.Map _json) { - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('source')) { - source = _json['source'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (payload != null) { - _json['payload'] = payload; - } - if (source != null) { - _json['source'] = source; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Represents the result of conversational query or event processing. -class GoogleCloudDialogflowV2QueryResult { - /// The action name from the matched intent. - core.String action; - - /// This field is set to: - `false` if the matched intent has required - /// parameters and not all of the required parameter values have been - /// collected. - /// - /// - `true` if all required parameter values have been collected, or if the - /// matched intent doesn't contain any required parameters. - core.bool allRequiredParamsPresent; - - /// Free-form diagnostic information for the associated detect intent request. - /// - /// The fields of this data can change without notice, so you should not write - /// code that depends on its structure. The data may contain: - webhook call - /// latency - webhook errors - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> diagnosticInfo; - - /// The collection of rich messages to present to the user. - core.List<GoogleCloudDialogflowV2IntentMessage> fulfillmentMessages; - - /// The text to be pronounced to the user or shown on the screen. - /// - /// Note: This is a legacy field, `fulfillment_messages` should be preferred. - core.String fulfillmentText; - - /// The intent that matched the conversational query. - /// - /// Some, not all fields are filled in this message, including but not limited - /// to: `name`, `display_name`, `end_interaction` and `is_fallback`. - GoogleCloudDialogflowV2Intent intent; - - /// The intent detection confidence. - /// - /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). - /// This value is for informational purpose only and is only used to help - /// match the best intent within the classification threshold. This value may - /// change for the same end-user expression at any time due to a model - /// retraining or change in implementation. If there are `multiple - /// knowledge_answers` messages, this value is set to the greatest - /// `knowledgeAnswers.match_confidence` value in the list. - core.double intentDetectionConfidence; - - /// The language that was triggered during intent detection. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. - core.String languageCode; - - /// The collection of output contexts. - /// - /// If applicable, `output_contexts.parameters` contains entries with name - /// `.original` containing the original parameter values before the query. - core.List<GoogleCloudDialogflowV2Context> outputContexts; - - /// The collection of extracted parameters. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - /// The original conversational query text: - If natural language text was - /// provided as input, `query_text` contains a copy of the input. - /// - /// - If natural language speech audio was provided as input, `query_text` - /// contains the speech recognition result. If speech recognizer produced - /// multiple alternatives, a particular one is picked. - If automatic spell - /// correction is enabled, `query_text` will contain the corrected user input. - core.String queryText; - - /// The sentiment analysis result, which depends on the - /// `sentiment_analysis_request_config` specified in the request. - GoogleCloudDialogflowV2SentimentAnalysisResult sentimentAnalysisResult; - - /// The Speech recognition confidence between 0.0 and 1.0. - /// - /// A higher number indicates an estimated greater likelihood that the - /// recognized words are correct. The default of 0.0 is a sentinel value - /// indicating that confidence was not set. This field is not guaranteed to be - /// accurate or set. In particular this field isn't set for - /// StreamingDetectIntent since the streaming endpoint has separate confidence - /// estimates per portion of the audio in StreamingRecognitionResult. - core.double speechRecognitionConfidence; - - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `payload` field returned in the webhook response. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> webhookPayload; - - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `source` field returned in the webhook response. - core.String webhookSource; - - GoogleCloudDialogflowV2QueryResult(); - - GoogleCloudDialogflowV2QueryResult.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('allRequiredParamsPresent')) { - allRequiredParamsPresent = _json['allRequiredParamsPresent'] as core.bool; - } - if (_json.containsKey('diagnosticInfo')) { - diagnosticInfo = (_json['diagnosticInfo'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('fulfillmentMessages')) { - fulfillmentMessages = (_json['fulfillmentMessages'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessage>((value) => - GoogleCloudDialogflowV2IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('fulfillmentText')) { - fulfillmentText = _json['fulfillmentText'] as core.String; - } - if (_json.containsKey('intent')) { - intent = GoogleCloudDialogflowV2Intent.fromJson( - _json['intent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('intentDetectionConfidence')) { - intentDetectionConfidence = - (_json['intentDetectionConfidence'] as core.num).toDouble(); - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2Context>((value) => - GoogleCloudDialogflowV2Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('queryText')) { - queryText = _json['queryText'] as core.String; - } - if (_json.containsKey('sentimentAnalysisResult')) { - sentimentAnalysisResult = - GoogleCloudDialogflowV2SentimentAnalysisResult.fromJson( - _json['sentimentAnalysisResult'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('speechRecognitionConfidence')) { - speechRecognitionConfidence = - (_json['speechRecognitionConfidence'] as core.num).toDouble(); - } - if (_json.containsKey('webhookPayload')) { - webhookPayload = (_json['webhookPayload'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('webhookSource')) { - webhookSource = _json['webhookSource'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (allRequiredParamsPresent != null) { - _json['allRequiredParamsPresent'] = allRequiredParamsPresent; - } - if (diagnosticInfo != null) { - _json['diagnosticInfo'] = diagnosticInfo; - } - if (fulfillmentMessages != null) { - _json['fulfillmentMessages'] = - fulfillmentMessages.map((value) => value.toJson()).toList(); - } - if (fulfillmentText != null) { - _json['fulfillmentText'] = fulfillmentText; - } - if (intent != null) { - _json['intent'] = intent.toJson(); - } - if (intentDetectionConfidence != null) { - _json['intentDetectionConfidence'] = intentDetectionConfidence; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (parameters != null) { - _json['parameters'] = parameters; - } - if (queryText != null) { - _json['queryText'] = queryText; - } - if (sentimentAnalysisResult != null) { - _json['sentimentAnalysisResult'] = sentimentAnalysisResult.toJson(); - } - if (speechRecognitionConfidence != null) { - _json['speechRecognitionConfidence'] = speechRecognitionConfidence; - } - if (webhookPayload != null) { - _json['webhookPayload'] = webhookPayload; - } - if (webhookSource != null) { - _json['webhookSource'] = webhookSource; - } - return _json; - } -} - -/// The sentiment, such as positive/negative feeling or association, for a unit -/// of analysis, such as the query text. -class GoogleCloudDialogflowV2Sentiment { - /// A non-negative number in the \[0, +inf) range, which represents the - /// absolute magnitude of sentiment, regardless of score (positive or - /// negative). - core.double magnitude; - - /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - /// sentiment). - core.double score; - - GoogleCloudDialogflowV2Sentiment(); - - GoogleCloudDialogflowV2Sentiment.fromJson(core.Map _json) { - if (_json.containsKey('magnitude')) { - magnitude = (_json['magnitude'] as core.num).toDouble(); - } - if (_json.containsKey('score')) { - score = (_json['score'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (magnitude != null) { - _json['magnitude'] = magnitude; - } - if (score != null) { - _json['score'] = score; - } - return _json; - } -} - -/// The result of sentiment analysis. -/// -/// Sentiment analysis inspects user input and identifies the prevailing -/// subjective opinion, especially to determine a user's attitude as positive, -/// negative, or neutral. For Participants.DetectIntent, it needs to be -/// configured in DetectIntentRequest.query_params. For -/// Participants.StreamingDetectIntent, it needs to be configured in -/// StreamingDetectIntentRequest.query_params. And for -/// Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it -/// needs to be configured in ConversationProfile.human_agent_assistant_config -class GoogleCloudDialogflowV2SentimentAnalysisResult { - /// The sentiment analysis result for `query_text`. - GoogleCloudDialogflowV2Sentiment queryTextSentiment; - - GoogleCloudDialogflowV2SentimentAnalysisResult(); - - GoogleCloudDialogflowV2SentimentAnalysisResult.fromJson(core.Map _json) { - if (_json.containsKey('queryTextSentiment')) { - queryTextSentiment = GoogleCloudDialogflowV2Sentiment.fromJson( - _json['queryTextSentiment'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (queryTextSentiment != null) { - _json['queryTextSentiment'] = queryTextSentiment.toJson(); - } - return _json; - } -} - -/// A session represents a conversation between a Dialogflow agent and an -/// end-user. -/// -/// You can create special entities, called session entities, during a session. -/// Session entities can extend or replace custom entity types and only exist -/// during the session that they were created for. All session data, including -/// session entities, is stored by Dialogflow for 20 minutes. For more -/// information, see the -/// [session entity guide](https://cloud.google.com/dialogflow/docs/entities-session). -class GoogleCloudDialogflowV2SessionEntityType { - /// The collection of entities associated with this session entity type. - /// - /// Required. - core.List<GoogleCloudDialogflowV2EntityTypeEntity> entities; - - /// Indicates whether the additional data should override or supplement the - /// custom entity type definition. - /// - /// Required. - /// Possible string values are: - /// - "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : Not specified. This value should be - /// never used. - /// - "ENTITY_OVERRIDE_MODE_OVERRIDE" : The collection of session entities - /// overrides the collection of entities in the corresponding custom entity - /// type. - /// - "ENTITY_OVERRIDE_MODE_SUPPLEMENT" : The collection of session entities - /// extends the collection of entities in the corresponding custom entity - /// type. Note: Even in this override mode calls to `ListSessionEntityTypes`, - /// `GetSessionEntityType`, `CreateSessionEntityType` and - /// `UpdateSessionEntityType` only return the additional entities added in - /// this session entity type. If you want to get the supplemented list, please - /// call EntityTypes.GetEntityType on the custom entity type and merge. - core.String entityOverrideMode; - - /// The unique identifier of this session entity type. - /// - /// Format: `projects//agent/sessions//entityTypes/`, or - /// `projects//agent/environments//users//sessions//entityTypes/`. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// - /// Required. - core.String name; - - GoogleCloudDialogflowV2SessionEntityType(); - - GoogleCloudDialogflowV2SessionEntityType.fromJson(core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2EntityTypeEntity>((value) => - GoogleCloudDialogflowV2EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('entityOverrideMode')) { - entityOverrideMode = _json['entityOverrideMode'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (entityOverrideMode != null) { - _json['entityOverrideMode'] = entityOverrideMode; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The request message for a webhook call. -class GoogleCloudDialogflowV2WebhookRequest { - /// The contents of the original request that was passed to - /// `[Streaming]DetectIntent` call. - /// - /// Optional. - GoogleCloudDialogflowV2OriginalDetectIntentRequest - originalDetectIntentRequest; - - /// The result of the conversational query or event processing. - /// - /// Contains the same value as `[Streaming]DetectIntentResponse.query_result`. - GoogleCloudDialogflowV2QueryResult queryResult; - - /// The unique identifier of the response. - /// - /// Contains the same value as `[Streaming]DetectIntentResponse.response_id`. - core.String responseId; - - /// The unique identifier of detectIntent request session. - /// - /// Can be used to identify end-user inside webhook implementation. Format: - /// `projects//agent/sessions/`, or - /// `projects//agent/environments//users//sessions/`. - core.String session; - - GoogleCloudDialogflowV2WebhookRequest(); - - GoogleCloudDialogflowV2WebhookRequest.fromJson(core.Map _json) { - if (_json.containsKey('originalDetectIntentRequest')) { - originalDetectIntentRequest = - GoogleCloudDialogflowV2OriginalDetectIntentRequest.fromJson( - _json['originalDetectIntentRequest'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('queryResult')) { - queryResult = GoogleCloudDialogflowV2QueryResult.fromJson( - _json['queryResult'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('responseId')) { - responseId = _json['responseId'] as core.String; - } - if (_json.containsKey('session')) { - session = _json['session'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (originalDetectIntentRequest != null) { - _json['originalDetectIntentRequest'] = - originalDetectIntentRequest.toJson(); - } - if (queryResult != null) { - _json['queryResult'] = queryResult.toJson(); - } - if (responseId != null) { - _json['responseId'] = responseId; - } - if (session != null) { - _json['session'] = session; - } - return _json; - } -} - -/// The response message for a webhook call. -/// -/// This response is validated by the Dialogflow server. If validation fails, an -/// error will be returned in the QueryResult.diagnostic_info field. Setting -/// JSON fields to an empty value with the wrong type is a common error. To -/// avoid this error: - Use `""` for empty strings - Use `{}` or `null` for -/// empty objects - Use `[]` or `null` for empty arrays For more information, -/// see the -/// [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). -class GoogleCloudDialogflowV2WebhookResponse { - /// Invokes the supplied events. - /// - /// When this field is set, Dialogflow ignores the `fulfillment_text`, - /// `fulfillment_messages`, and `payload` fields. - /// - /// Optional. - GoogleCloudDialogflowV2EventInput followupEventInput; - - /// The rich response messages intended for the end-user. - /// - /// When provided, Dialogflow uses this field to populate - /// QueryResult.fulfillment_messages sent to the integration or API caller. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2IntentMessage> fulfillmentMessages; - - /// The text response message intended for the end-user. - /// - /// It is recommended to use `fulfillment_messages.text.text[0]` instead. When - /// provided, Dialogflow uses this field to populate - /// QueryResult.fulfillment_text sent to the integration or API caller. - /// - /// Optional. - core.String fulfillmentText; - - /// The collection of output contexts that will overwrite currently active - /// contexts for the session and reset their lifespans. - /// - /// When provided, Dialogflow uses this field to populate - /// QueryResult.output_contexts sent to the integration or API caller. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2Context> outputContexts; - - /// This field can be used to pass custom data from your webhook to the - /// integration or API caller. - /// - /// Arbitrary JSON objects are supported. When provided, Dialogflow uses this - /// field to populate QueryResult.webhook_payload sent to the integration or - /// API caller. This field is also used by the - /// [Google Assistant integration](https://cloud.google.com/dialogflow/docs/integrations/aog) - /// for rich response messages. See the format definition at - /// [Google Assistant Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Additional session entity types to replace or extend developer entity - /// types with. - /// - /// The entity synonyms apply to all languages and persist for the session. - /// Setting this data from a webhook overwrites the session entity types that - /// have been set using `detectIntent`, `streamingDetectIntent` or - /// SessionEntityType management methods. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2SessionEntityType> sessionEntityTypes; - - /// A custom field used to identify the webhook source. - /// - /// Arbitrary strings are supported. When provided, Dialogflow uses this field - /// to populate QueryResult.webhook_source sent to the integration or API - /// caller. - /// - /// Optional. - core.String source; - - GoogleCloudDialogflowV2WebhookResponse(); - - GoogleCloudDialogflowV2WebhookResponse.fromJson(core.Map _json) { - if (_json.containsKey('followupEventInput')) { - followupEventInput = GoogleCloudDialogflowV2EventInput.fromJson( - _json['followupEventInput'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('fulfillmentMessages')) { - fulfillmentMessages = (_json['fulfillmentMessages'] as core.List) - .map<GoogleCloudDialogflowV2IntentMessage>((value) => - GoogleCloudDialogflowV2IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('fulfillmentText')) { - fulfillmentText = _json['fulfillmentText'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2Context>((value) => - GoogleCloudDialogflowV2Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('sessionEntityTypes')) { - sessionEntityTypes = (_json['sessionEntityTypes'] as core.List) - .map<GoogleCloudDialogflowV2SessionEntityType>((value) => - GoogleCloudDialogflowV2SessionEntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('source')) { - source = _json['source'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (followupEventInput != null) { - _json['followupEventInput'] = followupEventInput.toJson(); - } - if (fulfillmentMessages != null) { - _json['fulfillmentMessages'] = - fulfillmentMessages.map((value) => value.toJson()).toList(); - } - if (fulfillmentText != null) { - _json['fulfillmentText'] = fulfillmentText; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (sessionEntityTypes != null) { - _json['sessionEntityTypes'] = - sessionEntityTypes.map((value) => value.toJson()).toList(); - } - if (source != null) { - _json['source'] = source; - } - return _json; - } -} - -/// A Dialogflow agent is a virtual agent that handles conversations with your -/// end-users. -/// -/// It is a natural language understanding module that understands the nuances -/// of human language. Dialogflow translates end-user text or audio during a -/// conversation to structured data that your apps and services can understand. -/// You design and build a Dialogflow agent to handle the types of conversations -/// required for your system. For more information about agents, see the -/// [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview). -class GoogleCloudDialogflowV2beta1Agent { - /// API version displayed in Dialogflow console. - /// - /// If not specified, V2 API is assumed. Clients are free to query different - /// service endpoints for different API versions. However, bots connectors and - /// webhook calls will follow the specified API version. - /// - /// Optional. - /// Possible string values are: - /// - "API_VERSION_UNSPECIFIED" : Not specified. - /// - "API_VERSION_V1" : Legacy V1 API. - /// - "API_VERSION_V2" : V2 API. - /// - "API_VERSION_V2_BETA_1" : V2beta1 API. - core.String apiVersion; - - /// The URI of the agent's avatar. - /// - /// Avatars are used throughout the Dialogflow console and in the self-hosted - /// [Web Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) - /// integration. - /// - /// Optional. - core.String avatarUri; - - /// To filter out false positive results and still get variety in matched - /// natural language inputs for your agent, you can tune the machine learning - /// classification threshold. - /// - /// If the returned score value is less than the threshold value, then a - /// fallback intent will be triggered or, if there are no fallback intents - /// defined, no intent will be triggered. The score values range from 0.0 - /// (completely uncertain) to 1.0 (completely certain). If set to 0.0, the - /// default of 0.3 is used. - /// - /// Optional. - core.double classificationThreshold; - - /// The default language of the agent as a language tag. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. This field cannot be - /// set by the `Update` method. - /// - /// Required. - core.String defaultLanguageCode; - - /// The description of this agent. - /// - /// The maximum length is 500 characters. If exceeded, the request is - /// rejected. - /// - /// Optional. - core.String description; - - /// The name of this agent. - /// - /// Required. - core.String displayName; - - /// Determines whether this agent should log conversation queries. - /// - /// Optional. - core.bool enableLogging; - - /// Determines how intents are detected from user queries. - /// - /// Optional. - /// Possible string values are: - /// - "MATCH_MODE_UNSPECIFIED" : Not specified. - /// - "MATCH_MODE_HYBRID" : Best for agents with a small number of examples in - /// intents and/or wide use of templates syntax and composite entities. - /// - "MATCH_MODE_ML_ONLY" : Can be used for agents with a large number of - /// examples in intents, especially the ones using @sys.any or very large - /// custom entities. - core.String matchMode; - - /// The project of this agent. - /// - /// Format: `projects/` or `projects//locations/` - /// - /// Required. - core.String parent; - - /// The list of all languages supported by this agent (except for the - /// `default_language_code`). - /// - /// Optional. - core.List<core.String> supportedLanguageCodes; - - /// The agent tier. - /// - /// If not specified, TIER_STANDARD is assumed. - /// - /// Optional. - /// Possible string values are: - /// - "TIER_UNSPECIFIED" : Not specified. This value should never be used. - /// - "TIER_STANDARD" : Standard tier. - /// - "TIER_ENTERPRISE" : Enterprise tier (Essentials). - /// - "TIER_ENTERPRISE_PLUS" : Enterprise tier (Plus). - core.String tier; - - /// The time zone of this agent from the - /// [time zone database](https://www.iana.org/time-zones), e.g., - /// America/New_York, Europe/Paris. - /// - /// Required. - core.String timeZone; - - GoogleCloudDialogflowV2beta1Agent(); - - GoogleCloudDialogflowV2beta1Agent.fromJson(core.Map _json) { - if (_json.containsKey('apiVersion')) { - apiVersion = _json['apiVersion'] as core.String; - } - if (_json.containsKey('avatarUri')) { - avatarUri = _json['avatarUri'] as core.String; - } - if (_json.containsKey('classificationThreshold')) { - classificationThreshold = - (_json['classificationThreshold'] as core.num).toDouble(); - } - if (_json.containsKey('defaultLanguageCode')) { - defaultLanguageCode = _json['defaultLanguageCode'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enableLogging')) { - enableLogging = _json['enableLogging'] as core.bool; - } - if (_json.containsKey('matchMode')) { - matchMode = _json['matchMode'] as core.String; - } - if (_json.containsKey('parent')) { - parent = _json['parent'] as core.String; - } - if (_json.containsKey('supportedLanguageCodes')) { - supportedLanguageCodes = (_json['supportedLanguageCodes'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('tier')) { - tier = _json['tier'] as core.String; - } - if (_json.containsKey('timeZone')) { - timeZone = _json['timeZone'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiVersion != null) { - _json['apiVersion'] = apiVersion; - } - if (avatarUri != null) { - _json['avatarUri'] = avatarUri; - } - if (classificationThreshold != null) { - _json['classificationThreshold'] = classificationThreshold; - } - if (defaultLanguageCode != null) { - _json['defaultLanguageCode'] = defaultLanguageCode; - } - if (description != null) { - _json['description'] = description; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enableLogging != null) { - _json['enableLogging'] = enableLogging; - } - if (matchMode != null) { - _json['matchMode'] = matchMode; - } - if (parent != null) { - _json['parent'] = parent; - } - if (supportedLanguageCodes != null) { - _json['supportedLanguageCodes'] = supportedLanguageCodes; - } - if (tier != null) { - _json['tier'] = tier; - } - if (timeZone != null) { - _json['timeZone'] = timeZone; - } - return _json; - } -} - -/// Represents an annotated conversation dataset. -/// -/// ConversationDataset can have multiple AnnotatedConversationDataset, each of -/// them represents one result from one annotation task. -/// AnnotatedConversationDataset can only be generated from annotation task, -/// which will be triggered by LabelConversation. -class GoogleCloudDialogflowV2beta1AnnotatedConversationDataset { - /// Number of examples that have annotations in the annotated conversation - /// dataset. - /// - /// Output only. - core.String completedExampleCount; - - /// Creation time of this annotated conversation dataset. - /// - /// Output only. - core.String createTime; - - /// The description of the annotated conversation dataset. - /// - /// Maximum of 10000 bytes. - /// - /// Optional. - core.String description; - - /// The display name of the annotated conversation dataset. - /// - /// It's specified when user starts an annotation task. Maximum of 64 bytes. - /// - /// Required. - core.String displayName; - - /// Number of examples in the annotated conversation dataset. - /// - /// Output only. - core.String exampleCount; - - /// AnnotatedConversationDataset resource name. - /// - /// Format: `projects//conversationDatasets//annotatedConversationDatasets/` - /// - /// Output only. - core.String name; - - /// Question type name that identifies a labeling task. - /// - /// A question is a single task that a worker answers. A question type is set - /// of related questions. Each question belongs to a particular question type. - /// It can be used in CrowdCompute UI to filter and manage labeling tasks. - /// - /// Output only. - core.String questionTypeName; - - GoogleCloudDialogflowV2beta1AnnotatedConversationDataset(); - - GoogleCloudDialogflowV2beta1AnnotatedConversationDataset.fromJson( - core.Map _json) { - if (_json.containsKey('completedExampleCount')) { - completedExampleCount = _json['completedExampleCount'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('exampleCount')) { - exampleCount = _json['exampleCount'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('questionTypeName')) { - questionTypeName = _json['questionTypeName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (completedExampleCount != null) { - _json['completedExampleCount'] = completedExampleCount; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (exampleCount != null) { - _json['exampleCount'] = exampleCount; - } - if (name != null) { - _json['name'] = name; - } - if (questionTypeName != null) { - _json['questionTypeName'] = questionTypeName; - } - return _json; - } -} - -/// Response message for \[Documents.AutoApproveSmartMessagingEntries\]. -class GoogleCloudDialogflowV2beta1AutoApproveSmartMessagingEntriesResponse { - /// Number of smart messaging entries disabled. - core.int disabledCount; - - /// Number of smart messaging entries enabled. - core.int enabledCount; - - /// Number of smart messaging entries unreviewed. - core.int unreviewedCount; - - GoogleCloudDialogflowV2beta1AutoApproveSmartMessagingEntriesResponse(); - - GoogleCloudDialogflowV2beta1AutoApproveSmartMessagingEntriesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('disabledCount')) { - disabledCount = _json['disabledCount'] as core.int; - } - if (_json.containsKey('enabledCount')) { - enabledCount = _json['enabledCount'] as core.int; - } - if (_json.containsKey('unreviewedCount')) { - unreviewedCount = _json['unreviewedCount'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (disabledCount != null) { - _json['disabledCount'] = disabledCount; - } - if (enabledCount != null) { - _json['enabledCount'] = enabledCount; - } - if (unreviewedCount != null) { - _json['unreviewedCount'] = unreviewedCount; - } - return _json; - } -} - -/// The request message for EntityTypes.BatchCreateEntities. -class GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest { - /// The entities to create. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity> entities; - - /// The language used to access language-specific data. - /// - /// If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// Optional. - core.String languageCode; - - GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest(); - - GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest.fromJson( - core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => - GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - return _json; - } -} - -/// The request message for EntityTypes.BatchDeleteEntities. -class GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest { - /// The reference `values` of the entities to delete. - /// - /// Note that these are not fully-qualified names, i.e. they don't start with - /// `projects/`. - /// - /// Required. - core.List<core.String> entityValues; - - /// The language used to access language-specific data. - /// - /// If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// Optional. - core.String languageCode; - - GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest(); - - GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest.fromJson( - core.Map _json) { - if (_json.containsKey('entityValues')) { - entityValues = (_json['entityValues'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityValues != null) { - _json['entityValues'] = entityValues; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - return _json; - } -} - -/// The request message for EntityTypes.BatchDeleteEntityTypes. -class GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest { - /// The names entity types to delete. - /// - /// All names must point to the same agent as `parent`. - /// - /// Required. - core.List<core.String> entityTypeNames; - - GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest(); - - GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest.fromJson( - core.Map _json) { - if (_json.containsKey('entityTypeNames')) { - entityTypeNames = (_json['entityTypeNames'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypeNames != null) { - _json['entityTypeNames'] = entityTypeNames; - } - return _json; - } -} - -/// The request message for Intents.BatchDeleteIntents. -class GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest { - /// The collection of intents to delete. - /// - /// Only intent `name` must be filled in. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1Intent> intents; - - GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest(); - - GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest.fromJson( - core.Map _json) { - if (_json.containsKey('intents')) { - intents = (_json['intents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Intent>((value) => - GoogleCloudDialogflowV2beta1Intent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intents != null) { - _json['intents'] = intents.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The request message for EntityTypes.BatchUpdateEntities. -class GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { - /// The entities to update or create. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity> entities; - - /// The language used to access language-specific data. - /// - /// If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// Optional. - core.String languageCode; - - /// The mask to control which fields get updated. - /// - /// Optional. - core.String updateMask; - - GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest(); - - GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest.fromJson( - core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => - GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// The request message for EntityTypes.BatchUpdateEntityTypes. -class GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest { - /// The collection of entity types to update or create. - GoogleCloudDialogflowV2beta1EntityTypeBatch entityTypeBatchInline; - - /// The URI to a Google Cloud Storage file containing entity types to update - /// or create. - /// - /// The file format can either be a serialized proto (of EntityBatch type) or - /// a JSON object. Note: The URI must start with "gs://". - core.String entityTypeBatchUri; - - /// The language used to access language-specific data. - /// - /// If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// Optional. - core.String languageCode; - - /// The mask to control which fields get updated. - /// - /// Optional. - core.String updateMask; - - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest(); - - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest.fromJson( - core.Map _json) { - if (_json.containsKey('entityTypeBatchInline')) { - entityTypeBatchInline = - GoogleCloudDialogflowV2beta1EntityTypeBatch.fromJson( - _json['entityTypeBatchInline'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('entityTypeBatchUri')) { - entityTypeBatchUri = _json['entityTypeBatchUri'] as core.String; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypeBatchInline != null) { - _json['entityTypeBatchInline'] = entityTypeBatchInline.toJson(); - } - if (entityTypeBatchUri != null) { - _json['entityTypeBatchUri'] = entityTypeBatchUri; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// The response message for EntityTypes.BatchUpdateEntityTypes. -class GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { - /// The collection of updated or created entity types. - core.List<GoogleCloudDialogflowV2beta1EntityType> entityTypes; - - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse(); - - GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('entityTypes')) { - entityTypes = (_json['entityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityType>((value) => - GoogleCloudDialogflowV2beta1EntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypes != null) { - _json['entityTypes'] = - entityTypes.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The request message for Intents.BatchUpdateIntents. -class GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest { - /// The collection of intents to update or create. - GoogleCloudDialogflowV2beta1IntentBatch intentBatchInline; - - /// The URI to a Google Cloud Storage file containing intents to update or - /// create. - /// - /// The file format can either be a serialized proto (of IntentBatch type) or - /// JSON object. Note: The URI must start with "gs://". - core.String intentBatchUri; - - /// The resource view to apply to the returned intent. - /// - /// Optional. - /// Possible string values are: - /// - "INTENT_VIEW_UNSPECIFIED" : Training phrases field is not populated in - /// the response. - /// - "INTENT_VIEW_FULL" : All fields are populated. - core.String intentView; - - /// The language used to access language-specific data. - /// - /// If not specified, the agent's default language is used. For more - /// information, see - /// [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - /// - /// Optional. - core.String languageCode; - - /// The mask to control which fields get updated. - /// - /// Optional. - core.String updateMask; - - GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest(); - - GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest.fromJson( - core.Map _json) { - if (_json.containsKey('intentBatchInline')) { - intentBatchInline = GoogleCloudDialogflowV2beta1IntentBatch.fromJson( - _json['intentBatchInline'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('intentBatchUri')) { - intentBatchUri = _json['intentBatchUri'] as core.String; - } - if (_json.containsKey('intentView')) { - intentView = _json['intentView'] as core.String; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intentBatchInline != null) { - _json['intentBatchInline'] = intentBatchInline.toJson(); - } - if (intentBatchUri != null) { - _json['intentBatchUri'] = intentBatchUri; - } - if (intentView != null) { - _json['intentView'] = intentView; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// The response message for Intents.BatchUpdateIntents. -class GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { - /// The collection of updated or created intents. - core.List<GoogleCloudDialogflowV2beta1Intent> intents; - - GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse(); - - GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse.fromJson( - core.Map _json) { - if (_json.containsKey('intents')) { - intents = (_json['intents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Intent>((value) => - GoogleCloudDialogflowV2beta1Intent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intents != null) { - _json['intents'] = intents.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response message for \[Documents.BatchUpdateSmartMessagingEntries\] -class GoogleCloudDialogflowV2beta1BatchUpdateSmartMessagingEntriesResponse { - /// List of updated smart message entries. - core.List<GoogleCloudDialogflowV2beta1SmartMessagingEntry> - smartMessagingEntries; - - GoogleCloudDialogflowV2beta1BatchUpdateSmartMessagingEntriesResponse(); - - GoogleCloudDialogflowV2beta1BatchUpdateSmartMessagingEntriesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('smartMessagingEntries')) { - smartMessagingEntries = (_json['smartMessagingEntries'] as core.List) - .map<GoogleCloudDialogflowV2beta1SmartMessagingEntry>((value) => - GoogleCloudDialogflowV2beta1SmartMessagingEntry.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (smartMessagingEntries != null) { - _json['smartMessagingEntries'] = - smartMessagingEntries.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Dialogflow contexts are similar to natural language context. -/// -/// If a person says to you "they are orange", you need context in order to -/// understand what "they" is referring to. Similarly, for Dialogflow to handle -/// an end-user expression like that, it needs to be provided with context in -/// order to correctly match an intent. Using contexts, you can control the flow -/// of a conversation. You can configure contexts for an intent by setting input -/// and output contexts, which are identified by string names. When an intent is -/// matched, any configured output contexts for that intent become active. While -/// any contexts are active, Dialogflow is more likely to match intents that are -/// configured with input contexts that correspond to the currently active -/// contexts. For more information about context, see the -/// [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). -class GoogleCloudDialogflowV2beta1Context { - /// The number of conversational query requests after which the context - /// expires. - /// - /// The default is `0`. If set to `0`, the context expires immediately. - /// Contexts expire automatically after 20 minutes if there are no matching - /// queries. - /// - /// Optional. - core.int lifespanCount; - - /// The unique identifier of the context. - /// - /// Supported formats: - `projects//agent/sessions//contexts/`, - - /// `projects//locations//agent/sessions//contexts/`, - - /// `projects//agent/environments//users//sessions//contexts/`, - - /// `projects//locations//agent/environments//users//sessions//contexts/`, The - /// `Context ID` is always converted to lowercase, may only contain characters - /// in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. The following context names are - /// reserved for internal use by Dialogflow. You should not use these contexts - /// or create contexts with these names: * `__system_counters__` * - /// `*_id_dialog_context` * `*_dialog_params_size` - /// - /// Required. - core.String name; - - /// The collection of parameters associated with this context. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - GoogleCloudDialogflowV2beta1Context(); - - GoogleCloudDialogflowV2beta1Context.fromJson(core.Map _json) { - if (_json.containsKey('lifespanCount')) { - lifespanCount = _json['lifespanCount'] as core.int; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lifespanCount != null) { - _json['lifespanCount'] = lifespanCount; - } - if (name != null) { - _json['name'] = name; - } - if (parameters != null) { - _json['parameters'] = parameters; - } - return _json; - } -} - -/// The request to detect user's intent. -class GoogleCloudDialogflowV2beta1DetectIntentRequest { - /// The natural language speech audio to be processed. - /// - /// This field should be populated iff `query_input` is set to an input audio - /// config. A single request can contain up to 1 minute of speech audio data. - core.String inputAudio; - core.List<core.int> get inputAudioAsBytes => - convert.base64.decode(inputAudio); - - set inputAudioAsBytes(core.List<core.int> _bytes) { - inputAudio = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Instructs the speech synthesizer how to generate the output audio. - /// - /// If this field is not set and agent-level speech synthesizer is not - /// configured, no output audio is generated. - GoogleCloudDialogflowV2beta1OutputAudioConfig outputAudioConfig; - - /// Mask for output_audio_config indicating which settings in this - /// request-level config should override speech synthesizer settings defined - /// at agent-level. - /// - /// If unspecified or empty, output_audio_config replaces the agent-level - /// config in its entirety. - core.String outputAudioConfigMask; - - /// The input specification. - /// - /// It can be set to: 1. an audio config which instructs the speech recognizer - /// how to process the speech audio, 2. a conversational query in the form of - /// text, or 3. an event that specifies which intent to trigger. - /// - /// Required. - GoogleCloudDialogflowV2beta1QueryInput queryInput; - - /// The parameters of this query. - GoogleCloudDialogflowV2beta1QueryParameters queryParams; - - GoogleCloudDialogflowV2beta1DetectIntentRequest(); - - GoogleCloudDialogflowV2beta1DetectIntentRequest.fromJson(core.Map _json) { - if (_json.containsKey('inputAudio')) { - inputAudio = _json['inputAudio'] as core.String; - } - if (_json.containsKey('outputAudioConfig')) { - outputAudioConfig = - GoogleCloudDialogflowV2beta1OutputAudioConfig.fromJson( - _json['outputAudioConfig'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('outputAudioConfigMask')) { - outputAudioConfigMask = _json['outputAudioConfigMask'] as core.String; - } - if (_json.containsKey('queryInput')) { - queryInput = GoogleCloudDialogflowV2beta1QueryInput.fromJson( - _json['queryInput'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('queryParams')) { - queryParams = GoogleCloudDialogflowV2beta1QueryParameters.fromJson( - _json['queryParams'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (inputAudio != null) { - _json['inputAudio'] = inputAudio; - } - if (outputAudioConfig != null) { - _json['outputAudioConfig'] = outputAudioConfig.toJson(); - } - if (outputAudioConfigMask != null) { - _json['outputAudioConfigMask'] = outputAudioConfigMask; - } - if (queryInput != null) { - _json['queryInput'] = queryInput.toJson(); - } - if (queryParams != null) { - _json['queryParams'] = queryParams.toJson(); - } - return _json; - } -} - -/// The message returned from the DetectIntent method. -class GoogleCloudDialogflowV2beta1DetectIntentResponse { - /// If Knowledge Connectors are enabled, there could be more than one result - /// returned for a given query or event, and this field will contain all - /// results except for the top one, which is captured in query_result. - /// - /// The alternative results are ordered by decreasing - /// `QueryResult.intent_detection_confidence`. If Knowledge Connectors are - /// disabled, this field will be empty until multiple responses for regular - /// intents are supported, at which point those additional results will be - /// surfaced here. - core.List<GoogleCloudDialogflowV2beta1QueryResult> alternativeQueryResults; - - /// The audio data bytes encoded as specified in the request. - /// - /// Note: The output audio is generated based on the values of default - /// platform text responses found in the `query_result.fulfillment_messages` - /// field. If multiple default text responses exist, they will be concatenated - /// when generating audio. If no default platform text responses exist, the - /// generated audio content will be empty. In some scenarios, multiple output - /// audio fields may be present in the response structure. In these cases, - /// only the top-most-level audio output has content. - core.String outputAudio; - core.List<core.int> get outputAudioAsBytes => - convert.base64.decode(outputAudio); - - set outputAudioAsBytes(core.List<core.int> _bytes) { - outputAudio = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The config used by the speech synthesizer to generate the output audio. - GoogleCloudDialogflowV2beta1OutputAudioConfig outputAudioConfig; - - /// The selected results of the conversational query or event processing. - /// - /// See `alternative_query_results` for additional potential results. - GoogleCloudDialogflowV2beta1QueryResult queryResult; - - /// The unique identifier of the response. - /// - /// It can be used to locate a response in the training example set or for - /// reporting issues. - core.String responseId; - - /// Specifies the status of the webhook request. - GoogleRpcStatus webhookStatus; - - GoogleCloudDialogflowV2beta1DetectIntentResponse(); - - GoogleCloudDialogflowV2beta1DetectIntentResponse.fromJson(core.Map _json) { - if (_json.containsKey('alternativeQueryResults')) { - alternativeQueryResults = (_json['alternativeQueryResults'] as core.List) - .map<GoogleCloudDialogflowV2beta1QueryResult>((value) => - GoogleCloudDialogflowV2beta1QueryResult.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('outputAudio')) { - outputAudio = _json['outputAudio'] as core.String; - } - if (_json.containsKey('outputAudioConfig')) { - outputAudioConfig = - GoogleCloudDialogflowV2beta1OutputAudioConfig.fromJson( - _json['outputAudioConfig'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('queryResult')) { - queryResult = GoogleCloudDialogflowV2beta1QueryResult.fromJson( - _json['queryResult'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('responseId')) { - responseId = _json['responseId'] as core.String; - } - if (_json.containsKey('webhookStatus')) { - webhookStatus = GoogleRpcStatus.fromJson( - _json['webhookStatus'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (alternativeQueryResults != null) { - _json['alternativeQueryResults'] = - alternativeQueryResults.map((value) => value.toJson()).toList(); - } - if (outputAudio != null) { - _json['outputAudio'] = outputAudio; - } - if (outputAudioConfig != null) { - _json['outputAudioConfig'] = outputAudioConfig.toJson(); - } - if (queryResult != null) { - _json['queryResult'] = queryResult.toJson(); - } - if (responseId != null) { - _json['responseId'] = responseId; - } - if (webhookStatus != null) { - _json['webhookStatus'] = webhookStatus.toJson(); - } - return _json; - } -} - -/// A knowledge document to be used by a KnowledgeBase. -/// -/// For more information, see the -/// [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -class GoogleCloudDialogflowV2beta1Document { - /// The raw content of the document. - /// - /// This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. - /// Note: This field is in the process of being deprecated, please use - /// raw_content instead. - core.String content; - - /// The URI where the file content is located. - /// - /// For documents stored in Google Cloud Storage, these URIs must have the - /// form `gs:///`. NOTE: External URLs must correspond to public webpages, - /// i.e., they must be indexed by Google Search. In particular, URLs for - /// showing documents in Google Cloud Storage (i.e. the URL in your browser) - /// are not supported. Instead use the `gs://` format URI described above. - core.String contentUri; - - /// The display name of the document. - /// - /// The name must be 1024 bytes or less; otherwise, the creation request - /// fails. - /// - /// Required. - core.String displayName; - - /// If true, we try to automatically reload the document every day (at a time - /// picked by the system). - /// - /// If false or unspecified, we don't try to automatically reload the - /// document. Currently you can only enable automatic reload for documents - /// sourced from a public url, see `source` field for the source types. Reload - /// status can be tracked in `latest_reload_status`. If a reload fails, we - /// will keep the document unchanged. If a reload fails with internal errors, - /// the system will try to reload the document on the next day. If a reload - /// fails with non-retriable errors (e.g. PERMISION_DENIED), the system will - /// not try to reload the document anymore. You need to manually reload the - /// document successfully by calling `ReloadDocument` and clear the errors. - /// - /// Optional. - core.bool enableAutoReload; - - /// The knowledge type of document content. - /// - /// Required. - core.List<core.String> knowledgeTypes; - - /// The time and status of the latest reload. - /// - /// This reload may have been triggered automatically or manually and may not - /// have succeeded. - /// - /// Output only. - GoogleCloudDialogflowV2beta1DocumentReloadStatus latestReloadStatus; - - /// The MIME type of this document. - /// - /// Required. - core.String mimeType; - - /// The document resource name. - /// - /// The name must be empty when creating a document. Format: - /// `projects//knowledgeBases//documents/`. - /// - /// Optional. - core.String name; - - /// The raw content of the document. - /// - /// This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. - core.String rawContent; - core.List<core.int> get rawContentAsBytes => - convert.base64.decode(rawContent); - - set rawContentAsBytes(core.List<core.int> _bytes) { - rawContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - GoogleCloudDialogflowV2beta1Document(); - - GoogleCloudDialogflowV2beta1Document.fromJson(core.Map _json) { - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - if (_json.containsKey('contentUri')) { - contentUri = _json['contentUri'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enableAutoReload')) { - enableAutoReload = _json['enableAutoReload'] as core.bool; - } - if (_json.containsKey('knowledgeTypes')) { - knowledgeTypes = (_json['knowledgeTypes'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('latestReloadStatus')) { - latestReloadStatus = - GoogleCloudDialogflowV2beta1DocumentReloadStatus.fromJson( - _json['latestReloadStatus'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('mimeType')) { - mimeType = _json['mimeType'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('rawContent')) { - rawContent = _json['rawContent'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (content != null) { - _json['content'] = content; - } - if (contentUri != null) { - _json['contentUri'] = contentUri; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enableAutoReload != null) { - _json['enableAutoReload'] = enableAutoReload; - } - if (knowledgeTypes != null) { - _json['knowledgeTypes'] = knowledgeTypes; - } - if (latestReloadStatus != null) { - _json['latestReloadStatus'] = latestReloadStatus.toJson(); - } - if (mimeType != null) { - _json['mimeType'] = mimeType; - } - if (name != null) { - _json['name'] = name; - } - if (rawContent != null) { - _json['rawContent'] = rawContent; - } - return _json; - } -} - -/// The status of a reload attempt. -class GoogleCloudDialogflowV2beta1DocumentReloadStatus { - /// The status of a reload attempt or the initial load. - /// - /// Output only. - GoogleRpcStatus status; - - /// The time of a reload attempt. - /// - /// This reload may have been triggered automatically or manually and may not - /// have succeeded. - /// - /// Output only. - core.String time; - - GoogleCloudDialogflowV2beta1DocumentReloadStatus(); - - GoogleCloudDialogflowV2beta1DocumentReloadStatus.fromJson(core.Map _json) { - if (_json.containsKey('status')) { - status = GoogleRpcStatus.fromJson( - _json['status'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('time')) { - time = _json['time'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (status != null) { - _json['status'] = status.toJson(); - } - if (time != null) { - _json['time'] = time; - } - return _json; - } -} - -/// Each intent parameter has a type, called the entity type, which dictates -/// exactly how data from an end-user expression is extracted. -/// -/// Dialogflow provides predefined system entities that can match many common -/// types of data. For example, there are system entities for matching dates, -/// times, colors, email addresses, and so on. You can also create your own -/// custom entities for matching custom data. For example, you could define a -/// vegetable entity that can match the types of vegetables available for -/// purchase with a grocery store agent. For more information, see the -/// [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). -class GoogleCloudDialogflowV2beta1EntityType { - /// Indicates whether the entity type can be automatically expanded. - /// - /// Optional. - /// Possible string values are: - /// - "AUTO_EXPANSION_MODE_UNSPECIFIED" : Auto expansion disabled for the - /// entity. - /// - "AUTO_EXPANSION_MODE_DEFAULT" : Allows an agent to recognize values that - /// have not been explicitly listed in the entity. - core.String autoExpansionMode; - - /// The name of the entity type. - /// - /// Required. - core.String displayName; - - /// Enables fuzzy entity extraction during classification. - /// - /// Optional. - core.bool enableFuzzyExtraction; - - /// The collection of entity entries associated with the entity type. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity> entities; - - /// Indicates the kind of entity type. - /// - /// Required. - /// Possible string values are: - /// - "KIND_UNSPECIFIED" : Not specified. This value should be never used. - /// - "KIND_MAP" : Map entity types allow mapping of a group of synonyms to a - /// reference value. - /// - "KIND_LIST" : List entity types contain a set of entries that do not map - /// to reference values. However, list entity types can contain references to - /// other entity types (with or without aliases). - /// - "KIND_REGEXP" : Regexp entity types allow to specify regular expressions - /// in entries values. - core.String kind; - - /// The unique identifier of the entity type. - /// - /// Required for EntityTypes.UpdateEntityType and - /// EntityTypes.BatchUpdateEntityTypes methods. Supported formats: - - /// `projects//agent/entityTypes/` - `projects//locations//agent/entityTypes/` - core.String name; - - GoogleCloudDialogflowV2beta1EntityType(); - - GoogleCloudDialogflowV2beta1EntityType.fromJson(core.Map _json) { - if (_json.containsKey('autoExpansionMode')) { - autoExpansionMode = _json['autoExpansionMode'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enableFuzzyExtraction')) { - enableFuzzyExtraction = _json['enableFuzzyExtraction'] as core.bool; - } - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => - GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('kind')) { - kind = _json['kind'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (autoExpansionMode != null) { - _json['autoExpansionMode'] = autoExpansionMode; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enableFuzzyExtraction != null) { - _json['enableFuzzyExtraction'] = enableFuzzyExtraction; - } - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (kind != null) { - _json['kind'] = kind; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// This message is a wrapper around a collection of entity types. -class GoogleCloudDialogflowV2beta1EntityTypeBatch { - /// A collection of entity types. - core.List<GoogleCloudDialogflowV2beta1EntityType> entityTypes; - - GoogleCloudDialogflowV2beta1EntityTypeBatch(); - - GoogleCloudDialogflowV2beta1EntityTypeBatch.fromJson(core.Map _json) { - if (_json.containsKey('entityTypes')) { - entityTypes = (_json['entityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityType>((value) => - GoogleCloudDialogflowV2beta1EntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypes != null) { - _json['entityTypes'] = - entityTypes.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An **entity entry** for an associated entity type. -class GoogleCloudDialogflowV2beta1EntityTypeEntity { - /// A collection of value synonyms. - /// - /// For example, if the entity type is *vegetable*, and `value` is - /// *scallions*, a synonym could be *green onions*. For `KIND_LIST` entity - /// types: * This collection must contain exactly one synonym equal to - /// `value`. - /// - /// Required. - core.List<core.String> synonyms; - - /// The primary value associated with this entity entry. - /// - /// For example, if the entity type is *vegetable*, the value could be - /// *scallions*. For `KIND_MAP` entity types: * A reference value to be used - /// in place of synonyms. For `KIND_LIST` entity types: * A string that can - /// contain references to other entity types (with or without aliases). - /// - /// Required. - core.String value; - - GoogleCloudDialogflowV2beta1EntityTypeEntity(); - - GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson(core.Map _json) { - if (_json.containsKey('synonyms')) { - synonyms = (_json['synonyms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (synonyms != null) { - _json['synonyms'] = synonyms; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// You can create multiple versions of your agent and publish them to separate -/// environments. -/// -/// When you edit an agent, you are editing the draft agent. At any point, you -/// can save the draft agent as an agent version, which is an immutable snapshot -/// of your agent. When you save the draft agent, it is published to the default -/// environment. When you create agent versions, you can publish them to custom -/// environments. You can create a variety of custom environments for: - testing -/// - development - production - etc. For more information, see the -/// [versions and environments guide](https://cloud.google.com/dialogflow/docs/agents-versions). -class GoogleCloudDialogflowV2beta1Environment { - /// The agent version loaded into this environment. - /// - /// Supported formats: - `projects//agent/versions/` - - /// `projects//locations//agent/versions/` - /// - /// Optional. - core.String agentVersion; - - /// The developer-provided description for this environment. - /// - /// The maximum length is 500 characters. If exceeded, the request is - /// rejected. - /// - /// Optional. - core.String description; - - /// The unique identifier of this agent environment. - /// - /// Supported formats: - `projects//agent/environments/` - - /// `projects//locations//agent/environments/` - /// - /// Output only. - core.String name; - - /// The state of this environment. - /// - /// This field is read-only, i.e., it cannot be set by create and update - /// methods. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Not specified. This value is not used. - /// - "STOPPED" : Stopped. - /// - "LOADING" : Loading. - /// - "RUNNING" : Running. - core.String state; - - /// The last update time of this environment. - /// - /// This field is read-only, i.e., it cannot be set by create and update - /// methods. - /// - /// Output only. - core.String updateTime; - - GoogleCloudDialogflowV2beta1Environment(); - - GoogleCloudDialogflowV2beta1Environment.fromJson(core.Map _json) { - if (_json.containsKey('agentVersion')) { - agentVersion = _json['agentVersion'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentVersion != null) { - _json['agentVersion'] = agentVersion; - } - if (description != null) { - _json['description'] = description; - } - if (name != null) { - _json['name'] = name; - } - if (state != null) { - _json['state'] = state; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// Events allow for matching intents by event name instead of the natural -/// language input. -/// -/// For instance, input `` can trigger a personalized welcome response. The -/// parameter `name` may be used by the agent in the response: `"Hello -/// #welcome_event.name! What can I do for you today?"`. -class GoogleCloudDialogflowV2beta1EventInput { - /// The language of this query. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - /// - /// Required. - core.String languageCode; - - /// The unique identifier of the event. - /// - /// Required. - core.String name; - - /// The collection of parameters associated with the event. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - GoogleCloudDialogflowV2beta1EventInput(); - - GoogleCloudDialogflowV2beta1EventInput.fromJson(core.Map _json) { - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (name != null) { - _json['name'] = name; - } - if (parameters != null) { - _json['parameters'] = parameters; - } - return _json; - } -} - -/// The request message for Agents.ExportAgent. -class GoogleCloudDialogflowV2beta1ExportAgentRequest { - /// The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to - /// export the agent to. - /// - /// The format of this URI must be `gs:///`. If left unspecified, the - /// serialized agent is returned inline. - /// - /// Optional. - core.String agentUri; - - GoogleCloudDialogflowV2beta1ExportAgentRequest(); - - GoogleCloudDialogflowV2beta1ExportAgentRequest.fromJson(core.Map _json) { - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// The response message for Agents.ExportAgent. -class GoogleCloudDialogflowV2beta1ExportAgentResponse { - /// Zip compressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a file containing the exported agent. - /// - /// This field is populated only if `agent_uri` is specified in - /// `ExportAgentRequest`. - core.String agentUri; - - GoogleCloudDialogflowV2beta1ExportAgentResponse(); - - GoogleCloudDialogflowV2beta1ExportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// By default, your agent responds to a matched intent with a static response. -/// -/// As an alternative, you can provide a more dynamic response by using -/// fulfillment. When you enable fulfillment for an intent, Dialogflow responds -/// to that intent by calling a service that you define. For example, if an -/// end-user wants to schedule a haircut on Friday, your service can check your -/// database and respond to the end-user with availability information for -/// Friday. For more information, see the -/// [fulfillment guide](https://cloud.google.com/dialogflow/docs/fulfillment-overview). -class GoogleCloudDialogflowV2beta1Fulfillment { - /// The human-readable name of the fulfillment, unique within the agent. - core.String displayName; - - /// Whether fulfillment is enabled. - core.bool enabled; - - /// The field defines whether the fulfillment is enabled for certain features. - core.List<GoogleCloudDialogflowV2beta1FulfillmentFeature> features; - - /// Configuration for a generic web service. - GoogleCloudDialogflowV2beta1FulfillmentGenericWebService genericWebService; - - /// The unique identifier of the fulfillment. - /// - /// Supported formats: - `projects//agent/fulfillment` - - /// `projects//locations//agent/fulfillment` - /// - /// Required. - core.String name; - - GoogleCloudDialogflowV2beta1Fulfillment(); - - GoogleCloudDialogflowV2beta1Fulfillment.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('enabled')) { - enabled = _json['enabled'] as core.bool; - } - if (_json.containsKey('features')) { - features = (_json['features'] as core.List) - .map<GoogleCloudDialogflowV2beta1FulfillmentFeature>((value) => - GoogleCloudDialogflowV2beta1FulfillmentFeature.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('genericWebService')) { - genericWebService = - GoogleCloudDialogflowV2beta1FulfillmentGenericWebService.fromJson( - _json['genericWebService'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (enabled != null) { - _json['enabled'] = enabled; - } - if (features != null) { - _json['features'] = features.map((value) => value.toJson()).toList(); - } - if (genericWebService != null) { - _json['genericWebService'] = genericWebService.toJson(); - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Whether fulfillment is enabled for the specific feature. -class GoogleCloudDialogflowV2beta1FulfillmentFeature { - /// The type of the feature that enabled for fulfillment. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : Feature type not specified. - /// - "SMALLTALK" : Fulfillment is enabled for SmallTalk. - core.String type; - - GoogleCloudDialogflowV2beta1FulfillmentFeature(); - - GoogleCloudDialogflowV2beta1FulfillmentFeature.fromJson(core.Map _json) { - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents configuration for a generic web service. -/// -/// Dialogflow supports two mechanisms for authentications: - Basic -/// authentication with username and password. - Authentication with additional -/// authentication headers. More information could be found at: -/// https://cloud.google.com/dialogflow/docs/fulfillment-configure. -class GoogleCloudDialogflowV2beta1FulfillmentGenericWebService { - /// Indicates if generic web service is created through Cloud Functions - /// integration. - /// - /// Defaults to false. - core.bool isCloudFunction; - - /// The password for HTTP Basic authentication. - core.String password; - - /// The HTTP request headers to send together with fulfillment requests. - core.Map<core.String, core.String> requestHeaders; - - /// The fulfillment URI for receiving POST requests. - /// - /// It must use https protocol. - /// - /// Required. - core.String uri; - - /// The user name for HTTP Basic authentication. - core.String username; - - GoogleCloudDialogflowV2beta1FulfillmentGenericWebService(); - - GoogleCloudDialogflowV2beta1FulfillmentGenericWebService.fromJson( - core.Map _json) { - if (_json.containsKey('isCloudFunction')) { - isCloudFunction = _json['isCloudFunction'] as core.bool; - } - if (_json.containsKey('password')) { - password = _json['password'] as core.String; - } - if (_json.containsKey('requestHeaders')) { - requestHeaders = (_json['requestHeaders'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - if (_json.containsKey('username')) { - username = _json['username'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (isCloudFunction != null) { - _json['isCloudFunction'] = isCloudFunction; - } - if (password != null) { - _json['password'] = password; - } - if (requestHeaders != null) { - _json['requestHeaders'] = requestHeaders; - } - if (uri != null) { - _json['uri'] = uri; - } - if (username != null) { - _json['username'] = username; - } - return _json; - } -} - -/// Google Cloud Storage location for single input. -class GoogleCloudDialogflowV2beta1GcsSource { - /// The Google Cloud Storage URIs for the inputs. - /// - /// A URI is of the form: gs://bucket/object-prefix-or-name Whether a prefix - /// or name is used depends on the use case. - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2beta1GcsSource(); - - GoogleCloudDialogflowV2beta1GcsSource.fromJson(core.Map _json) { - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// The request message for Agents.ImportAgent. -class GoogleCloudDialogflowV2beta1ImportAgentRequest { - /// Zip compressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a Google Cloud Storage file containing the agent to import. - /// - /// Note: The URI must start with "gs://". - core.String agentUri; - - GoogleCloudDialogflowV2beta1ImportAgentRequest(); - - GoogleCloudDialogflowV2beta1ImportAgentRequest.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// Response message for Documents.ImportDocuments. -class GoogleCloudDialogflowV2beta1ImportDocumentsResponse { - /// Includes details about skipped documents or any other warnings. - core.List<GoogleRpcStatus> warnings; - - GoogleCloudDialogflowV2beta1ImportDocumentsResponse(); - - GoogleCloudDialogflowV2beta1ImportDocumentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('warnings')) { - warnings = (_json['warnings'] as core.List) - .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (warnings != null) { - _json['warnings'] = warnings.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Instructs the speech recognizer on how to process the audio content. -class GoogleCloudDialogflowV2beta1InputAudioConfig { - /// Audio encoding of the audio content to process. - /// - /// Required. - /// Possible string values are: - /// - "AUDIO_ENCODING_UNSPECIFIED" : Not specified. - /// - "AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed little-endian - /// samples (Linear PCM). - /// - "AUDIO_ENCODING_FLAC" : - /// \[`FLAC`\](https://xiph.org/flac/documentation.html) (Free Lossless Audio - /// Codec) is the recommended encoding because it is lossless (therefore - /// recognition is not compromised) and requires only about half the bandwidth - /// of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, - /// however, not all fields in `STREAMINFO` are supported. - /// - "AUDIO_ENCODING_MULAW" : 8-bit samples that compand 14-bit audio samples - /// using G.711 PCMU/mu-law. - /// - "AUDIO_ENCODING_AMR" : Adaptive Multi-Rate Narrowband codec. - /// `sample_rate_hertz` must be 8000. - /// - "AUDIO_ENCODING_AMR_WB" : Adaptive Multi-Rate Wideband codec. - /// `sample_rate_hertz` must be 16000. - /// - "AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio frames in Ogg container - /// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be - /// 16000. - /// - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" : Although the use of lossy - /// encodings is not recommended, if a very low bitrate encoding is required, - /// `OGG_OPUS` is highly preferred over Speex encoding. The - /// [Speex](https://speex.org/) encoding supported by Dialogflow API has a - /// header byte in each block, as in MIME type - /// `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex - /// encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The - /// stream is a sequence of blocks, one block per RTP packet. Each block - /// starts with a byte containing the length of the block, in bytes, followed - /// by one or more frames of Speex data, padded to an integral number of bytes - /// (octets) as specified in RFC 5574. In other words, each RTP header is - /// replaced with a single byte containing the block length. Only Speex - /// wideband is supported. `sample_rate_hertz` must be 16000. - core.String audioEncoding; - - /// If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult - /// with information about the recognized speech words, e.g. start and end - /// time offsets. - /// - /// If false or unspecified, Speech doesn't return any word-level information. - core.bool enableWordInfo; - - /// The language of the supplied audio. - /// - /// Dialogflow does not do translations. See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - /// - /// Required. - core.String languageCode; - - /// Which Speech model to select for the given request. - /// - /// Select the model best suited to your domain to get best results. If a - /// model is not explicitly specified, then we auto-select a model based on - /// the parameters in the InputAudioConfig. If enhanced speech model is - /// enabled for the agent and an enhanced version of the specified model for - /// the language does not exist, then the speech is recognized using the - /// standard version of the specified model. Refer to - /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - /// for more details. - core.String model; - - /// Which variant of the Speech model to use. - /// Possible string values are: - /// - "SPEECH_MODEL_VARIANT_UNSPECIFIED" : No model variant specified. In this - /// case Dialogflow defaults to USE_BEST_AVAILABLE. - /// - "USE_BEST_AVAILABLE" : Use the best available variant of the Speech - /// model that the caller is eligible for. Please see the - /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) - /// for how to make your project eligible for enhanced models. - /// - "USE_STANDARD" : Use standard model variant even if an enhanced model is - /// available. See the - /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) - /// for details about enhanced models. - /// - "USE_ENHANCED" : Use an enhanced model variant: * If an enhanced variant - /// does not exist for the given model and request language, Dialogflow falls - /// back to the standard variant. The - /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) - /// describes which models have enhanced variants. * If the API caller isn't - /// eligible for enhanced models, Dialogflow returns an error. Please see the - /// [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) - /// for how to make your project eligible. - core.String modelVariant; - - /// A list of strings containing words and phrases that the speech recognizer - /// should recognize with higher likelihood. - /// - /// See - /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - /// for more details. This field is deprecated. Please use - /// \[speech_contexts\]() instead. If you specify both \[phrase_hints\]() and - /// \[speech_contexts\](), Dialogflow will treat the \[phrase_hints\]() as a - /// single additional \[SpeechContext\](). - core.List<core.String> phraseHints; - - /// Sample rate (in Hertz) of the audio content sent in the query. - /// - /// Refer to - /// [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) - /// for more details. - /// - /// Required. - core.int sampleRateHertz; - - /// If `false` (default), recognition does not cease until the client closes - /// the stream. - /// - /// If `true`, the recognizer will detect a single spoken utterance in input - /// audio. Recognition ceases when it detects the audio's voice has stopped or - /// paused. In this case, once a detected intent is received, the client - /// should close the stream and start a new request with a new stream as - /// needed. Note: This setting is relevant only for streaming methods. Note: - /// When specified, InputAudioConfig.single_utterance takes precedence over - /// StreamingDetectIntentRequest.single_utterance. - core.bool singleUtterance; - - /// Context information to assist speech recognition. - /// - /// See - /// [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - /// for more details. - core.List<GoogleCloudDialogflowV2beta1SpeechContext> speechContexts; - - GoogleCloudDialogflowV2beta1InputAudioConfig(); - - GoogleCloudDialogflowV2beta1InputAudioConfig.fromJson(core.Map _json) { - if (_json.containsKey('audioEncoding')) { - audioEncoding = _json['audioEncoding'] as core.String; - } - if (_json.containsKey('enableWordInfo')) { - enableWordInfo = _json['enableWordInfo'] as core.bool; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('model')) { - model = _json['model'] as core.String; - } - if (_json.containsKey('modelVariant')) { - modelVariant = _json['modelVariant'] as core.String; - } - if (_json.containsKey('phraseHints')) { - phraseHints = (_json['phraseHints'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('sampleRateHertz')) { - sampleRateHertz = _json['sampleRateHertz'] as core.int; - } - if (_json.containsKey('singleUtterance')) { - singleUtterance = _json['singleUtterance'] as core.bool; - } - if (_json.containsKey('speechContexts')) { - speechContexts = (_json['speechContexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1SpeechContext>((value) => - GoogleCloudDialogflowV2beta1SpeechContext.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (audioEncoding != null) { - _json['audioEncoding'] = audioEncoding; - } - if (enableWordInfo != null) { - _json['enableWordInfo'] = enableWordInfo; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (model != null) { - _json['model'] = model; - } - if (modelVariant != null) { - _json['modelVariant'] = modelVariant; - } - if (phraseHints != null) { - _json['phraseHints'] = phraseHints; - } - if (sampleRateHertz != null) { - _json['sampleRateHertz'] = sampleRateHertz; - } - if (singleUtterance != null) { - _json['singleUtterance'] = singleUtterance; - } - if (speechContexts != null) { - _json['speechContexts'] = - speechContexts.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An intent categorizes an end-user's intention for one conversation turn. -/// -/// For each agent, you define many intents, where your combined intents can -/// handle a complete conversation. When an end-user writes or says something, -/// referred to as an end-user expression or end-user input, Dialogflow matches -/// the end-user input to the best intent in your agent. Matching an intent is -/// also known as intent classification. For more information, see the -/// [intent guide](https://cloud.google.com/dialogflow/docs/intents-overview). -class GoogleCloudDialogflowV2beta1Intent { - /// The name of the action associated with the intent. - /// - /// Note: The action name must not contain whitespaces. - /// - /// Optional. - core.String action; - - /// The list of platforms for which the first responses will be copied from - /// the messages in PLATFORM_UNSPECIFIED (i.e. default platform). - /// - /// Optional. - core.List<core.String> defaultResponsePlatforms; - - /// The name of this intent. - /// - /// Required. - core.String displayName; - - /// Indicates that this intent ends an interaction. - /// - /// Some integrations (e.g., Actions on Google or Dialogflow phone gateway) - /// use this information to close interaction with an end user. Default is - /// false. - /// - /// Optional. - core.bool endInteraction; - - /// The collection of event names that trigger the intent. - /// - /// If the collection of input contexts is not empty, all of the contexts must - /// be present in the active user session for an event to trigger this intent. - /// Event names are limited to 150 characters. - /// - /// Optional. - core.List<core.String> events; - - /// Information about all followup intents that have this intent as a direct - /// or indirect parent. - /// - /// We populate this field only in the output. - /// - /// Output only. - core.List<GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo> - followupIntentInfo; - - /// The list of context names required for this intent to be triggered. - /// - /// Formats: - `projects//agent/sessions/-/contexts/` - - /// `projects//locations//agent/sessions/-/contexts/` - /// - /// Optional. - core.List<core.String> inputContextNames; - - /// Indicates whether this is a fallback intent. - /// - /// Optional. - core.bool isFallback; - - /// The collection of rich messages corresponding to the `Response` field in - /// the Dialogflow console. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessage> messages; - - /// Indicates whether Machine Learning is disabled for the intent. - /// - /// Note: If `ml_disabled` setting is set to true, then this intent is not - /// taken into account during inference in `ML ONLY` match mode. Also, - /// auto-markup in the UI is turned off. - /// - /// Optional. - core.bool mlDisabled; - - /// Indicates whether Machine Learning is enabled for the intent. - /// - /// Note: If `ml_enabled` setting is set to false, then this intent is not - /// taken into account during inference in `ML ONLY` match mode. Also, - /// auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` - /// field instead. NOTE: If both `ml_enabled` and `ml_disabled` are either not - /// set or false, then the default value is determined as follows: - Before - /// April 15th, 2018 the default is: ml_enabled = false / ml_disabled = true. - /// - After April 15th, 2018 the default is: ml_enabled = true / ml_disabled = - /// false. - /// - /// Optional. - core.bool mlEnabled; - - /// The unique identifier of this intent. - /// - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. - /// Supported formats: - `projects//agent/intents/` - - /// `projects//locations//agent/intents/` - /// - /// Optional. - core.String name; - - /// The collection of contexts that are activated when the intent is matched. - /// - /// Context messages in this collection should not set the parameters field. - /// Setting the `lifespan_count` to 0 will reset the context when the intent - /// is matched. Format: `projects//agent/sessions/-/contexts/`. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1Context> outputContexts; - - /// The collection of parameters associated with the intent. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentParameter> parameters; - - /// The unique identifier of the parent intent in the chain of followup - /// intents. - /// - /// You can set this field when creating an intent, for example with - /// CreateIntent or BatchUpdateIntents, in order to make this intent a - /// followup intent. It identifies the parent followup intent. Format: - /// `projects//agent/intents/`. - /// - /// Optional. - core.String parentFollowupIntentName; - - /// The priority of this intent. - /// - /// Higher numbers represent higher priorities. - If the supplied value is - /// unspecified or 0, the service translates the value to 500,000, which - /// corresponds to the `Normal` priority in the console. - If the supplied - /// value is negative, the intent is ignored in runtime detect intent - /// requests. - /// - /// Optional. - core.int priority; - - /// Indicates whether to delete all contexts in the current session when this - /// intent is matched. - /// - /// Optional. - core.bool resetContexts; - - /// The unique identifier of the root intent in the chain of followup intents. - /// - /// It identifies the correct followup intents chain for this intent. Format: - /// `projects//agent/intents/`. - /// - /// Output only. - core.String rootFollowupIntentName; - - /// The collection of examples that the agent is trained on. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentTrainingPhrase> trainingPhrases; - - /// Indicates whether webhooks are enabled for the intent. - /// - /// Optional. - /// Possible string values are: - /// - "WEBHOOK_STATE_UNSPECIFIED" : Webhook is disabled in the agent and in - /// the intent. - /// - "WEBHOOK_STATE_ENABLED" : Webhook is enabled in the agent and in the - /// intent. - /// - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" : Webhook is enabled in the - /// agent and in the intent. Also, each slot filling prompt is forwarded to - /// the webhook. - core.String webhookState; - - GoogleCloudDialogflowV2beta1Intent(); - - GoogleCloudDialogflowV2beta1Intent.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('defaultResponsePlatforms')) { - defaultResponsePlatforms = - (_json['defaultResponsePlatforms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('endInteraction')) { - endInteraction = _json['endInteraction'] as core.bool; - } - if (_json.containsKey('events')) { - events = (_json['events'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('followupIntentInfo')) { - followupIntentInfo = (_json['followupIntentInfo'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo>((value) => - GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('inputContextNames')) { - inputContextNames = (_json['inputContextNames'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('isFallback')) { - isFallback = _json['isFallback'] as core.bool; - } - if (_json.containsKey('messages')) { - messages = (_json['messages'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => - GoogleCloudDialogflowV2beta1IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('mlDisabled')) { - mlDisabled = _json['mlDisabled'] as core.bool; - } - if (_json.containsKey('mlEnabled')) { - mlEnabled = _json['mlEnabled'] as core.bool; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1Context>((value) => - GoogleCloudDialogflowV2beta1Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentParameter>((value) => - GoogleCloudDialogflowV2beta1IntentParameter.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parentFollowupIntentName')) { - parentFollowupIntentName = - _json['parentFollowupIntentName'] as core.String; - } - if (_json.containsKey('priority')) { - priority = _json['priority'] as core.int; - } - if (_json.containsKey('resetContexts')) { - resetContexts = _json['resetContexts'] as core.bool; - } - if (_json.containsKey('rootFollowupIntentName')) { - rootFollowupIntentName = _json['rootFollowupIntentName'] as core.String; - } - if (_json.containsKey('trainingPhrases')) { - trainingPhrases = (_json['trainingPhrases'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentTrainingPhrase>((value) => - GoogleCloudDialogflowV2beta1IntentTrainingPhrase.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('webhookState')) { - webhookState = _json['webhookState'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (defaultResponsePlatforms != null) { - _json['defaultResponsePlatforms'] = defaultResponsePlatforms; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (endInteraction != null) { - _json['endInteraction'] = endInteraction; - } - if (events != null) { - _json['events'] = events; - } - if (followupIntentInfo != null) { - _json['followupIntentInfo'] = - followupIntentInfo.map((value) => value.toJson()).toList(); - } - if (inputContextNames != null) { - _json['inputContextNames'] = inputContextNames; - } - if (isFallback != null) { - _json['isFallback'] = isFallback; - } - if (messages != null) { - _json['messages'] = messages.map((value) => value.toJson()).toList(); - } - if (mlDisabled != null) { - _json['mlDisabled'] = mlDisabled; - } - if (mlEnabled != null) { - _json['mlEnabled'] = mlEnabled; - } - if (name != null) { - _json['name'] = name; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (parameters != null) { - _json['parameters'] = parameters.map((value) => value.toJson()).toList(); - } - if (parentFollowupIntentName != null) { - _json['parentFollowupIntentName'] = parentFollowupIntentName; - } - if (priority != null) { - _json['priority'] = priority; - } - if (resetContexts != null) { - _json['resetContexts'] = resetContexts; - } - if (rootFollowupIntentName != null) { - _json['rootFollowupIntentName'] = rootFollowupIntentName; - } - if (trainingPhrases != null) { - _json['trainingPhrases'] = - trainingPhrases.map((value) => value.toJson()).toList(); - } - if (webhookState != null) { - _json['webhookState'] = webhookState; - } - return _json; - } -} - -/// This message is a wrapper around a collection of intents. -class GoogleCloudDialogflowV2beta1IntentBatch { - /// A collection of intents. - core.List<GoogleCloudDialogflowV2beta1Intent> intents; - - GoogleCloudDialogflowV2beta1IntentBatch(); - - GoogleCloudDialogflowV2beta1IntentBatch.fromJson(core.Map _json) { - if (_json.containsKey('intents')) { - intents = (_json['intents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Intent>((value) => - GoogleCloudDialogflowV2beta1Intent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intents != null) { - _json['intents'] = intents.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents a single followup intent in the chain. -class GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { - /// The unique identifier of the followup intent. - /// - /// Format: `projects//agent/intents/`. - core.String followupIntentName; - - /// The unique identifier of the followup intent's parent. - /// - /// Format: `projects//agent/intents/`. - core.String parentFollowupIntentName; - - GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo(); - - GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo.fromJson( - core.Map _json) { - if (_json.containsKey('followupIntentName')) { - followupIntentName = _json['followupIntentName'] as core.String; - } - if (_json.containsKey('parentFollowupIntentName')) { - parentFollowupIntentName = - _json['parentFollowupIntentName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (followupIntentName != null) { - _json['followupIntentName'] = followupIntentName; - } - if (parentFollowupIntentName != null) { - _json['parentFollowupIntentName'] = parentFollowupIntentName; - } - return _json; - } -} - -/// Corresponds to the `Response` field in the Dialogflow console. -class GoogleCloudDialogflowV2beta1IntentMessage { - /// Displays a basic card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageBasicCard basicCard; - - /// Browse carousel card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard - browseCarouselCard; - - /// Displays a card. - GoogleCloudDialogflowV2beta1IntentMessageCard card; - - /// Displays a carousel card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect carouselSelect; - - /// Displays an image. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// Displays a link out suggestion chip for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion linkOutSuggestion; - - /// Displays a list card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageListSelect listSelect; - - /// The media content card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageMediaContent mediaContent; - - /// A custom platform-specific response. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// The platform that this message is intended for. - /// - /// Optional. - /// Possible string values are: - /// - "PLATFORM_UNSPECIFIED" : Not specified. - /// - "FACEBOOK" : Facebook. - /// - "SLACK" : Slack. - /// - "TELEGRAM" : Telegram. - /// - "KIK" : Kik. - /// - "SKYPE" : Skype. - /// - "LINE" : Line. - /// - "VIBER" : Viber. - /// - "ACTIONS_ON_GOOGLE" : Google Assistant See - /// [Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - /// - "TELEPHONY" : Telephony Gateway. - /// - "GOOGLE_HANGOUTS" : Google Hangouts. - core.String platform; - - /// Displays quick replies. - GoogleCloudDialogflowV2beta1IntentMessageQuickReplies quickReplies; - - /// Rich Business Messaging (RBM) carousel rich card response. - GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard rbmCarouselRichCard; - - /// Standalone Rich Business Messaging (RBM) rich card response. - GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard - rbmStandaloneRichCard; - - /// Rich Business Messaging (RBM) text response. - /// - /// RBM allows businesses to send enriched and branded versions of SMS. See - /// https://jibe.google.com/business-messaging. - GoogleCloudDialogflowV2beta1IntentMessageRbmText rbmText; - - /// Returns a voice or text-only response for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses simpleResponses; - - /// Displays suggestion chips for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageSuggestions suggestions; - - /// Table card for Actions on Google. - GoogleCloudDialogflowV2beta1IntentMessageTableCard tableCard; - - /// Plays audio from a file in Telephony Gateway. - GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio - telephonyPlayAudio; - - /// Synthesizes speech in Telephony Gateway. - GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech - telephonySynthesizeSpeech; - - /// Transfers the call in Telephony Gateway. - GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall - telephonyTransferCall; - - /// Returns a text response. - GoogleCloudDialogflowV2beta1IntentMessageText text; - - GoogleCloudDialogflowV2beta1IntentMessage(); - - GoogleCloudDialogflowV2beta1IntentMessage.fromJson(core.Map _json) { - if (_json.containsKey('basicCard')) { - basicCard = GoogleCloudDialogflowV2beta1IntentMessageBasicCard.fromJson( - _json['basicCard'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('browseCarouselCard')) { - browseCarouselCard = - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard.fromJson( - _json['browseCarouselCard'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('card')) { - card = GoogleCloudDialogflowV2beta1IntentMessageCard.fromJson( - _json['card'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('carouselSelect')) { - carouselSelect = - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect.fromJson( - _json['carouselSelect'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('linkOutSuggestion')) { - linkOutSuggestion = - GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion.fromJson( - _json['linkOutSuggestion'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('listSelect')) { - listSelect = GoogleCloudDialogflowV2beta1IntentMessageListSelect.fromJson( - _json['listSelect'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('mediaContent')) { - mediaContent = - GoogleCloudDialogflowV2beta1IntentMessageMediaContent.fromJson( - _json['mediaContent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('platform')) { - platform = _json['platform'] as core.String; - } - if (_json.containsKey('quickReplies')) { - quickReplies = - GoogleCloudDialogflowV2beta1IntentMessageQuickReplies.fromJson( - _json['quickReplies'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('rbmCarouselRichCard')) { - rbmCarouselRichCard = - GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard.fromJson( - _json['rbmCarouselRichCard'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('rbmStandaloneRichCard')) { - rbmStandaloneRichCard = - GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard.fromJson( - _json['rbmStandaloneRichCard'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('rbmText')) { - rbmText = GoogleCloudDialogflowV2beta1IntentMessageRbmText.fromJson( - _json['rbmText'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('simpleResponses')) { - simpleResponses = - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses.fromJson( - _json['simpleResponses'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('suggestions')) { - suggestions = - GoogleCloudDialogflowV2beta1IntentMessageSuggestions.fromJson( - _json['suggestions'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('tableCard')) { - tableCard = GoogleCloudDialogflowV2beta1IntentMessageTableCard.fromJson( - _json['tableCard'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('telephonyPlayAudio')) { - telephonyPlayAudio = - GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio.fromJson( - _json['telephonyPlayAudio'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('telephonySynthesizeSpeech')) { - telephonySynthesizeSpeech = - GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech - .fromJson(_json['telephonySynthesizeSpeech'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('telephonyTransferCall')) { - telephonyTransferCall = - GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall - .fromJson(_json['telephonyTransferCall'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = GoogleCloudDialogflowV2beta1IntentMessageText.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (basicCard != null) { - _json['basicCard'] = basicCard.toJson(); - } - if (browseCarouselCard != null) { - _json['browseCarouselCard'] = browseCarouselCard.toJson(); - } - if (card != null) { - _json['card'] = card.toJson(); - } - if (carouselSelect != null) { - _json['carouselSelect'] = carouselSelect.toJson(); - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (linkOutSuggestion != null) { - _json['linkOutSuggestion'] = linkOutSuggestion.toJson(); - } - if (listSelect != null) { - _json['listSelect'] = listSelect.toJson(); - } - if (mediaContent != null) { - _json['mediaContent'] = mediaContent.toJson(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (platform != null) { - _json['platform'] = platform; - } - if (quickReplies != null) { - _json['quickReplies'] = quickReplies.toJson(); - } - if (rbmCarouselRichCard != null) { - _json['rbmCarouselRichCard'] = rbmCarouselRichCard.toJson(); - } - if (rbmStandaloneRichCard != null) { - _json['rbmStandaloneRichCard'] = rbmStandaloneRichCard.toJson(); - } - if (rbmText != null) { - _json['rbmText'] = rbmText.toJson(); - } - if (simpleResponses != null) { - _json['simpleResponses'] = simpleResponses.toJson(); - } - if (suggestions != null) { - _json['suggestions'] = suggestions.toJson(); - } - if (tableCard != null) { - _json['tableCard'] = tableCard.toJson(); - } - if (telephonyPlayAudio != null) { - _json['telephonyPlayAudio'] = telephonyPlayAudio.toJson(); - } - if (telephonySynthesizeSpeech != null) { - _json['telephonySynthesizeSpeech'] = telephonySynthesizeSpeech.toJson(); - } - if (telephonyTransferCall != null) { - _json['telephonyTransferCall'] = telephonyTransferCall.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// The basic card message. -/// -/// Useful for displaying information. -class GoogleCloudDialogflowV2beta1IntentMessageBasicCard { - /// The collection of card buttons. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton> buttons; - - /// Required, unless image is present. - /// - /// The body text of the card. - core.String formattedText; - - /// The image for the card. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// The subtitle of the card. - /// - /// Optional. - core.String subtitle; - - /// The title of the card. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageBasicCard(); - - GoogleCloudDialogflowV2beta1IntentMessageBasicCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('formattedText')) { - formattedText = _json['formattedText'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (formattedText != null) { - _json['formattedText'] = formattedText; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The button object that appears at the bottom of a card. -class GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { - /// Action to take when a user taps on the button. - /// - /// Required. - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction - openUriAction; - - /// The title of the button. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton(); - - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton.fromJson( - core.Map _json) { - if (_json.containsKey('openUriAction')) { - openUriAction = - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction - .fromJson(_json['openUriAction'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (openUriAction != null) { - _json['openUriAction'] = openUriAction.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Opens the given URI. -class GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { - /// The HTTP or HTTPS scheme URI. - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction(); - - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction.fromJson( - core.Map _json) { - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// Browse Carousel Card for Actions on Google. -/// -/// https://developers.google.com/actions/assistant/responses#browsing_carousel -class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard { - /// Settings for displaying the image. - /// - /// Applies to every image in items. - /// - /// Optional. - /// Possible string values are: - /// - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : Fill the gaps between the image - /// and the image container with gray bars. - /// - "GRAY" : Fill the gaps between the image and the image container with - /// gray bars. - /// - "WHITE" : Fill the gaps between the image and the image container with - /// white bars. - /// - "CROPPED" : Image is scaled such that the image width and height match - /// or exceed the container dimensions. This may crop the top and bottom of - /// the image if the scaled image height is greater than the container height, - /// or crop the left and right of the image if the scaled image width is - /// greater than the container width. This is similar to "Zoom Mode" on a - /// widescreen TV when playing a 4:3 video. - /// - "BLURRED_BACKGROUND" : Pad the gaps between image and image frame with a - /// blurred copy of the same image. - core.String imageDisplayOptions; - - /// List of items in the Browse Carousel Card. - /// - /// Minimum of two items, maximum of ten. - /// - /// Required. - core.List< - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem> - items; - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard(); - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard.fromJson( - core.Map _json) { - if (_json.containsKey('imageDisplayOptions')) { - imageDisplayOptions = _json['imageDisplayOptions'] as core.String; - } - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (imageDisplayOptions != null) { - _json['imageDisplayOptions'] = imageDisplayOptions; - } - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Browsing carousel tile -class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem { - /// Description of the carousel item. - /// - /// Maximum of four lines of text. - /// - /// Optional. - core.String description; - - /// Text that appears at the bottom of the Browse Carousel Card. - /// - /// Maximum of one line of text. - /// - /// Optional. - core.String footer; - - /// Hero image for the carousel item. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// Action to present to the user. - /// - /// Required. - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction - openUriAction; - - /// Title of the carousel item. - /// - /// Maximum of two lines of text. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem(); - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('footer')) { - footer = _json['footer'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('openUriAction')) { - openUriAction = - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction - .fromJson(_json['openUriAction'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (footer != null) { - _json['footer'] = footer; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (openUriAction != null) { - _json['openUriAction'] = openUriAction.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Actions on Google action to open a given url. -class GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { - /// URL - /// - /// Required. - core.String url; - - /// Specifies the type of viewer that is used when opening the URL. - /// - /// Defaults to opening via web browser. - /// - /// Optional. - /// Possible string values are: - /// - "URL_TYPE_HINT_UNSPECIFIED" : Unspecified - /// - "AMP_ACTION" : Url would be an amp action - /// - "AMP_CONTENT" : URL that points directly to AMP content, or to a - /// canonical URL which refers to AMP content via . - core.String urlTypeHint; - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction(); - - GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.fromJson( - core.Map _json) { - if (_json.containsKey('url')) { - url = _json['url'] as core.String; - } - if (_json.containsKey('urlTypeHint')) { - urlTypeHint = _json['urlTypeHint'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (url != null) { - _json['url'] = url; - } - if (urlTypeHint != null) { - _json['urlTypeHint'] = urlTypeHint; - } - return _json; - } -} - -/// The card response message. -class GoogleCloudDialogflowV2beta1IntentMessageCard { - /// The collection of card buttons. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageCardButton> buttons; - - /// The public URI to an image file for the card. - /// - /// Optional. - core.String imageUri; - - /// The subtitle of the card. - /// - /// Optional. - core.String subtitle; - - /// The title of the card. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageCard(); - - GoogleCloudDialogflowV2beta1IntentMessageCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageCardButton>((value) => - GoogleCloudDialogflowV2beta1IntentMessageCardButton.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('imageUri')) { - imageUri = _json['imageUri'] as core.String; - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (imageUri != null) { - _json['imageUri'] = imageUri; - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Contains information about a button. -/// -/// Optional. -class GoogleCloudDialogflowV2beta1IntentMessageCardButton { - /// The text to send back to the Dialogflow API or a URI to open. - /// - /// Optional. - core.String postback; - - /// The text to show on the button. - /// - /// Optional. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageCardButton(); - - GoogleCloudDialogflowV2beta1IntentMessageCardButton.fromJson(core.Map _json) { - if (_json.containsKey('postback')) { - postback = _json['postback'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (postback != null) { - _json['postback'] = postback; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// The card for presenting a carousel of options to select from. -class GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { - /// Carousel items. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem> items; - - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect(); - - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect.fromJson( - core.Map _json) { - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An item in the carousel. -class GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { - /// The body text of the card. - /// - /// Optional. - core.String description; - - /// The image to display. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// Additional info about the option item. - /// - /// Required. - GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo info; - - /// Title of the carousel item. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem(); - - GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('info')) { - info = GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo.fromJson( - _json['info'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (info != null) { - _json['info'] = info.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Column properties for TableCard. -class GoogleCloudDialogflowV2beta1IntentMessageColumnProperties { - /// Column heading. - /// - /// Required. - core.String header; - - /// Defines text alignment for all cells in this column. - /// - /// Optional. - /// Possible string values are: - /// - "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : Text is aligned to the leading edge - /// of the column. - /// - "LEADING" : Text is aligned to the leading edge of the column. - /// - "CENTER" : Text is centered in the column. - /// - "TRAILING" : Text is aligned to the trailing edge of the column. - core.String horizontalAlignment; - - GoogleCloudDialogflowV2beta1IntentMessageColumnProperties(); - - GoogleCloudDialogflowV2beta1IntentMessageColumnProperties.fromJson( - core.Map _json) { - if (_json.containsKey('header')) { - header = _json['header'] as core.String; - } - if (_json.containsKey('horizontalAlignment')) { - horizontalAlignment = _json['horizontalAlignment'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (header != null) { - _json['header'] = header; - } - if (horizontalAlignment != null) { - _json['horizontalAlignment'] = horizontalAlignment; - } - return _json; - } -} - -/// The image response message. -class GoogleCloudDialogflowV2beta1IntentMessageImage { - /// A text description of the image to be used for accessibility, e.g., screen - /// readers. - /// - /// Required if image_uri is set for CarouselSelect. - core.String accessibilityText; - - /// The public URI to an image file. - /// - /// Optional. - core.String imageUri; - - GoogleCloudDialogflowV2beta1IntentMessageImage(); - - GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson(core.Map _json) { - if (_json.containsKey('accessibilityText')) { - accessibilityText = _json['accessibilityText'] as core.String; - } - if (_json.containsKey('imageUri')) { - imageUri = _json['imageUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (accessibilityText != null) { - _json['accessibilityText'] = accessibilityText; - } - if (imageUri != null) { - _json['imageUri'] = imageUri; - } - return _json; - } -} - -/// The suggestion chip message that allows the user to jump out to the app or -/// website associated with this agent. -class GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { - /// The name of the app or site this chip is linking to. - /// - /// Required. - core.String destinationName; - - /// The URI of the app or site to open when the user taps the suggestion chip. - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion(); - - GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion.fromJson( - core.Map _json) { - if (_json.containsKey('destinationName')) { - destinationName = _json['destinationName'] as core.String; - } - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (destinationName != null) { - _json['destinationName'] = destinationName; - } - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// The card for presenting a list of options to select from. -class GoogleCloudDialogflowV2beta1IntentMessageListSelect { - /// List items. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentMessageListSelectItem> items; - - /// Subtitle of the list. - /// - /// Optional. - core.String subtitle; - - /// The overall title of the list. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageListSelect(); - - GoogleCloudDialogflowV2beta1IntentMessageListSelect.fromJson(core.Map _json) { - if (_json.containsKey('items')) { - items = (_json['items'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageListSelectItem>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageListSelectItem - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (items != null) { - _json['items'] = items.map((value) => value.toJson()).toList(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// An item in the list. -class GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { - /// The main text describing the item. - /// - /// Optional. - core.String description; - - /// The image to display. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// Additional information about this option. - /// - /// Required. - GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo info; - - /// The title of the list item. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageListSelectItem(); - - GoogleCloudDialogflowV2beta1IntentMessageListSelectItem.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('info')) { - info = GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo.fromJson( - _json['info'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (info != null) { - _json['info'] = info.toJson(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The media content card for Actions on Google. -class GoogleCloudDialogflowV2beta1IntentMessageMediaContent { - /// List of media objects. - /// - /// Required. - core.List< - GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject> - mediaObjects; - - /// What type of media is the content (ie "audio"). - /// - /// Optional. - /// Possible string values are: - /// - "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : Unspecified. - /// - "AUDIO" : Response media type is audio. - core.String mediaType; - - GoogleCloudDialogflowV2beta1IntentMessageMediaContent(); - - GoogleCloudDialogflowV2beta1IntentMessageMediaContent.fromJson( - core.Map _json) { - if (_json.containsKey('mediaObjects')) { - mediaObjects = (_json['mediaObjects'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('mediaType')) { - mediaType = _json['mediaType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mediaObjects != null) { - _json['mediaObjects'] = - mediaObjects.map((value) => value.toJson()).toList(); - } - if (mediaType != null) { - _json['mediaType'] = mediaType; - } - return _json; - } -} - -/// Response media object for media content card. -class GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject { - /// Url where the media is stored. - /// - /// Required. - core.String contentUrl; - - /// Description of media card. - /// - /// Optional. - core.String description; - - /// Icon to display above media content. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage icon; - - /// Image to display above media content. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage largeImage; - - /// Name of media card. - /// - /// Required. - core.String name; - - GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject(); - - GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject.fromJson( - core.Map _json) { - if (_json.containsKey('contentUrl')) { - contentUrl = _json['contentUrl'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('icon')) { - icon = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['icon'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('largeImage')) { - largeImage = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['largeImage'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (contentUrl != null) { - _json['contentUrl'] = contentUrl; - } - if (description != null) { - _json['description'] = description; - } - if (icon != null) { - _json['icon'] = icon.toJson(); - } - if (largeImage != null) { - _json['largeImage'] = largeImage.toJson(); - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The quick replies response message. -class GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { - /// The collection of quick replies. - /// - /// Optional. - core.List<core.String> quickReplies; - - /// The title of the collection of quick replies. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageQuickReplies(); - - GoogleCloudDialogflowV2beta1IntentMessageQuickReplies.fromJson( - core.Map _json) { - if (_json.containsKey('quickReplies')) { - quickReplies = (_json['quickReplies'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (quickReplies != null) { - _json['quickReplies'] = quickReplies; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Rich Business Messaging (RBM) Card content -class GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent { - /// Description of the card (at most 2000 bytes). - /// - /// At least one of the title, description or media must be set. - /// - /// Optional. - core.String description; - - /// However at least one of the title, description or media must be set. - /// - /// Media (image, GIF or a video) to include in the card. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia media; - - /// List of suggestions to include in the card. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion> suggestions; - - /// Title of the card (at most 200 bytes). - /// - /// At least one of the title, description or media must be set. - /// - /// Optional. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent.fromJson( - core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('media')) { - media = GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia - .fromJson(_json['media'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('suggestions')) { - suggestions = (_json['suggestions'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (media != null) { - _json['media'] = media.toJson(); - } - if (suggestions != null) { - _json['suggestions'] = - suggestions.map((value) => value.toJson()).toList(); - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Rich Business Messaging (RBM) Media displayed in Cards The following -/// media-types are currently supported: Image Types * image/jpeg * image/jpg' * -/// image/gif * image/png Video Types * video/h263 * video/m4v * video/mp4 * -/// video/mpeg * video/mpeg4 * video/webm -class GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia { - /// Publicly reachable URI of the file. - /// - /// The RBM platform determines the MIME type of the file from the - /// content-type field in the HTTP headers when the platform fetches the file. - /// The content-type field must be present and accurate in the HTTP response - /// from the URL. - /// - /// Required. - core.String fileUri; - - /// Required for cards with vertical orientation. - /// - /// The height of the media within a rich card with a vertical layout. For a - /// standalone card with horizontal layout, height is not customizable, and - /// this field is ignored. - /// Possible string values are: - /// - "HEIGHT_UNSPECIFIED" : Not specified. - /// - "SHORT" : 112 DP. - /// - "MEDIUM" : 168 DP. - /// - "TALL" : 264 DP. Not available for rich card carousels when the card - /// width is set to small. - core.String height; - - /// Publicly reachable URI of the thumbnail.If you don't provide a thumbnail - /// URI, the RBM platform displays a blank placeholder thumbnail until the - /// user's device downloads the file. - /// - /// Depending on the user's setting, the file may not download automatically - /// and may require the user to tap a download button. - /// - /// Optional. - core.String thumbnailUri; - - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia.fromJson( - core.Map _json) { - if (_json.containsKey('fileUri')) { - fileUri = _json['fileUri'] as core.String; - } - if (_json.containsKey('height')) { - height = _json['height'] as core.String; - } - if (_json.containsKey('thumbnailUri')) { - thumbnailUri = _json['thumbnailUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fileUri != null) { - _json['fileUri'] = fileUri; - } - if (height != null) { - _json['height'] = height; - } - if (thumbnailUri != null) { - _json['thumbnailUri'] = thumbnailUri; - } - return _json; - } -} - -/// Carousel Rich Business Messaging (RBM) rich card. -/// -/// Rich cards allow you to respond to users with more vivid content, e.g. with -/// media and suggestions. If you want to show a single card with more control -/// over the layout, please use RbmStandaloneCard instead. -class GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard { - /// The cards in the carousel. - /// - /// A carousel must have at least 2 cards and at most 10. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent> - cardContents; - - /// The width of the cards in the carousel. - /// - /// Required. - /// Possible string values are: - /// - "CARD_WIDTH_UNSPECIFIED" : Not specified. - /// - "SMALL" : 120 DP. Note that tall media cannot be used. - /// - "MEDIUM" : 232 DP. - core.String cardWidth; - - GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard.fromJson( - core.Map _json) { - if (_json.containsKey('cardContents')) { - cardContents = (_json['cardContents'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('cardWidth')) { - cardWidth = _json['cardWidth'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cardContents != null) { - _json['cardContents'] = - cardContents.map((value) => value.toJson()).toList(); - } - if (cardWidth != null) { - _json['cardWidth'] = cardWidth; - } - return _json; - } -} - -/// Standalone Rich Business Messaging (RBM) rich card. -/// -/// Rich cards allow you to respond to users with more vivid content, e.g. with -/// media and suggestions. You can group multiple rich cards into one using -/// RbmCarouselCard but carousel cards will give you less control over the card -/// layout. -class GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard { - /// Card content. - /// - /// Required. - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent cardContent; - - /// Orientation of the card. - /// - /// Required. - /// Possible string values are: - /// - "CARD_ORIENTATION_UNSPECIFIED" : Not specified. - /// - "HORIZONTAL" : Horizontal layout. - /// - "VERTICAL" : Vertical layout. - core.String cardOrientation; - - /// Required if orientation is horizontal. - /// - /// Image preview alignment for standalone cards with horizontal layout. - /// Possible string values are: - /// - "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED" : Not specified. - /// - "LEFT" : Thumbnail preview is left-aligned. - /// - "RIGHT" : Thumbnail preview is right-aligned. - core.String thumbnailImageAlignment; - - GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard.fromJson( - core.Map _json) { - if (_json.containsKey('cardContent')) { - cardContent = - GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent.fromJson( - _json['cardContent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('cardOrientation')) { - cardOrientation = _json['cardOrientation'] as core.String; - } - if (_json.containsKey('thumbnailImageAlignment')) { - thumbnailImageAlignment = _json['thumbnailImageAlignment'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cardContent != null) { - _json['cardContent'] = cardContent.toJson(); - } - if (cardOrientation != null) { - _json['cardOrientation'] = cardOrientation; - } - if (thumbnailImageAlignment != null) { - _json['thumbnailImageAlignment'] = thumbnailImageAlignment; - } - return _json; - } -} - -/// Rich Business Messaging (RBM) suggested client-side action that the user can -/// choose from the card. -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction { - /// Suggested client side action: Dial a phone number - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial - dial; - - /// Suggested client side action: Open a URI on device - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri - openUrl; - - /// Opaque payload that the Dialogflow receives in a user event when the user - /// taps the suggested action. - /// - /// This data will be also forwarded to webhook to allow performing custom - /// business logic. - core.String postbackData; - - /// Suggested client side action: Share user location - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation - shareLocation; - - /// Text to display alongside the action. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction.fromJson( - core.Map _json) { - if (_json.containsKey('dial')) { - dial = - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial - .fromJson(_json['dial'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('openUrl')) { - openUrl = - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri - .fromJson( - _json['openUrl'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('postbackData')) { - postbackData = _json['postbackData'] as core.String; - } - if (_json.containsKey('shareLocation')) { - shareLocation = - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation - .fromJson(_json['shareLocation'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (dial != null) { - _json['dial'] = dial.toJson(); - } - if (openUrl != null) { - _json['openUrl'] = openUrl.toJson(); - } - if (postbackData != null) { - _json['postbackData'] = postbackData; - } - if (shareLocation != null) { - _json['shareLocation'] = shareLocation.toJson(); - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Opens the user's default dialer app with the specified phone number but does -/// not dial automatically. -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial { - /// The phone number to fill in the default dialer app. - /// - /// This field should be in [E.164](https://en.wikipedia.org/wiki/E.164) - /// format. An example of a correctly formatted phone number: +15556767888. - /// - /// Required. - core.String phoneNumber; - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial.fromJson( - core.Map _json) { - if (_json.containsKey('phoneNumber')) { - phoneNumber = _json['phoneNumber'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (phoneNumber != null) { - _json['phoneNumber'] = phoneNumber; - } - return _json; - } -} - -/// Opens the user's default web browser app to the specified uri If the user -/// has an app installed that is registered as the default handler for the URL, -/// then this app will be opened instead, and its icon will be used in the -/// suggested action UI. -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri { - /// The uri to open on the user device - /// - /// Required. - core.String uri; - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri.fromJson( - core.Map _json) { - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// Opens the device's location chooser so the user can pick a location to send -/// back to the agent. -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation { - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Rich Business Messaging (RBM) suggested reply that the user can click -/// instead of typing in their own response. -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply { - /// Opaque payload that the Dialogflow receives in a user event when the user - /// taps the suggested reply. - /// - /// This data will be also forwarded to webhook to allow performing custom - /// business logic. - core.String postbackData; - - /// Suggested reply text. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply.fromJson( - core.Map _json) { - if (_json.containsKey('postbackData')) { - postbackData = _json['postbackData'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (postbackData != null) { - _json['postbackData'] = postbackData; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Rich Business Messaging (RBM) suggestion. -/// -/// Suggestions allow user to easily select/click a predefined response or -/// perform an action (like opening a web uri). -class GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion { - /// Predefined client side actions that user can choose - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction action; - - /// Predefined replies for user to select instead of typing - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply reply; - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion.fromJson( - core.Map _json) { - if (_json.containsKey('action')) { - action = - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction.fromJson( - _json['action'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('reply')) { - reply = - GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply.fromJson( - _json['reply'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action.toJson(); - } - if (reply != null) { - _json['reply'] = reply.toJson(); - } - return _json; - } -} - -/// Rich Business Messaging (RBM) text response with suggestions. -class GoogleCloudDialogflowV2beta1IntentMessageRbmText { - /// One or more suggestions to show to the user. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion> - rbmSuggestion; - - /// Text sent and displayed to the user. - /// - /// Required. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageRbmText(); - - GoogleCloudDialogflowV2beta1IntentMessageRbmText.fromJson(core.Map _json) { - if (_json.containsKey('rbmSuggestion')) { - rbmSuggestion = (_json['rbmSuggestion'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (rbmSuggestion != null) { - _json['rbmSuggestion'] = - rbmSuggestion.map((value) => value.toJson()).toList(); - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Additional info about the select item for when it is triggered in a dialog. -class GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { - /// A unique key that will be sent back to the agent if this response is - /// given. - /// - /// Required. - core.String key; - - /// A list of synonyms that can also be used to trigger this item in dialog. - /// - /// Optional. - core.List<core.String> synonyms; - - GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo(); - - GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo.fromJson( - core.Map _json) { - if (_json.containsKey('key')) { - key = _json['key'] as core.String; - } - if (_json.containsKey('synonyms')) { - synonyms = (_json['synonyms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (key != null) { - _json['key'] = key; - } - if (synonyms != null) { - _json['synonyms'] = synonyms; - } - return _json; - } -} - -/// The simple response message containing speech or text. -class GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { - /// The text to display. - /// - /// Optional. - core.String displayText; - - /// One of text_to_speech or ssml must be provided. - /// - /// Structured spoken response to the user in the SSML format. Mutually - /// exclusive with text_to_speech. - core.String ssml; - - /// One of text_to_speech or ssml must be provided. - /// - /// The plain text of the speech output. Mutually exclusive with ssml. - core.String textToSpeech; - - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse(); - - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse.fromJson( - core.Map _json) { - if (_json.containsKey('displayText')) { - displayText = _json['displayText'] as core.String; - } - if (_json.containsKey('ssml')) { - ssml = _json['ssml'] as core.String; - } - if (_json.containsKey('textToSpeech')) { - textToSpeech = _json['textToSpeech'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayText != null) { - _json['displayText'] = displayText; - } - if (ssml != null) { - _json['ssml'] = ssml; - } - if (textToSpeech != null) { - _json['textToSpeech'] = textToSpeech; - } - return _json; - } -} - -/// The collection of simple response candidates. -/// -/// This message in `QueryResult.fulfillment_messages` and -/// `WebhookResponse.fulfillment_messages` should contain only one -/// `SimpleResponse`. -class GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { - /// The list of simple responses. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse> - simpleResponses; - - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses(); - - GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses.fromJson( - core.Map _json) { - if (_json.containsKey('simpleResponses')) { - simpleResponses = (_json['simpleResponses'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (simpleResponses != null) { - _json['simpleResponses'] = - simpleResponses.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The suggestion chip message that the user can tap to quickly post a reply to -/// the conversation. -class GoogleCloudDialogflowV2beta1IntentMessageSuggestion { - /// The text shown the in the suggestion chip. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageSuggestion(); - - GoogleCloudDialogflowV2beta1IntentMessageSuggestion.fromJson(core.Map _json) { - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// The collection of suggestions. -class GoogleCloudDialogflowV2beta1IntentMessageSuggestions { - /// The list of suggested replies. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentMessageSuggestion> suggestions; - - GoogleCloudDialogflowV2beta1IntentMessageSuggestions(); - - GoogleCloudDialogflowV2beta1IntentMessageSuggestions.fromJson( - core.Map _json) { - if (_json.containsKey('suggestions')) { - suggestions = (_json['suggestions'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageSuggestion>((value) => - GoogleCloudDialogflowV2beta1IntentMessageSuggestion.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (suggestions != null) { - _json['suggestions'] = - suggestions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Table card for Actions on Google. -class GoogleCloudDialogflowV2beta1IntentMessageTableCard { - /// List of buttons for the card. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton> buttons; - - /// Display properties for the columns in this table. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageColumnProperties> - columnProperties; - - /// Image which should be displayed on the card. - /// - /// Optional. - GoogleCloudDialogflowV2beta1IntentMessageImage image; - - /// Rows in this table of data. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageTableCardRow> rows; - - /// Subtitle to the title. - /// - /// Optional. - core.String subtitle; - - /// Title of the card. - /// - /// Required. - core.String title; - - GoogleCloudDialogflowV2beta1IntentMessageTableCard(); - - GoogleCloudDialogflowV2beta1IntentMessageTableCard.fromJson(core.Map _json) { - if (_json.containsKey('buttons')) { - buttons = (_json['buttons'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('columnProperties')) { - columnProperties = (_json['columnProperties'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageColumnProperties>( - (value) => - GoogleCloudDialogflowV2beta1IntentMessageColumnProperties - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('image')) { - image = GoogleCloudDialogflowV2beta1IntentMessageImage.fromJson( - _json['image'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('rows')) { - rows = (_json['rows'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageTableCardRow>((value) => - GoogleCloudDialogflowV2beta1IntentMessageTableCardRow.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('subtitle')) { - subtitle = _json['subtitle'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (buttons != null) { - _json['buttons'] = buttons.map((value) => value.toJson()).toList(); - } - if (columnProperties != null) { - _json['columnProperties'] = - columnProperties.map((value) => value.toJson()).toList(); - } - if (image != null) { - _json['image'] = image.toJson(); - } - if (rows != null) { - _json['rows'] = rows.map((value) => value.toJson()).toList(); - } - if (subtitle != null) { - _json['subtitle'] = subtitle; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Cell of TableCardRow. -class GoogleCloudDialogflowV2beta1IntentMessageTableCardCell { - /// Text in this cell. - /// - /// Required. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageTableCardCell(); - - GoogleCloudDialogflowV2beta1IntentMessageTableCardCell.fromJson( - core.Map _json) { - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Row of TableCard. -class GoogleCloudDialogflowV2beta1IntentMessageTableCardRow { - /// List of cells that make up this row. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessageTableCardCell> cells; - - /// Whether to add a visual divider after this row. - /// - /// Optional. - core.bool dividerAfter; - - GoogleCloudDialogflowV2beta1IntentMessageTableCardRow(); - - GoogleCloudDialogflowV2beta1IntentMessageTableCardRow.fromJson( - core.Map _json) { - if (_json.containsKey('cells')) { - cells = (_json['cells'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessageTableCardCell>( - (value) => GoogleCloudDialogflowV2beta1IntentMessageTableCardCell - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('dividerAfter')) { - dividerAfter = _json['dividerAfter'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cells != null) { - _json['cells'] = cells.map((value) => value.toJson()).toList(); - } - if (dividerAfter != null) { - _json['dividerAfter'] = dividerAfter; - } - return _json; - } -} - -/// Plays audio from a file in Telephony Gateway. -class GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio { - /// URI to a Google Cloud Storage object containing the audio to play, e.g., - /// "gs://bucket/object". - /// - /// The object must contain a single channel (mono) of linear PCM audio (2 - /// bytes / sample) at 8kHz. This object must be readable by the - /// `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` service account where - /// is the number of the Telephony Gateway project (usually the same as the - /// Dialogflow agent project). If the Google Cloud Storage bucket is in the - /// Telephony Gateway project, this permission is added by default when - /// enabling the Dialogflow V2 API. For audio from other sources, consider - /// using the `TelephonySynthesizeSpeech` message with SSML. - /// - /// Required. - core.String audioUri; - - GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio(); - - GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio.fromJson( - core.Map _json) { - if (_json.containsKey('audioUri')) { - audioUri = _json['audioUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (audioUri != null) { - _json['audioUri'] = audioUri; - } - return _json; - } -} - -/// Synthesizes speech and plays back the synthesized audio to the caller in -/// Telephony Gateway. -/// -/// Telephony Gateway takes the synthesizer settings from -/// `DetectIntentResponse.output_audio_config` which can either be set at -/// request-level or can come from the agent-level synthesizer config. -class GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech { - /// The SSML to be synthesized. - /// - /// For more information, see - /// [SSML](https://developers.google.com/actions/reference/ssml). - core.String ssml; - - /// The raw text to be synthesized. - core.String text; - - GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech(); - - GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech.fromJson( - core.Map _json) { - if (_json.containsKey('ssml')) { - ssml = _json['ssml'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ssml != null) { - _json['ssml'] = ssml; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Transfers the call in Telephony Gateway. -class GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall { - /// The phone number to transfer the call to in - /// [E.164 format](https://en.wikipedia.org/wiki/E.164). - /// - /// We currently only allow transferring to US numbers (+1xxxyyyzzzz). - /// - /// Required. - core.String phoneNumber; - - GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall(); - - GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall.fromJson( - core.Map _json) { - if (_json.containsKey('phoneNumber')) { - phoneNumber = _json['phoneNumber'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (phoneNumber != null) { - _json['phoneNumber'] = phoneNumber; - } - return _json; - } -} - -/// The text response message. -class GoogleCloudDialogflowV2beta1IntentMessageText { - /// The collection of the agent's responses. - /// - /// Optional. - core.List<core.String> text; - - GoogleCloudDialogflowV2beta1IntentMessageText(); - - GoogleCloudDialogflowV2beta1IntentMessageText.fromJson(core.Map _json) { - if (_json.containsKey('text')) { - text = (_json['text'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// Represents intent parameters. -class GoogleCloudDialogflowV2beta1IntentParameter { - /// The default value to use when the `value` yields an empty result. - /// - /// Default values can be extracted from contexts by using the following - /// syntax: `#context_name.parameter_name`. - /// - /// Optional. - core.String defaultValue; - - /// The name of the parameter. - /// - /// Required. - core.String displayName; - - /// The name of the entity type, prefixed with `@`, that describes values of - /// the parameter. - /// - /// If the parameter is required, this must be provided. - /// - /// Optional. - core.String entityTypeDisplayName; - - /// Indicates whether the parameter represents a list of values. - /// - /// Optional. - core.bool isList; - - /// Indicates whether the parameter is required. - /// - /// That is, whether the intent cannot be completed without collecting the - /// parameter value. - /// - /// Optional. - core.bool mandatory; - - /// The unique identifier of this parameter. - core.String name; - - /// The collection of prompts that the agent can present to the user in order - /// to collect a value for the parameter. - /// - /// Optional. - core.List<core.String> prompts; - - /// The definition of the parameter value. - /// - /// It can be: - a constant string, - a parameter value defined as - /// `$parameter_name`, - an original parameter value defined as - /// `$parameter_name.original`, - a parameter value from some context defined - /// as `#context_name.parameter_name`. - /// - /// Optional. - core.String value; - - GoogleCloudDialogflowV2beta1IntentParameter(); - - GoogleCloudDialogflowV2beta1IntentParameter.fromJson(core.Map _json) { - if (_json.containsKey('defaultValue')) { - defaultValue = _json['defaultValue'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('entityTypeDisplayName')) { - entityTypeDisplayName = _json['entityTypeDisplayName'] as core.String; - } - if (_json.containsKey('isList')) { - isList = _json['isList'] as core.bool; - } - if (_json.containsKey('mandatory')) { - mandatory = _json['mandatory'] as core.bool; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('prompts')) { - prompts = (_json['prompts'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (defaultValue != null) { - _json['defaultValue'] = defaultValue; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (entityTypeDisplayName != null) { - _json['entityTypeDisplayName'] = entityTypeDisplayName; - } - if (isList != null) { - _json['isList'] = isList; - } - if (mandatory != null) { - _json['mandatory'] = mandatory; - } - if (name != null) { - _json['name'] = name; - } - if (prompts != null) { - _json['prompts'] = prompts; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// Represents an example that the agent is trained on. -class GoogleCloudDialogflowV2beta1IntentTrainingPhrase { - /// The unique identifier of this training phrase. - /// - /// Output only. - core.String name; - - /// The ordered list of training phrase parts. - /// - /// The parts are concatenated in order to form the training phrase. Note: The - /// API does not automatically annotate training phrases like the Dialogflow - /// Console does. Note: Do not forget to include whitespace at part - /// boundaries, so the training phrase is well formatted when the parts are - /// concatenated. If the training phrase does not need to be annotated with - /// parameters, you just need a single part with only the Part.text field set. - /// If you want to annotate the training phrase, you must create multiple - /// parts, where the fields of each part are populated in one of two ways: - - /// `Part.text` is set to a part of the phrase that has no parameters. - - /// `Part.text` is set to a part of the phrase that you want to annotate, and - /// the `entity_type`, `alias`, and `user_defined` fields are all set. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart> parts; - - /// Indicates how many times this example was added to the intent. - /// - /// Each time a developer adds an existing sample by editing an intent or - /// training, this counter is increased. - /// - /// Optional. - core.int timesAddedCount; - - /// The type of the training phrase. - /// - /// Required. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : Not specified. This value should never be used. - /// - "EXAMPLE" : Examples do not contain @-prefixed entity type names, but - /// example parts can be annotated with entity types. - /// - "TEMPLATE" : Templates are not annotated with entity types, but they can - /// contain @-prefixed entity type names as substrings. Template mode has been - /// deprecated. Example mode is the only supported way to create new training - /// phrases. If you have existing training phrases that you've created in - /// template mode, those will continue to work. - core.String type; - - GoogleCloudDialogflowV2beta1IntentTrainingPhrase(); - - GoogleCloudDialogflowV2beta1IntentTrainingPhrase.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('parts')) { - parts = (_json['parts'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart>((value) => - GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('timesAddedCount')) { - timesAddedCount = _json['timesAddedCount'] as core.int; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (parts != null) { - _json['parts'] = parts.map((value) => value.toJson()).toList(); - } - if (timesAddedCount != null) { - _json['timesAddedCount'] = timesAddedCount; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a part of a training phrase. -class GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { - /// The parameter name for the value extracted from the annotated part of the - /// example. - /// - /// This field is required for annotated parts of the training phrase. - /// - /// Optional. - core.String alias; - - /// The entity type name prefixed with `@`. - /// - /// This field is required for annotated parts of the training phrase. - /// - /// Optional. - core.String entityType; - - /// The text for this part. - /// - /// Required. - core.String text; - - /// Indicates whether the text was manually annotated. - /// - /// This field is set to true when the Dialogflow Console is used to manually - /// annotate the part. When creating an annotated part with the API, you must - /// set this to true. - /// - /// Optional. - core.bool userDefined; - - GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart(); - - GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart.fromJson( - core.Map _json) { - if (_json.containsKey('alias')) { - alias = _json['alias'] as core.String; - } - if (_json.containsKey('entityType')) { - entityType = _json['entityType'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - if (_json.containsKey('userDefined')) { - userDefined = _json['userDefined'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (alias != null) { - _json['alias'] = alias; - } - if (entityType != null) { - _json['entityType'] = entityType; - } - if (text != null) { - _json['text'] = text; - } - if (userDefined != null) { - _json['userDefined'] = userDefined; - } - return _json; - } -} - -/// Represents the result of querying a Knowledge base. -class GoogleCloudDialogflowV2beta1KnowledgeAnswers { - /// A list of answers from Knowledge Connector. - core.List<GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer> answers; - - GoogleCloudDialogflowV2beta1KnowledgeAnswers(); - - GoogleCloudDialogflowV2beta1KnowledgeAnswers.fromJson(core.Map _json) { - if (_json.containsKey('answers')) { - answers = (_json['answers'] as core.List) - .map<GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer>((value) => - GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (answers != null) { - _json['answers'] = answers.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// An answer from Knowledge Connector. -class GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer { - /// The piece of text from the `source` knowledge base document that answers - /// this conversational query. - core.String answer; - - /// The corresponding FAQ question if the answer was extracted from a FAQ - /// Document, empty otherwise. - core.String faqQuestion; - - /// The system's confidence score that this Knowledge answer is a good match - /// for this conversational query. - /// - /// The range is from 0.0 (completely uncertain) to 1.0 (completely certain). - /// Note: The confidence score is likely to vary somewhat (possibly even for - /// identical requests), as the underlying model is under constant - /// improvement. It may be deprecated in the future. We recommend using - /// `match_confidence_level` which should be generally more stable. - core.double matchConfidence; - - /// The system's confidence level that this knowledge answer is a good match - /// for this conversational query. - /// - /// NOTE: The confidence level for a given `` pair may change without notice, - /// as it depends on models that are constantly being improved. However, it - /// will change less frequently than the confidence score below, and should be - /// preferred for referencing the quality of an answer. - /// Possible string values are: - /// - "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" : Not specified. - /// - "LOW" : Indicates that the confidence is low. - /// - "MEDIUM" : Indicates our confidence is medium. - /// - "HIGH" : Indicates our confidence is high. - core.String matchConfidenceLevel; - - /// Indicates which Knowledge Document this answer was extracted from. - /// - /// Format: `projects//knowledgeBases//documents/`. - core.String source; - - GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer(); - - GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer.fromJson(core.Map _json) { - if (_json.containsKey('answer')) { - answer = _json['answer'] as core.String; - } - if (_json.containsKey('faqQuestion')) { - faqQuestion = _json['faqQuestion'] as core.String; - } - if (_json.containsKey('matchConfidence')) { - matchConfidence = (_json['matchConfidence'] as core.num).toDouble(); - } - if (_json.containsKey('matchConfidenceLevel')) { - matchConfidenceLevel = _json['matchConfidenceLevel'] as core.String; - } - if (_json.containsKey('source')) { - source = _json['source'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (answer != null) { - _json['answer'] = answer; - } - if (faqQuestion != null) { - _json['faqQuestion'] = faqQuestion; - } - if (matchConfidence != null) { - _json['matchConfidence'] = matchConfidence; - } - if (matchConfidenceLevel != null) { - _json['matchConfidenceLevel'] = matchConfidenceLevel; - } - if (source != null) { - _json['source'] = source; - } - return _json; - } -} - -/// A knowledge base represents a collection of knowledge documents that you -/// provide to Dialogflow. -/// -/// Your knowledge documents contain information that may be useful during -/// conversations with end-users. Some Dialogflow features use knowledge bases -/// when looking for a response to an end-user input. For more information, see -/// the -/// [knowledge base guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; only use -/// `projects.knowledgeBases`. -class GoogleCloudDialogflowV2beta1KnowledgeBase { - /// The display name of the knowledge base. - /// - /// The name must be 1024 bytes or less; otherwise, the creation request - /// fails. - /// - /// Required. - core.String displayName; - - /// Language which represents the KnowledgeBase. - /// - /// When the KnowledgeBase is created/updated, this is populated for all non - /// en-us languages. If not populated, the default language en-us applies. - core.String languageCode; - - /// The knowledge base resource name. - /// - /// The name must be empty when creating a knowledge base. Format: - /// `projects//knowledgeBases/`. - core.String name; - - GoogleCloudDialogflowV2beta1KnowledgeBase(); - - GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Metadata in google::longrunning::Operation for Knowledge operations. -class GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { - /// The current state of this operation. - /// - /// Required. Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : State unspecified. - /// - "PENDING" : The operation has been created. - /// - "RUNNING" : The operation is currently running. - /// - "DONE" : The operation is done, either cancelled or completed. - core.String state; - - GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata(); - - GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata.fromJson( - core.Map _json) { - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (state != null) { - _json['state'] = state; - } - return _json; - } -} - -/// The response for ConversationDatasets.LabelConversation. -class GoogleCloudDialogflowV2beta1LabelConversationResponse { - /// New annotated conversation dataset created by the labeling task. - GoogleCloudDialogflowV2beta1AnnotatedConversationDataset - annotatedConversationDataset; - - GoogleCloudDialogflowV2beta1LabelConversationResponse(); - - GoogleCloudDialogflowV2beta1LabelConversationResponse.fromJson( - core.Map _json) { - if (_json.containsKey('annotatedConversationDataset')) { - annotatedConversationDataset = - GoogleCloudDialogflowV2beta1AnnotatedConversationDataset.fromJson( - _json['annotatedConversationDataset'] - as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (annotatedConversationDataset != null) { - _json['annotatedConversationDataset'] = - annotatedConversationDataset.toJson(); - } - return _json; - } -} - -/// The response message for Contexts.ListContexts. -class GoogleCloudDialogflowV2beta1ListContextsResponse { - /// The list of contexts. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1Context> contexts; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListContextsResponse(); - - GoogleCloudDialogflowV2beta1ListContextsResponse.fromJson(core.Map _json) { - if (_json.containsKey('contexts')) { - contexts = (_json['contexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1Context>((value) => - GoogleCloudDialogflowV2beta1Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (contexts != null) { - _json['contexts'] = contexts.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for Documents.ListDocuments. -class GoogleCloudDialogflowV2beta1ListDocumentsResponse { - /// The list of documents. - core.List<GoogleCloudDialogflowV2beta1Document> documents; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListDocumentsResponse(); - - GoogleCloudDialogflowV2beta1ListDocumentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('documents')) { - documents = (_json['documents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Document>((value) => - GoogleCloudDialogflowV2beta1Document.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (documents != null) { - _json['documents'] = documents.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for EntityTypes.ListEntityTypes. -class GoogleCloudDialogflowV2beta1ListEntityTypesResponse { - /// The list of agent entity types. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1EntityType> entityTypes; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListEntityTypesResponse(); - - GoogleCloudDialogflowV2beta1ListEntityTypesResponse.fromJson(core.Map _json) { - if (_json.containsKey('entityTypes')) { - entityTypes = (_json['entityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityType>((value) => - GoogleCloudDialogflowV2beta1EntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entityTypes != null) { - _json['entityTypes'] = - entityTypes.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Environments.ListEnvironments. -class GoogleCloudDialogflowV2beta1ListEnvironmentsResponse { - /// The list of agent environments. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1Environment> environments; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListEnvironmentsResponse(); - - GoogleCloudDialogflowV2beta1ListEnvironmentsResponse.fromJson( - core.Map _json) { - if (_json.containsKey('environments')) { - environments = (_json['environments'] as core.List) - .map<GoogleCloudDialogflowV2beta1Environment>((value) => - GoogleCloudDialogflowV2beta1Environment.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (environments != null) { - _json['environments'] = - environments.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Intents.ListIntents. -class GoogleCloudDialogflowV2beta1ListIntentsResponse { - /// The list of agent intents. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1Intent> intents; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListIntentsResponse(); - - GoogleCloudDialogflowV2beta1ListIntentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('intents')) { - intents = (_json['intents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Intent>((value) => - GoogleCloudDialogflowV2beta1Intent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (intents != null) { - _json['intents'] = intents.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response message for KnowledgeBases.ListKnowledgeBases. -class GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse { - /// The list of knowledge bases. - core.List<GoogleCloudDialogflowV2beta1KnowledgeBase> knowledgeBases; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse(); - - GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('knowledgeBases')) { - knowledgeBases = (_json['knowledgeBases'] as core.List) - .map<GoogleCloudDialogflowV2beta1KnowledgeBase>((value) => - GoogleCloudDialogflowV2beta1KnowledgeBase.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (knowledgeBases != null) { - _json['knowledgeBases'] = - knowledgeBases.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for SessionEntityTypes.ListSessionEntityTypes. -class GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// The list of session entity types. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1SessionEntityType> sessionEntityTypes; - - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse(); - - GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('sessionEntityTypes')) { - sessionEntityTypes = (_json['sessionEntityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1SessionEntityType>((value) => - GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (sessionEntityTypes != null) { - _json['sessionEntityTypes'] = - sessionEntityTypes.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents the contents of the original request that was passed to the -/// `[Streaming]DetectIntent` call. -class GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { - /// This field is set to the value of the `QueryParameters.payload` field - /// passed in the request. - /// - /// Some integrations that query a Dialogflow agent may provide additional - /// information in the payload. In particular, for the Dialogflow Phone - /// Gateway integration, this field has the form: { "telephony": { - /// "caller_id": "+18558363987" } } Note: The caller ID field (`caller_id`) - /// will be redacted for Trial Edition agents and populated with the caller ID - /// in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Essentials - /// Edition agents. - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// The source of this request, e.g., `google`, `facebook`, `slack`. - /// - /// It is set by Dialogflow-owned servers. - core.String source; - - /// The version of the protocol used for this request. - /// - /// This field is AoG-specific. - /// - /// Optional. - core.String version; - - GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest(); - - GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest.fromJson( - core.Map _json) { - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('source')) { - source = _json['source'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (payload != null) { - _json['payload'] = payload; - } - if (source != null) { - _json['source'] = source; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Instructs the speech synthesizer how to generate the output audio content. -/// -/// If this audio config is supplied in a request, it overrides all existing -/// text-to-speech settings applied to the agent. -class GoogleCloudDialogflowV2beta1OutputAudioConfig { - /// Audio encoding of the synthesized audio content. - /// - /// Required. - /// Possible string values are: - /// - "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : Not specified. - /// - "OUTPUT_AUDIO_ENCODING_LINEAR_16" : Uncompressed 16-bit signed - /// little-endian samples (Linear PCM). Audio content returned as LINEAR16 - /// also contains a WAV header. - /// - "OUTPUT_AUDIO_ENCODING_MP3" : MP3 audio at 32kbps. - /// - "OUTPUT_AUDIO_ENCODING_OGG_OPUS" : Opus encoded audio wrapped in an ogg - /// container. The result will be a file which can be played natively on - /// Android, and in browsers (at least Chrome and Firefox). The quality of the - /// encoding is considerably higher than MP3 while using approximately the - /// same bitrate. - core.String audioEncoding; - - /// The synthesis sample rate (in hertz) for this audio. - /// - /// If not provided, then the synthesizer will use the default sample rate - /// based on the audio encoding. If this is different from the voice's natural - /// sample rate, then the synthesizer will honor this request by converting to - /// the desired sample rate (which might result in worse audio quality). - core.int sampleRateHertz; - - /// Configuration of how speech should be synthesized. - GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig synthesizeSpeechConfig; - - GoogleCloudDialogflowV2beta1OutputAudioConfig(); - - GoogleCloudDialogflowV2beta1OutputAudioConfig.fromJson(core.Map _json) { - if (_json.containsKey('audioEncoding')) { - audioEncoding = _json['audioEncoding'] as core.String; - } - if (_json.containsKey('sampleRateHertz')) { - sampleRateHertz = _json['sampleRateHertz'] as core.int; - } - if (_json.containsKey('synthesizeSpeechConfig')) { - synthesizeSpeechConfig = - GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig.fromJson( - _json['synthesizeSpeechConfig'] - as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (audioEncoding != null) { - _json['audioEncoding'] = audioEncoding; - } - if (sampleRateHertz != null) { - _json['sampleRateHertz'] = sampleRateHertz; - } - if (synthesizeSpeechConfig != null) { - _json['synthesizeSpeechConfig'] = synthesizeSpeechConfig.toJson(); - } - return _json; - } -} - -/// Represents the query input. -/// -/// It can contain either: 1. An audio config which instructs the speech -/// recognizer how to process the speech audio. 2. A conversational query in the -/// form of text. 3. An event that specifies which intent to trigger. -class GoogleCloudDialogflowV2beta1QueryInput { - /// Instructs the speech recognizer how to process the speech audio. - GoogleCloudDialogflowV2beta1InputAudioConfig audioConfig; - - /// The event to be processed. - GoogleCloudDialogflowV2beta1EventInput event; - - /// The natural language text to be processed. - GoogleCloudDialogflowV2beta1TextInput text; - - GoogleCloudDialogflowV2beta1QueryInput(); - - GoogleCloudDialogflowV2beta1QueryInput.fromJson(core.Map _json) { - if (_json.containsKey('audioConfig')) { - audioConfig = GoogleCloudDialogflowV2beta1InputAudioConfig.fromJson( - _json['audioConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('event')) { - event = GoogleCloudDialogflowV2beta1EventInput.fromJson( - _json['event'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = GoogleCloudDialogflowV2beta1TextInput.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (audioConfig != null) { - _json['audioConfig'] = audioConfig.toJson(); - } - if (event != null) { - _json['event'] = event.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// Represents the parameters of the conversational query. -class GoogleCloudDialogflowV2beta1QueryParameters { - /// The collection of contexts to be activated before this query is executed. - core.List<GoogleCloudDialogflowV2beta1Context> contexts; - - /// The geo location of this conversational query. - GoogleTypeLatLng geoLocation; - - /// KnowledgeBases to get alternative results from. - /// - /// If not set, the KnowledgeBases enabled in the agent (through UI) will be - /// used. Format: `projects//knowledgeBases/`. - core.List<core.String> knowledgeBaseNames; - - /// This field can be used to pass custom data to your webhook. - /// - /// Arbitrary JSON objects are supported. If supplied, the value is used to - /// populate the `WebhookRequest.original_detect_intent_request.payload` field - /// sent to your webhook. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Specifies whether to delete all contexts in the current session before the - /// new ones are activated. - core.bool resetContexts; - - /// Configures the type of sentiment analysis to perform. - /// - /// If not provided, sentiment analysis is not performed. Note: Sentiment - /// Analysis is only currently available for Essentials Edition agents. - GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig - sentimentAnalysisRequestConfig; - - /// Additional session entity types to replace or extend developer entity - /// types with. - /// - /// The entity synonyms apply to all languages and persist for the session of - /// this query. - core.List<GoogleCloudDialogflowV2beta1SessionEntityType> sessionEntityTypes; - - /// For mega agent query, directly specify which sub agents to query. - /// - /// If any specified sub agent is not linked to the mega agent, an error will - /// be returned. If empty, Dialogflow will decide which sub agents to query. - /// If specified for a non-mega-agent query, will be silently ignored. - core.List<GoogleCloudDialogflowV2beta1SubAgent> subAgents; - - /// The time zone of this conversational query from the - /// [time zone database](https://www.iana.org/time-zones), e.g., - /// America/New_York, Europe/Paris. - /// - /// If not provided, the time zone specified in agent settings is used. - core.String timeZone; - - /// This field can be used to pass HTTP headers for a webhook call. - /// - /// These headers will be sent to webhook alone with the headers that have - /// been configured through Dialogflow web console. The headers defined within - /// this field will overwrite the headers configured through Dialogflow - /// console if there is a conflict. Header names are case-insensitive. - /// Google's specified headers are not allowed. Including: "Host", - /// "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding", - /// "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. - core.Map<core.String, core.String> webhookHeaders; - - GoogleCloudDialogflowV2beta1QueryParameters(); - - GoogleCloudDialogflowV2beta1QueryParameters.fromJson(core.Map _json) { - if (_json.containsKey('contexts')) { - contexts = (_json['contexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1Context>((value) => - GoogleCloudDialogflowV2beta1Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('geoLocation')) { - geoLocation = GoogleTypeLatLng.fromJson( - _json['geoLocation'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('knowledgeBaseNames')) { - knowledgeBaseNames = (_json['knowledgeBaseNames'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('resetContexts')) { - resetContexts = _json['resetContexts'] as core.bool; - } - if (_json.containsKey('sentimentAnalysisRequestConfig')) { - sentimentAnalysisRequestConfig = - GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig.fromJson( - _json['sentimentAnalysisRequestConfig'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('sessionEntityTypes')) { - sessionEntityTypes = (_json['sessionEntityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1SessionEntityType>((value) => - GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('subAgents')) { - subAgents = (_json['subAgents'] as core.List) - .map<GoogleCloudDialogflowV2beta1SubAgent>((value) => - GoogleCloudDialogflowV2beta1SubAgent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('timeZone')) { - timeZone = _json['timeZone'] as core.String; - } - if (_json.containsKey('webhookHeaders')) { - webhookHeaders = (_json['webhookHeaders'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (contexts != null) { - _json['contexts'] = contexts.map((value) => value.toJson()).toList(); - } - if (geoLocation != null) { - _json['geoLocation'] = geoLocation.toJson(); - } - if (knowledgeBaseNames != null) { - _json['knowledgeBaseNames'] = knowledgeBaseNames; - } - if (payload != null) { - _json['payload'] = payload; - } - if (resetContexts != null) { - _json['resetContexts'] = resetContexts; - } - if (sentimentAnalysisRequestConfig != null) { - _json['sentimentAnalysisRequestConfig'] = - sentimentAnalysisRequestConfig.toJson(); - } - if (sessionEntityTypes != null) { - _json['sessionEntityTypes'] = - sessionEntityTypes.map((value) => value.toJson()).toList(); - } - if (subAgents != null) { - _json['subAgents'] = subAgents.map((value) => value.toJson()).toList(); - } - if (timeZone != null) { - _json['timeZone'] = timeZone; - } - if (webhookHeaders != null) { - _json['webhookHeaders'] = webhookHeaders; - } - return _json; - } -} - -/// Represents the result of conversational query or event processing. -class GoogleCloudDialogflowV2beta1QueryResult { - /// The action name from the matched intent. - core.String action; - - /// This field is set to: - `false` if the matched intent has required - /// parameters and not all of the required parameter values have been - /// collected. - /// - /// - `true` if all required parameter values have been collected, or if the - /// matched intent doesn't contain any required parameters. - core.bool allRequiredParamsPresent; - - /// Free-form diagnostic information for the associated detect intent request. - /// - /// The fields of this data can change without notice, so you should not write - /// code that depends on its structure. The data may contain: - webhook call - /// latency - webhook errors - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> diagnosticInfo; - - /// The collection of rich messages to present to the user. - core.List<GoogleCloudDialogflowV2beta1IntentMessage> fulfillmentMessages; - - /// The text to be pronounced to the user or shown on the screen. - /// - /// Note: This is a legacy field, `fulfillment_messages` should be preferred. - core.String fulfillmentText; - - /// The intent that matched the conversational query. - /// - /// Some, not all fields are filled in this message, including but not limited - /// to: `name`, `display_name`, `end_interaction` and `is_fallback`. - GoogleCloudDialogflowV2beta1Intent intent; - - /// The intent detection confidence. - /// - /// Values range from 0.0 (completely uncertain) to 1.0 (completely certain). - /// This value is for informational purpose only and is only used to help - /// match the best intent within the classification threshold. This value may - /// change for the same end-user expression at any time due to a model - /// retraining or change in implementation. If there are `multiple - /// knowledge_answers` messages, this value is set to the greatest - /// `knowledgeAnswers.match_confidence` value in the list. - core.double intentDetectionConfidence; - - /// The result from Knowledge Connector (if any), ordered by decreasing - /// `KnowledgeAnswers.match_confidence`. - GoogleCloudDialogflowV2beta1KnowledgeAnswers knowledgeAnswers; - - /// The language that was triggered during intent detection. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. - core.String languageCode; - - /// The collection of output contexts. - /// - /// If applicable, `output_contexts.parameters` contains entries with name - /// `.original` containing the original parameter values before the query. - core.List<GoogleCloudDialogflowV2beta1Context> outputContexts; - - /// The collection of extracted parameters. - /// - /// Depending on your protocol or client library language, this is a map, - /// associative array, symbol table, dictionary, or JSON object composed of a - /// collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey - /// value: parameter name - MapValue type: - If parameter's entity type is a - /// composite entity: map - Else: string or number, depending on parameter - /// value type - MapValue value: - If parameter's entity type is a composite - /// entity: map from composite entity property names to property values - - /// Else: parameter value - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> parameters; - - /// The original conversational query text: - If natural language text was - /// provided as input, `query_text` contains a copy of the input. - /// - /// - If natural language speech audio was provided as input, `query_text` - /// contains the speech recognition result. If speech recognizer produced - /// multiple alternatives, a particular one is picked. - If automatic spell - /// correction is enabled, `query_text` will contain the corrected user input. - core.String queryText; - - /// The sentiment analysis result, which depends on the - /// `sentiment_analysis_request_config` specified in the request. - GoogleCloudDialogflowV2beta1SentimentAnalysisResult sentimentAnalysisResult; - - /// The Speech recognition confidence between 0.0 and 1.0. - /// - /// A higher number indicates an estimated greater likelihood that the - /// recognized words are correct. The default of 0.0 is a sentinel value - /// indicating that confidence was not set. This field is not guaranteed to be - /// accurate or set. In particular this field isn't set for - /// StreamingDetectIntent since the streaming endpoint has separate confidence - /// estimates per portion of the audio in StreamingRecognitionResult. - core.double speechRecognitionConfidence; - - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `payload` field returned in the webhook response. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> webhookPayload; - - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `source` field returned in the webhook response. - core.String webhookSource; - - GoogleCloudDialogflowV2beta1QueryResult(); - - GoogleCloudDialogflowV2beta1QueryResult.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('allRequiredParamsPresent')) { - allRequiredParamsPresent = _json['allRequiredParamsPresent'] as core.bool; - } - if (_json.containsKey('diagnosticInfo')) { - diagnosticInfo = (_json['diagnosticInfo'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('fulfillmentMessages')) { - fulfillmentMessages = (_json['fulfillmentMessages'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => - GoogleCloudDialogflowV2beta1IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('fulfillmentText')) { - fulfillmentText = _json['fulfillmentText'] as core.String; - } - if (_json.containsKey('intent')) { - intent = GoogleCloudDialogflowV2beta1Intent.fromJson( - _json['intent'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('intentDetectionConfidence')) { - intentDetectionConfidence = - (_json['intentDetectionConfidence'] as core.num).toDouble(); - } - if (_json.containsKey('knowledgeAnswers')) { - knowledgeAnswers = GoogleCloudDialogflowV2beta1KnowledgeAnswers.fromJson( - _json['knowledgeAnswers'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1Context>((value) => - GoogleCloudDialogflowV2beta1Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('parameters')) { - parameters = (_json['parameters'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('queryText')) { - queryText = _json['queryText'] as core.String; - } - if (_json.containsKey('sentimentAnalysisResult')) { - sentimentAnalysisResult = - GoogleCloudDialogflowV2beta1SentimentAnalysisResult.fromJson( - _json['sentimentAnalysisResult'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('speechRecognitionConfidence')) { - speechRecognitionConfidence = - (_json['speechRecognitionConfidence'] as core.num).toDouble(); - } - if (_json.containsKey('webhookPayload')) { - webhookPayload = (_json['webhookPayload'] as core.Map) - .cast<core.String, core.Object>() - .map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('webhookSource')) { - webhookSource = _json['webhookSource'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (allRequiredParamsPresent != null) { - _json['allRequiredParamsPresent'] = allRequiredParamsPresent; - } - if (diagnosticInfo != null) { - _json['diagnosticInfo'] = diagnosticInfo; - } - if (fulfillmentMessages != null) { - _json['fulfillmentMessages'] = - fulfillmentMessages.map((value) => value.toJson()).toList(); - } - if (fulfillmentText != null) { - _json['fulfillmentText'] = fulfillmentText; - } - if (intent != null) { - _json['intent'] = intent.toJson(); - } - if (intentDetectionConfidence != null) { - _json['intentDetectionConfidence'] = intentDetectionConfidence; - } - if (knowledgeAnswers != null) { - _json['knowledgeAnswers'] = knowledgeAnswers.toJson(); - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (parameters != null) { - _json['parameters'] = parameters; - } - if (queryText != null) { - _json['queryText'] = queryText; - } - if (sentimentAnalysisResult != null) { - _json['sentimentAnalysisResult'] = sentimentAnalysisResult.toJson(); - } - if (speechRecognitionConfidence != null) { - _json['speechRecognitionConfidence'] = speechRecognitionConfidence; - } - if (webhookPayload != null) { - _json['webhookPayload'] = webhookPayload; - } - if (webhookSource != null) { - _json['webhookSource'] = webhookSource; - } - return _json; - } -} - -/// Request message for Documents.ReloadDocument. -class GoogleCloudDialogflowV2beta1ReloadDocumentRequest { - /// The path for a Cloud Storage source file for reloading document content. - /// - /// If not provided, the Document's existing source will be reloaded. - GoogleCloudDialogflowV2beta1GcsSource gcsSource; - - GoogleCloudDialogflowV2beta1ReloadDocumentRequest(); - - GoogleCloudDialogflowV2beta1ReloadDocumentRequest.fromJson(core.Map _json) { - if (_json.containsKey('gcsSource')) { - gcsSource = GoogleCloudDialogflowV2beta1GcsSource.fromJson( - _json['gcsSource'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gcsSource != null) { - _json['gcsSource'] = gcsSource.toJson(); - } - return _json; - } -} - -/// The request message for Agents.RestoreAgent. -class GoogleCloudDialogflowV2beta1RestoreAgentRequest { - /// Zip compressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a Google Cloud Storage file containing the agent to restore. - /// - /// Note: The URI must start with "gs://". - core.String agentUri; - - GoogleCloudDialogflowV2beta1RestoreAgentRequest(); - - GoogleCloudDialogflowV2beta1RestoreAgentRequest.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// The response message for Agents.SearchAgents. -class GoogleCloudDialogflowV2beta1SearchAgentsResponse { - /// The list of agents. - /// - /// There will be a maximum number of items returned based on the page_size - /// field in the request. - core.List<GoogleCloudDialogflowV2beta1Agent> agents; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - GoogleCloudDialogflowV2beta1SearchAgentsResponse(); - - GoogleCloudDialogflowV2beta1SearchAgentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('agents')) { - agents = (_json['agents'] as core.List) - .map<GoogleCloudDialogflowV2beta1Agent>((value) => - GoogleCloudDialogflowV2beta1Agent.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agents != null) { - _json['agents'] = agents.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The sentiment, such as positive/negative feeling or association, for a unit -/// of analysis, such as the query text. -class GoogleCloudDialogflowV2beta1Sentiment { - /// A non-negative number in the \[0, +inf) range, which represents the - /// absolute magnitude of sentiment, regardless of score (positive or - /// negative). - core.double magnitude; - - /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - /// sentiment). - core.double score; - - GoogleCloudDialogflowV2beta1Sentiment(); - - GoogleCloudDialogflowV2beta1Sentiment.fromJson(core.Map _json) { - if (_json.containsKey('magnitude')) { - magnitude = (_json['magnitude'] as core.num).toDouble(); - } - if (_json.containsKey('score')) { - score = (_json['score'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (magnitude != null) { - _json['magnitude'] = magnitude; - } - if (score != null) { - _json['score'] = score; - } - return _json; - } -} - -/// Configures the types of sentiment analysis to perform. -class GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig { - /// Instructs the service to perform sentiment analysis on `query_text`. - /// - /// If not provided, sentiment analysis is not performed on `query_text`. - core.bool analyzeQueryTextSentiment; - - GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig(); - - GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig.fromJson( - core.Map _json) { - if (_json.containsKey('analyzeQueryTextSentiment')) { - analyzeQueryTextSentiment = - _json['analyzeQueryTextSentiment'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (analyzeQueryTextSentiment != null) { - _json['analyzeQueryTextSentiment'] = analyzeQueryTextSentiment; - } - return _json; - } -} - -/// The result of sentiment analysis. -/// -/// Sentiment analysis inspects user input and identifies the prevailing -/// subjective opinion, especially to determine a user's attitude as positive, -/// negative, or neutral. For Participants.DetectIntent, it needs to be -/// configured in DetectIntentRequest.query_params. For -/// Participants.StreamingDetectIntent, it needs to be configured in -/// StreamingDetectIntentRequest.query_params. And for -/// Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it -/// needs to be configured in ConversationProfile.human_agent_assistant_config -class GoogleCloudDialogflowV2beta1SentimentAnalysisResult { - /// The sentiment analysis result for `query_text`. - GoogleCloudDialogflowV2beta1Sentiment queryTextSentiment; - - GoogleCloudDialogflowV2beta1SentimentAnalysisResult(); - - GoogleCloudDialogflowV2beta1SentimentAnalysisResult.fromJson(core.Map _json) { - if (_json.containsKey('queryTextSentiment')) { - queryTextSentiment = GoogleCloudDialogflowV2beta1Sentiment.fromJson( - _json['queryTextSentiment'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (queryTextSentiment != null) { - _json['queryTextSentiment'] = queryTextSentiment.toJson(); - } - return _json; - } -} - -/// A session represents a conversation between a Dialogflow agent and an -/// end-user. -/// -/// You can create special entities, called session entities, during a session. -/// Session entities can extend or replace custom entity types and only exist -/// during the session that they were created for. All session data, including -/// session entities, is stored by Dialogflow for 20 minutes. For more -/// information, see the -/// [session entity guide](https://cloud.google.com/dialogflow/docs/entities-session). -class GoogleCloudDialogflowV2beta1SessionEntityType { - /// The collection of entities associated with this session entity type. - /// - /// Required. - core.List<GoogleCloudDialogflowV2beta1EntityTypeEntity> entities; - - /// Indicates whether the additional data should override or supplement the - /// custom entity type definition. - /// - /// Required. - /// Possible string values are: - /// - "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : Not specified. This value should be - /// never used. - /// - "ENTITY_OVERRIDE_MODE_OVERRIDE" : The collection of session entities - /// overrides the collection of entities in the corresponding custom entity - /// type. - /// - "ENTITY_OVERRIDE_MODE_SUPPLEMENT" : The collection of session entities - /// extends the collection of entities in the corresponding custom entity - /// type. Note: Even in this override mode calls to `ListSessionEntityTypes`, - /// `GetSessionEntityType`, `CreateSessionEntityType` and - /// `UpdateSessionEntityType` only return the additional entities added in - /// this session entity type. If you want to get the supplemented list, please - /// call EntityTypes.GetEntityType on the custom entity type and merge. - core.String entityOverrideMode; - - /// The unique identifier of this session entity type. - /// - /// Supported formats: - `projects//agent/sessions//entityTypes/` - - /// `projects//locations//agent/sessions//entityTypes/` - - /// `projects//agent/environments//users//sessions//entityTypes/` - - /// `projects//locations//agent/environments/ /users//sessions//entityTypes/` - /// If `Location ID` is not specified we assume default 'us' location. If - /// `Environment ID` is not specified, we assume default 'draft' environment. - /// If `User ID` is not specified, we assume default '-' user. `` must be the - /// display name of an existing entity type in the same agent that will be - /// overridden or supplemented. - /// - /// Required. - core.String name; - - GoogleCloudDialogflowV2beta1SessionEntityType(); - - GoogleCloudDialogflowV2beta1SessionEntityType.fromJson(core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<GoogleCloudDialogflowV2beta1EntityTypeEntity>((value) => - GoogleCloudDialogflowV2beta1EntityTypeEntity.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('entityOverrideMode')) { - entityOverrideMode = _json['entityOverrideMode'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (entityOverrideMode != null) { - _json['entityOverrideMode'] = entityOverrideMode; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Smart Messaging Entry resource. -class GoogleCloudDialogflowV2beta1SmartMessagingEntry { - /// Metadata of the message entry - /// - /// Output only. - GoogleCloudDialogflowV2beta1SmartMessagingEntryInfo messageInfo; - - /// The unique identifier of this message entry. - /// - /// Required for \[Documents.GetSmartMessagingEntry\], - /// \[Documents.CreateSmartMessagingEntry\], - /// \[Documents.UpdateSmartMessagingEntry\], and - /// \[Documents.DeleteSmartMessagingEntry\]. Format: - /// `projects//knowledgeBases//documents//smartMessagingEntries/` - core.String name; - - /// The raw text of the message. - /// - /// Required. - core.String rawText; - - /// Smart Messaging Entry's enabled/disabled state. - /// - /// Required. - /// Possible string values are: - /// - "SMART_MESSAGING_ENTRY_STATE_UNSPECIFIED" : State unspecified. - /// - "ENABLED" : This smart reply message is enabled and used when generating - /// suggestions. - /// - "DISABLED" : This smart reply message is disabled and is not used when - /// generating suggestions. - core.String state; - - GoogleCloudDialogflowV2beta1SmartMessagingEntry(); - - GoogleCloudDialogflowV2beta1SmartMessagingEntry.fromJson(core.Map _json) { - if (_json.containsKey('messageInfo')) { - messageInfo = - GoogleCloudDialogflowV2beta1SmartMessagingEntryInfo.fromJson( - _json['messageInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('rawText')) { - rawText = _json['rawText'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (messageInfo != null) { - _json['messageInfo'] = messageInfo.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (rawText != null) { - _json['rawText'] = rawText; - } - if (state != null) { - _json['state'] = state; - } - return _json; - } -} - -/// Smart messaging entry info. -class GoogleCloudDialogflowV2beta1SmartMessagingEntryInfo { - /// Method of how the smart messaging entry was created. - /// - /// When the smart messaging entry was generated from GenerateDocument, the - /// value is AUTOMATIC; when the entry was manually added through - /// CreateSmartMessagingEntry, the value is MANUAL. - /// - /// Output only. - /// Possible string values are: - /// - "CREATION_METHOD_UNSPECIFIED" : The creation method of the smart - /// messaging entry is unspecified. The value is unused. - /// - "AUTOMATIC" : The smart messaging entry was generated automatically from - /// backend pipeline. - /// - "MANUAL" : The smart messaging entry was added manually. - core.String creationMethod; - - /// The number of times an entry's message text has been uttered - core.int occurrenceCount; - - GoogleCloudDialogflowV2beta1SmartMessagingEntryInfo(); - - GoogleCloudDialogflowV2beta1SmartMessagingEntryInfo.fromJson(core.Map _json) { - if (_json.containsKey('creationMethod')) { - creationMethod = _json['creationMethod'] as core.String; - } - if (_json.containsKey('occurrenceCount')) { - occurrenceCount = _json['occurrenceCount'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (creationMethod != null) { - _json['creationMethod'] = creationMethod; - } - if (occurrenceCount != null) { - _json['occurrenceCount'] = occurrenceCount; - } - return _json; - } -} - -/// Hints for the speech recognizer to help with recognition in a specific -/// conversation state. -class GoogleCloudDialogflowV2beta1SpeechContext { - /// Boost for this context compared to other contexts: * If the boost is - /// positive, Dialogflow will increase the probability that the phrases in - /// this context are recognized over similar sounding phrases. - /// - /// * If the boost is unspecified or non-positive, Dialogflow will not apply - /// any boost. Dialogflow recommends that you use boosts in the range (0, 20\] - /// and that you find a value that fits your use case with binary search. - /// - /// Optional. - core.double boost; - - /// A list of strings containing words and phrases that the speech recognizer - /// should recognize with higher likelihood. - /// - /// This list can be used to: * improve accuracy for words and phrases you - /// expect the user to say, e.g. typical commands for your Dialogflow agent * - /// add additional words to the speech recognizer vocabulary * ... See the - /// [Cloud Speech documentation](https://cloud.google.com/speech-to-text/quotas) - /// for usage limits. - /// - /// Optional. - core.List<core.String> phrases; - - GoogleCloudDialogflowV2beta1SpeechContext(); - - GoogleCloudDialogflowV2beta1SpeechContext.fromJson(core.Map _json) { - if (_json.containsKey('boost')) { - boost = (_json['boost'] as core.num).toDouble(); - } - if (_json.containsKey('phrases')) { - phrases = (_json['phrases'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (boost != null) { - _json['boost'] = boost; - } - if (phrases != null) { - _json['phrases'] = phrases; - } - return _json; - } -} - -/// Contains basic configuration for a sub-agent. -class GoogleCloudDialogflowV2beta1SubAgent { - /// The unique identifier (`environment name` in dialogflow console) of this - /// sub-agent environment. - /// - /// Assumes draft environment if `environment` is not set. - /// - /// Optional. - core.String environment; - - /// The project of this agent. - /// - /// Format: `projects/` or `projects//locations/`. - /// - /// Required. - core.String project; - - GoogleCloudDialogflowV2beta1SubAgent(); - - GoogleCloudDialogflowV2beta1SubAgent.fromJson(core.Map _json) { - if (_json.containsKey('environment')) { - environment = _json['environment'] as core.String; - } - if (_json.containsKey('project')) { - project = _json['project'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (environment != null) { - _json['environment'] = environment; - } - if (project != null) { - _json['project'] = project; - } - return _json; - } -} - -/// Configuration of how speech should be synthesized. -class GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig { - /// An identifier which selects 'audio effects' profiles that are applied on - /// (post synthesized) text to speech. - /// - /// Effects are applied on top of each other in the order they are given. - /// - /// Optional. - core.List<core.String> effectsProfileId; - - /// Speaking pitch, in the range \[-20.0, 20.0\]. - /// - /// 20 means increase 20 semitones from the original pitch. -20 means decrease - /// 20 semitones from the original pitch. - /// - /// Optional. - core.double pitch; - - /// Speaking rate/speed, in the range \[0.25, 4.0\]. - /// - /// 1.0 is the normal native speed supported by the specific voice. 2.0 is - /// twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the - /// native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error. - /// - /// Optional. - core.double speakingRate; - - /// The desired voice of the synthesized audio. - /// - /// Optional. - GoogleCloudDialogflowV2beta1VoiceSelectionParams voice; - - /// Volume gain (in dB) of the normal native volume supported by the specific - /// voice, in the range \[-96.0, 16.0\]. - /// - /// If unset, or set to a value of 0.0 (dB), will play at normal native signal - /// amplitude. A value of -6.0 (dB) will play at approximately half the - /// amplitude of the normal native signal amplitude. A value of +6.0 (dB) will - /// play at approximately twice the amplitude of the normal native signal - /// amplitude. We strongly recommend not to exceed +10 (dB) as there's usually - /// no effective increase in loudness for any value greater than that. - /// - /// Optional. - core.double volumeGainDb; - - GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig(); - - GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig.fromJson(core.Map _json) { - if (_json.containsKey('effectsProfileId')) { - effectsProfileId = (_json['effectsProfileId'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('pitch')) { - pitch = (_json['pitch'] as core.num).toDouble(); - } - if (_json.containsKey('speakingRate')) { - speakingRate = (_json['speakingRate'] as core.num).toDouble(); - } - if (_json.containsKey('voice')) { - voice = GoogleCloudDialogflowV2beta1VoiceSelectionParams.fromJson( - _json['voice'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('volumeGainDb')) { - volumeGainDb = (_json['volumeGainDb'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (effectsProfileId != null) { - _json['effectsProfileId'] = effectsProfileId; - } - if (pitch != null) { - _json['pitch'] = pitch; - } - if (speakingRate != null) { - _json['speakingRate'] = speakingRate; - } - if (voice != null) { - _json['voice'] = voice.toJson(); - } - if (volumeGainDb != null) { - _json['volumeGainDb'] = volumeGainDb; - } - return _json; - } -} - -/// Represents the natural language text to be processed. -class GoogleCloudDialogflowV2beta1TextInput { - /// The language of this conversational query. - /// - /// See - /// [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - /// - /// Required. - core.String languageCode; - - /// The UTF-8 encoded natural language text to be processed. - /// - /// Text length must not exceed 256 characters. - /// - /// Required. - core.String text; - - GoogleCloudDialogflowV2beta1TextInput(); - - GoogleCloudDialogflowV2beta1TextInput.fromJson(core.Map _json) { - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - if (text != null) { - _json['text'] = text; - } - return _json; - } -} - -/// The request message for Agents.TrainAgent. -class GoogleCloudDialogflowV2beta1TrainAgentRequest { - GoogleCloudDialogflowV2beta1TrainAgentRequest(); - - GoogleCloudDialogflowV2beta1TrainAgentRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a single validation error. -class GoogleCloudDialogflowV2beta1ValidationError { - /// The names of the entries that the error is associated with. - /// - /// Format: - "projects//agent", if the error is associated with the entire - /// agent. - "projects//agent/intents/", if the error is associated with - /// certain intents. - "projects//agent/intents//trainingPhrases/", if the - /// error is associated with certain intent training phrases. - - /// "projects//agent/intents//parameters/", if the error is associated with - /// certain intent parameters. - "projects//agent/entities/", if the error is - /// associated with certain entities. - core.List<core.String> entries; - - /// The detailed error messsage. - core.String errorMessage; - - /// The severity of the error. - /// Possible string values are: - /// - "SEVERITY_UNSPECIFIED" : Not specified. This value should never be used. - /// - "INFO" : The agent doesn't follow Dialogflow best practicies. - /// - "WARNING" : The agent may not behave as expected. - /// - "ERROR" : The agent may experience partial failures. - /// - "CRITICAL" : The agent may completely fail. - core.String severity; - - GoogleCloudDialogflowV2beta1ValidationError(); - - GoogleCloudDialogflowV2beta1ValidationError.fromJson(core.Map _json) { - if (_json.containsKey('entries')) { - entries = (_json['entries'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('errorMessage')) { - errorMessage = _json['errorMessage'] as core.String; - } - if (_json.containsKey('severity')) { - severity = _json['severity'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entries != null) { - _json['entries'] = entries; - } - if (errorMessage != null) { - _json['errorMessage'] = errorMessage; - } - if (severity != null) { - _json['severity'] = severity; - } - return _json; - } -} - -/// Represents the output of agent validation. -class GoogleCloudDialogflowV2beta1ValidationResult { - /// Contains all validation errors. - core.List<GoogleCloudDialogflowV2beta1ValidationError> validationErrors; - - GoogleCloudDialogflowV2beta1ValidationResult(); - - GoogleCloudDialogflowV2beta1ValidationResult.fromJson(core.Map _json) { - if (_json.containsKey('validationErrors')) { - validationErrors = (_json['validationErrors'] as core.List) - .map<GoogleCloudDialogflowV2beta1ValidationError>((value) => - GoogleCloudDialogflowV2beta1ValidationError.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (validationErrors != null) { - _json['validationErrors'] = - validationErrors.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Description of which voice to use for speech synthesis. -class GoogleCloudDialogflowV2beta1VoiceSelectionParams { - /// The name of the voice. - /// - /// If not set, the service will choose a voice based on the other parameters - /// such as language_code and ssml_gender. - /// - /// Optional. - core.String name; - - /// The preferred gender of the voice. - /// - /// If not set, the service will choose a voice based on the other parameters - /// such as language_code and name. Note that this is only a preference, not - /// requirement. If a voice of the appropriate gender is not available, the - /// synthesizer should substitute a voice with a different gender rather than - /// failing the request. - /// - /// Optional. - /// Possible string values are: - /// - "SSML_VOICE_GENDER_UNSPECIFIED" : An unspecified gender, which means - /// that the client doesn't care which gender the selected voice will have. - /// - "SSML_VOICE_GENDER_MALE" : A male voice. - /// - "SSML_VOICE_GENDER_FEMALE" : A female voice. - /// - "SSML_VOICE_GENDER_NEUTRAL" : A gender-neutral voice. - core.String ssmlGender; - - GoogleCloudDialogflowV2beta1VoiceSelectionParams(); - - GoogleCloudDialogflowV2beta1VoiceSelectionParams.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('ssmlGender')) { - ssmlGender = _json['ssmlGender'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (ssmlGender != null) { - _json['ssmlGender'] = ssmlGender; - } - return _json; - } -} - -/// The request message for a webhook call. -class GoogleCloudDialogflowV2beta1WebhookRequest { - /// Alternative query results from KnowledgeService. - core.List<GoogleCloudDialogflowV2beta1QueryResult> alternativeQueryResults; - - /// The contents of the original request that was passed to - /// `[Streaming]DetectIntent` call. - /// - /// Optional. - GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest - originalDetectIntentRequest; - - /// The result of the conversational query or event processing. - /// - /// Contains the same value as `[Streaming]DetectIntentResponse.query_result`. - GoogleCloudDialogflowV2beta1QueryResult queryResult; - - /// The unique identifier of the response. - /// - /// Contains the same value as `[Streaming]DetectIntentResponse.response_id`. - core.String responseId; - - /// The unique identifier of detectIntent request session. - /// - /// Can be used to identify end-user inside webhook implementation. Supported - /// formats: - \`projects//agent/sessions/, - - /// \`projects//locations//agent/sessions/\`, - - /// \`projects//agent/environments//users//sessions/\`, - - /// \`projects//locations//agent/environments//users//sessions/\`, - core.String session; - - GoogleCloudDialogflowV2beta1WebhookRequest(); - - GoogleCloudDialogflowV2beta1WebhookRequest.fromJson(core.Map _json) { - if (_json.containsKey('alternativeQueryResults')) { - alternativeQueryResults = (_json['alternativeQueryResults'] as core.List) - .map<GoogleCloudDialogflowV2beta1QueryResult>((value) => - GoogleCloudDialogflowV2beta1QueryResult.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('originalDetectIntentRequest')) { - originalDetectIntentRequest = - GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest.fromJson( - _json['originalDetectIntentRequest'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('queryResult')) { - queryResult = GoogleCloudDialogflowV2beta1QueryResult.fromJson( - _json['queryResult'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('responseId')) { - responseId = _json['responseId'] as core.String; - } - if (_json.containsKey('session')) { - session = _json['session'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (alternativeQueryResults != null) { - _json['alternativeQueryResults'] = - alternativeQueryResults.map((value) => value.toJson()).toList(); - } - if (originalDetectIntentRequest != null) { - _json['originalDetectIntentRequest'] = - originalDetectIntentRequest.toJson(); - } - if (queryResult != null) { - _json['queryResult'] = queryResult.toJson(); - } - if (responseId != null) { - _json['responseId'] = responseId; - } - if (session != null) { - _json['session'] = session; - } - return _json; - } -} - -/// The response message for a webhook call. -/// -/// This response is validated by the Dialogflow server. If validation fails, an -/// error will be returned in the QueryResult.diagnostic_info field. Setting -/// JSON fields to an empty value with the wrong type is a common error. To -/// avoid this error: - Use `""` for empty strings - Use `{}` or `null` for -/// empty objects - Use `[]` or `null` for empty arrays For more information, -/// see the -/// [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). -class GoogleCloudDialogflowV2beta1WebhookResponse { - /// Indicates that this intent ends an interaction. - /// - /// Some integrations (e.g., Actions on Google or Dialogflow phone gateway) - /// use this information to close interaction with an end user. Default is - /// false. - /// - /// Optional. - core.bool endInteraction; - - /// Invokes the supplied events. - /// - /// When this field is set, Dialogflow ignores the `fulfillment_text`, - /// `fulfillment_messages`, and `payload` fields. - /// - /// Optional. - GoogleCloudDialogflowV2beta1EventInput followupEventInput; - - /// The rich response messages intended for the end-user. - /// - /// When provided, Dialogflow uses this field to populate - /// QueryResult.fulfillment_messages sent to the integration or API caller. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1IntentMessage> fulfillmentMessages; - - /// The text response message intended for the end-user. - /// - /// It is recommended to use `fulfillment_messages.text.text[0]` instead. When - /// provided, Dialogflow uses this field to populate - /// QueryResult.fulfillment_text sent to the integration or API caller. - /// - /// Optional. - core.String fulfillmentText; - - /// The collection of output contexts that will overwrite currently active - /// contexts for the session and reset their lifespans. - /// - /// When provided, Dialogflow uses this field to populate - /// QueryResult.output_contexts sent to the integration or API caller. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1Context> outputContexts; - - /// This field can be used to pass custom data from your webhook to the - /// integration or API caller. - /// - /// Arbitrary JSON objects are supported. When provided, Dialogflow uses this - /// field to populate QueryResult.webhook_payload sent to the integration or - /// API caller. This field is also used by the - /// [Google Assistant integration](https://cloud.google.com/dialogflow/docs/integrations/aog) - /// for rich response messages. See the format definition at - /// [Google Assistant Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - /// - /// Optional. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> payload; - - /// Additional session entity types to replace or extend developer entity - /// types with. - /// - /// The entity synonyms apply to all languages and persist for the session. - /// Setting this data from a webhook overwrites the session entity types that - /// have been set using `detectIntent`, `streamingDetectIntent` or - /// SessionEntityType management methods. - /// - /// Optional. - core.List<GoogleCloudDialogflowV2beta1SessionEntityType> sessionEntityTypes; - - /// A custom field used to identify the webhook source. - /// - /// Arbitrary strings are supported. When provided, Dialogflow uses this field - /// to populate QueryResult.webhook_source sent to the integration or API - /// caller. - /// - /// Optional. - core.String source; - - GoogleCloudDialogflowV2beta1WebhookResponse(); - - GoogleCloudDialogflowV2beta1WebhookResponse.fromJson(core.Map _json) { - if (_json.containsKey('endInteraction')) { - endInteraction = _json['endInteraction'] as core.bool; - } - if (_json.containsKey('followupEventInput')) { - followupEventInput = GoogleCloudDialogflowV2beta1EventInput.fromJson( - _json['followupEventInput'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('fulfillmentMessages')) { - fulfillmentMessages = (_json['fulfillmentMessages'] as core.List) - .map<GoogleCloudDialogflowV2beta1IntentMessage>((value) => - GoogleCloudDialogflowV2beta1IntentMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('fulfillmentText')) { - fulfillmentText = _json['fulfillmentText'] as core.String; - } - if (_json.containsKey('outputContexts')) { - outputContexts = (_json['outputContexts'] as core.List) - .map<GoogleCloudDialogflowV2beta1Context>((value) => - GoogleCloudDialogflowV2beta1Context.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('payload')) { - payload = - (_json['payload'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('sessionEntityTypes')) { - sessionEntityTypes = (_json['sessionEntityTypes'] as core.List) - .map<GoogleCloudDialogflowV2beta1SessionEntityType>((value) => - GoogleCloudDialogflowV2beta1SessionEntityType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('source')) { - source = _json['source'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (endInteraction != null) { - _json['endInteraction'] = endInteraction; - } - if (followupEventInput != null) { - _json['followupEventInput'] = followupEventInput.toJson(); - } - if (fulfillmentMessages != null) { - _json['fulfillmentMessages'] = - fulfillmentMessages.map((value) => value.toJson()).toList(); - } - if (fulfillmentText != null) { - _json['fulfillmentText'] = fulfillmentText; - } - if (outputContexts != null) { - _json['outputContexts'] = - outputContexts.map((value) => value.toJson()).toList(); - } - if (payload != null) { - _json['payload'] = payload; - } - if (sessionEntityTypes != null) { - _json['sessionEntityTypes'] = - sessionEntityTypes.map((value) => value.toJson()).toList(); - } - if (source != null) { - _json['source'] = source; - } - return _json; - } -} - -/// The response message for Agents.ExportAgent. -class GoogleCloudDialogflowV3alpha1ExportAgentResponse { - /// Uncompressed raw byte content for agent. - core.String agentContent; - core.List<core.int> get agentContentAsBytes => - convert.base64.decode(agentContent); - - set agentContentAsBytes(core.List<core.int> _bytes) { - agentContent = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a file containing the exported agent. - /// - /// This field is populated only if `agent_uri` is specified in - /// ExportAgentRequest. - core.String agentUri; - - GoogleCloudDialogflowV3alpha1ExportAgentResponse(); - - GoogleCloudDialogflowV3alpha1ExportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agentContent')) { - agentContent = _json['agentContent'] as core.String; - } - if (_json.containsKey('agentUri')) { - agentUri = _json['agentUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agentContent != null) { - _json['agentContent'] = agentContent; - } - if (agentUri != null) { - _json['agentUri'] = agentUri; - } - return _json; - } -} - -/// Metadata returned for the TestCases.ExportTestCases long running operation. -class GoogleCloudDialogflowV3alpha1ExportTestCasesMetadata { - GoogleCloudDialogflowV3alpha1ExportTestCasesMetadata(); - - GoogleCloudDialogflowV3alpha1ExportTestCasesMetadata.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The response message for TestCases.ExportTestCases. -class GoogleCloudDialogflowV3alpha1ExportTestCasesResponse { - /// Uncompressed raw byte content for test cases. - core.String content; - core.List<core.int> get contentAsBytes => convert.base64.decode(content); - - set contentAsBytes(core.List<core.int> _bytes) { - content = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// The URI to a file containing the exported test cases. - /// - /// This field is populated only if `gcs_uri` is specified in - /// ExportTestCasesRequest. - core.String gcsUri; - - GoogleCloudDialogflowV3alpha1ExportTestCasesResponse(); - - GoogleCloudDialogflowV3alpha1ExportTestCasesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - if (_json.containsKey('gcsUri')) { - gcsUri = _json['gcsUri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (content != null) { - _json['content'] = content; - } - if (gcsUri != null) { - _json['gcsUri'] = gcsUri; - } - return _json; - } -} - -/// The response message for Agents.ImportAgent. -class GoogleCloudDialogflowV3alpha1ImportAgentResponse { - /// The unique identifier of the new agent. - /// - /// Format: `projects//locations//agents/`. - core.String agent; - - GoogleCloudDialogflowV3alpha1ImportAgentResponse(); - - GoogleCloudDialogflowV3alpha1ImportAgentResponse.fromJson(core.Map _json) { - if (_json.containsKey('agent')) { - agent = _json['agent'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (agent != null) { - _json['agent'] = agent; - } - return _json; - } -} - -/// Metadata returned for the TestCases.ImportTestCases long running operation. -class GoogleCloudDialogflowV3alpha1ImportTestCasesMetadata { - GoogleCloudDialogflowV3alpha1ImportTestCasesMetadata(); - - GoogleCloudDialogflowV3alpha1ImportTestCasesMetadata.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The response message for TestCases.ImportTestCases. -class GoogleCloudDialogflowV3alpha1ImportTestCasesResponse { - /// The unique identifiers of the new test cases. - /// - /// Format: `projects//locations//agents//testCases/`. - core.List<core.String> names; - - GoogleCloudDialogflowV3alpha1ImportTestCasesResponse(); - - GoogleCloudDialogflowV3alpha1ImportTestCasesResponse.fromJson( - core.Map _json) { - if (_json.containsKey('names')) { - names = (_json['names'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (names != null) { - _json['names'] = names; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class GoogleLongrunningListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<GoogleLongrunningOperation> operations; - - GoogleLongrunningListOperationsResponse(); - - GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<GoogleLongrunningOperation>((value) => - GoogleLongrunningOperation.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class GoogleLongrunningOperation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - GoogleRpcStatus error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - GoogleLongrunningOperation(); - - GoogleLongrunningOperation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = GoogleRpcStatus.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class GoogleProtobufEmpty { - GoogleProtobufEmpty(); - - GoogleProtobufEmpty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class GoogleRpcStatus { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - GoogleRpcStatus(); - - GoogleRpcStatus.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// An object representing a latitude/longitude pair. -/// -/// This is expressed as a pair of doubles representing degrees latitude and -/// degrees longitude. Unless specified otherwise, this must conform to the -/// WGS84 standard. Values must be within normalized ranges. -class GoogleTypeLatLng { - /// The latitude in degrees. - /// - /// It must be in the range \[-90.0, +90.0\]. - core.double latitude; - - /// The longitude in degrees. - /// - /// It must be in the range \[-180.0, +180.0\]. - core.double longitude; - - GoogleTypeLatLng(); - - GoogleTypeLatLng.fromJson(core.Map _json) { - if (_json.containsKey('latitude')) { - latitude = (_json['latitude'] as core.num).toDouble(); - } - if (_json.containsKey('longitude')) { - longitude = (_json['longitude'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (latitude != null) { - _json['latitude'] = latitude; - } - if (longitude != null) { - _json['longitude'] = longitude; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/documentai/v1beta2.dart b/generated/googleapis_beta/lib/documentai/v1beta3.dart similarity index 62% rename from generated/googleapis_beta/lib/documentai/v1beta2.dart rename to generated/googleapis_beta/lib/documentai/v1beta3.dart index 237767e..5e03682 100644 --- a/generated/googleapis_beta/lib/documentai/v1beta2.dart +++ b/generated/googleapis_beta/lib/documentai/v1beta3.dart
@@ -15,7 +15,7 @@ // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unnecessary_string_interpolations -/// Cloud Document AI API - v1beta2 +/// Cloud Document AI API - v1beta3 /// /// Service to parse structured information from unstructured or semi-structured /// documents using state-of-the-art Google AI such as natural language, @@ -26,12 +26,12 @@ /// Create an instance of [DocumentApi] to access these resources: /// /// - [ProjectsResource] -/// - [ProjectsDocumentsResource] /// - [ProjectsLocationsResource] -/// - [ProjectsLocationsDocumentsResource] /// - [ProjectsLocationsOperationsResource] -/// - [ProjectsOperationsResource] -library documentai.v1beta2; +/// - [ProjectsLocationsProcessorsResource] +/// - [ProjectsLocationsProcessorsHumanReviewConfigResource] +/// - [ProjectsLocationsProcessorsProcessorVersionsResource] +library documentai.v1beta3; import 'dart:async' as async; import 'dart:convert' as convert; @@ -67,192 +67,41 @@ class ProjectsResource { final commons.ApiRequester _requester; - ProjectsDocumentsResource get documents => - ProjectsDocumentsResource(_requester); ProjectsLocationsResource get locations => ProjectsLocationsResource(_requester); - ProjectsOperationsResource get operations => - ProjectsOperationsResource(_requester); ProjectsResource(commons.ApiRequester client) : _requester = client; } -class ProjectsDocumentsResource { - final commons.ApiRequester _requester; - - ProjectsDocumentsResource(commons.ApiRequester client) : _requester = client; - - /// LRO endpoint to batch process many documents. - /// - /// The output is written to Cloud Storage as JSON in the \[Document\] format. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Target project and location to make a call. Format: - /// `projects/{project-id}/locations/{location-id}`. If no location is - /// specified, a region will be chosen automatically. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleLongrunningOperation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchProcess( - GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents:batchProcess'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleLongrunningOperation.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Processes a single document. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Target project and location to make a call. Format: - /// `projects/{project-id}/locations/{location-id}`. If no location is - /// specified, a region will be chosen automatically. This field is only - /// populated when used in ProcessDocument method. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GoogleCloudDocumentaiV1beta2Document]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GoogleCloudDocumentaiV1beta2Document> process( - GoogleCloudDocumentaiV1beta2ProcessDocumentRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents:process'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GoogleCloudDocumentaiV1beta2Document.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - class ProjectsLocationsResource { final commons.ApiRequester _requester; - ProjectsLocationsDocumentsResource get documents => - ProjectsLocationsDocumentsResource(_requester); ProjectsLocationsOperationsResource get operations => ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsProcessorsResource get processors => + ProjectsLocationsProcessorsResource(_requester); ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; -} -class ProjectsLocationsDocumentsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsDocumentsResource(commons.ApiRequester client) - : _requester = client; - - /// LRO endpoint to batch process many documents. - /// - /// The output is written to Cloud Storage as JSON in the \[Document\] format. - /// - /// [request] - The metadata request object. + /// Gets information about a location. /// /// Request parameters: /// - /// [parent] - Target project and location to make a call. Format: - /// `projects/{project-id}/locations/{location-id}`. If no location is - /// specified, a region will be chosen automatically. + /// [name] - Resource name for the location. /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. /// - /// Completes with a [GoogleLongrunningOperation]. + /// Completes with a [GoogleCloudLocationLocation]. /// /// Completes with a [commons.ApiRequestError] if the API endpoint returned an /// error. /// /// If the used [http.Client] completes with an error when making a REST call, /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> batchProcess( - GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest request, - core.String parent, { + async.Future<GoogleCloudLocationLocation> get( + core.String name, { core.String $fields, }) { core.String _url; @@ -262,23 +111,18 @@ var _downloadOptions = commons.DownloadOptions.Metadata; core.String _body; - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); } if ($fields != null) { _queryParams['fields'] = [$fields]; } - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents:batchProcess'; + _url = 'v1beta3/' + commons.Escaper.ecapeVariableReserved('$name'); final _response = _requester.request( _url, - 'POST', + 'GET', body: _body, queryParams: _queryParams, uploadOptions: _uploadOptions, @@ -286,36 +130,39 @@ downloadOptions: _downloadOptions, ); return _response.then( - (data) => GoogleLongrunningOperation.fromJson( + (data) => GoogleCloudLocationLocation.fromJson( data as core.Map<core.String, core.dynamic>), ); } - /// Processes a single document. - /// - /// [request] - The metadata request object. + /// Lists information about the supported locations for this service. /// /// Request parameters: /// - /// [parent] - Target project and location to make a call. Format: - /// `projects/{project-id}/locations/{location-id}`. If no location is - /// specified, a region will be chosen automatically. This field is only - /// populated when used in ProcessDocument method. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. /// - /// Completes with a [GoogleCloudDocumentaiV1beta2Document]. + /// Completes with a [GoogleCloudLocationListLocationsResponse]. /// /// Completes with a [commons.ApiRequestError] if the API endpoint returned an /// error. /// /// If the used [http.Client] completes with an error when making a REST call, /// this method will complete with the same error. - async.Future<GoogleCloudDocumentaiV1beta2Document> process( - GoogleCloudDocumentaiV1beta2ProcessDocumentRequest request, - core.String parent, { + async.Future<GoogleCloudLocationListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, core.String $fields, }) { core.String _url; @@ -325,23 +172,29 @@ var _downloadOptions = commons.DownloadOptions.Metadata; core.String _body; - if (request != null) { - _body = convert.json.encode(request.toJson()); + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; } if ($fields != null) { _queryParams['fields'] = [$fields]; } - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/documents:process'; + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; final _response = _requester.request( _url, - 'POST', + 'GET', body: _body, queryParams: _queryParams, uploadOptions: _uploadOptions, @@ -349,7 +202,7 @@ downloadOptions: _downloadOptions, ); return _response.then( - (data) => GoogleCloudDocumentaiV1beta2Document.fromJson( + (data) => GoogleCloudLocationListLocationsResponse.fromJson( data as core.Map<core.String, core.dynamic>), ); } @@ -400,7 +253,7 @@ _queryParams['fields'] = [$fields]; } - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); + _url = 'v1beta3/' + commons.Escaper.ecapeVariableReserved('$name'); final _response = _requester.request( _url, @@ -418,20 +271,30 @@ } } -class ProjectsOperationsResource { +class ProjectsLocationsProcessorsResource { final commons.ApiRequester _requester; - ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; + ProjectsLocationsProcessorsHumanReviewConfigResource get humanReviewConfig => + ProjectsLocationsProcessorsHumanReviewConfigResource(_requester); + ProjectsLocationsProcessorsProcessorVersionsResource get processorVersions => + ProjectsLocationsProcessorsProcessorVersionsResource(_requester); - /// Gets the latest state of a long-running operation. + ProjectsLocationsProcessorsResource(commons.ApiRequester client) + : _requester = client; + + /// LRO endpoint to batch process many documents. /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. + /// The output is written to Cloud Storage as JSON in the \[Document\] format. + /// + /// [request] - The metadata request object. /// /// Request parameters: /// - /// [name] - The name of the operation resource. - /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. + /// [name] - Required. The resource name of Processor or ProcessorVersion. + /// Format: projects/{project}/locations/{location}/processors/{processor}, or + /// projects/{project}/locations/{location}/processors/{processor}/processorVerions/{processorVersion} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/processors/\[^/\]+$`. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -443,7 +306,8 @@ /// /// If the used [http.Client] completes with an error when making a REST call, /// this method will complete with the same error. - async.Future<GoogleLongrunningOperation> get( + async.Future<GoogleLongrunningOperation> batchProcess( + GoogleCloudDocumentaiV1beta3BatchProcessRequest request, core.String name, { core.String $fields, }) { @@ -454,6 +318,9 @@ var _downloadOptions = commons.DownloadOptions.Metadata; core.String _body; + if (request != null) { + _body = convert.json.encode(request.toJson()); + } if (name == null) { throw core.ArgumentError('Parameter name is required.'); } @@ -461,11 +328,150 @@ _queryParams['fields'] = [$fields]; } - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':batchProcess'; final _response = _requester.request( _url, - 'GET', + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Processes a single document. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name of the Processor or ProcessorVersion + /// to use for processing. If a Processor is specified, the server will use + /// its default version. Format: + /// projects/{project}/locations/{location}/processors/{processor}, or + /// projects/{project}/locations/{location}/processors/{processor}/processorVerions/{processorVersion} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/processors/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDocumentaiV1beta3ProcessResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDocumentaiV1beta3ProcessResponse> process( + GoogleCloudDocumentaiV1beta3ProcessRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':process'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDocumentaiV1beta3ProcessResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsProcessorsHumanReviewConfigResource { + final commons.ApiRequester _requester; + + ProjectsLocationsProcessorsHumanReviewConfigResource( + commons.ApiRequester client) + : _requester = client; + + /// Send a document for Human Review. + /// + /// The input document should be processed by the specified processor. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [humanReviewConfig] - Required. The resource name of the HumanReviewConfig + /// that the document will be reviewed with. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/processors/\[^/\]+/humanReviewConfig$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> reviewDocument( + GoogleCloudDocumentaiV1beta3ReviewDocumentRequest request, + core.String humanReviewConfig, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (humanReviewConfig == null) { + throw core.ArgumentError('Parameter humanReviewConfig is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$humanReviewConfig') + + ':reviewDocument'; + + final _response = _requester.request( + _url, + 'POST', body: _body, queryParams: _queryParams, uploadOptions: _uploadOptions, @@ -479,12 +485,150 @@ } } -/// The long running operation metadata for CreateLabelerPool. -class GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata { +class ProjectsLocationsProcessorsProcessorVersionsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsProcessorsProcessorVersionsResource( + commons.ApiRequester client) + : _requester = client; + + /// LRO endpoint to batch process many documents. + /// + /// The output is written to Cloud Storage as JSON in the \[Document\] format. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name of Processor or ProcessorVersion. + /// Format: projects/{project}/locations/{location}/processors/{processor}, or + /// projects/{project}/locations/{location}/processors/{processor}/processorVerions/{processorVersion} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/processors/\[^/\]+/processorVersions/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> batchProcess( + GoogleCloudDocumentaiV1beta3BatchProcessRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':batchProcess'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Processes a single document. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name of the Processor or ProcessorVersion + /// to use for processing. If a Processor is specified, the server will use + /// its default version. Format: + /// projects/{project}/locations/{location}/processors/{processor}, or + /// projects/{project}/locations/{location}/processors/{processor}/processorVerions/{processorVersion} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/processors/\[^/\]+/processorVersions/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudDocumentaiV1beta3ProcessResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudDocumentaiV1beta3ProcessResponse> process( + GoogleCloudDocumentaiV1beta3ProcessRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta3/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':process'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudDocumentaiV1beta3ProcessResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// The common metadata for long running operations. +class GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata { /// The creation time of the operation. core.String createTime; - /// Used only when Operation.done is false. + /// The state of the operation. /// Possible string values are: /// - "STATE_UNSPECIFIED" : Unspecified state. /// - "RUNNING" : Operation is still running. @@ -495,16 +639,14 @@ core.String state; /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. core.String stateMessage; /// The last update time of the operation. core.String updateTime; - GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata(); + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata(); - GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata.fromJson( + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( core.Map _json) { if (_json.containsKey('createTime')) { createTime = _json['createTime'] as core.String; @@ -538,55 +680,26 @@ } } -/// The metadata that represents a processor version being created. -class GoogleCloudDocumentaiUiv1beta3CreateProcessorVersionMetadata { - /// The creation time of the operation. - core.String createTime; +/// The long running operation metadata for CreateLabelerPool. +class GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; - /// The state of the current disable processor operation. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : The training state is unspecified. - /// - "QUEUED" : The training request has been issued but processing has not - /// yet begun. - /// - "PREPARING" : The service is preparing to execute the training. - /// - "RUNNING" : The training is in progress. - /// - "SUCCEEDED" : The training completed successfully. - /// - "FAILED" : The training failed. `error` should contain the details of - /// the failure. - /// - "CANCELLING" : The training is being cancelled. `error` should describe - /// the reason for the cancellation. - /// - "CANCELLED" : The training has been cancelled. `error` should describe - /// the reason for the cancellation. - core.String state; + GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata(); - /// The last update time of the operation. - core.String updateTime; - - GoogleCloudDocumentaiUiv1beta3CreateProcessorVersionMetadata(); - - GoogleCloudDocumentaiUiv1beta3CreateProcessorVersionMetadata.fromJson( + GoogleCloudDocumentaiUiv1beta3CreateLabelerPoolOperationMetadata.fromJson( core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } } core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (state != null) { - _json['state'] = state; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } return _json; } @@ -594,58 +707,24 @@ /// The long running operation metadata for DeleteLabelerPool. class GoogleCloudDocumentaiUiv1beta3DeleteLabelerPoolOperationMetadata { - /// The creation time of the operation. - core.String createTime; - - /// Used only when Operation.done is false. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Unspecified state. - /// - "RUNNING" : Operation is still running. - /// - "CANCELLING" : Operation is being cancelled. - /// - "SUCCEEDED" : Operation succeeded. - /// - "FAILED" : Operation failed. - /// - "CANCELLED" : Operation is cancelled. - core.String state; - - /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. - core.String stateMessage; - - /// The last update time of the operation. - core.String updateTime; + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; GoogleCloudDocumentaiUiv1beta3DeleteLabelerPoolOperationMetadata(); GoogleCloudDocumentaiUiv1beta3DeleteLabelerPoolOperationMetadata.fromJson( core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('stateMessage')) { - stateMessage = _json['stateMessage'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } } core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (state != null) { - _json['state'] = state; - } - if (stateMessage != null) { - _json['stateMessage'] = stateMessage; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } return _json; } @@ -653,119 +732,113 @@ /// The long running operation metadata for delete processor method. class GoogleCloudDocumentaiUiv1beta3DeleteProcessorMetadata { - /// The creation time of the operation. - core.String createTime; - - /// The state of the current delete processor operation. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : The default value. This value is used if the state - /// is omitted. - /// - "WAITING" : Request operation is waiting for scheduling. - /// - "RUNNING" : Request is being processed. - /// - "SUCCEEDED" : The operation is completed successfully. - /// - "FAILED" : The operation has failed. - core.String state; - - /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. - core.String stateMessage; - - /// The last update time of the operation. - core.String updateTime; + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; GoogleCloudDocumentaiUiv1beta3DeleteProcessorMetadata(); GoogleCloudDocumentaiUiv1beta3DeleteProcessorMetadata.fromJson( core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('stateMessage')) { - stateMessage = _json['stateMessage'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } } core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } - if (state != null) { - _json['state'] = state; + return _json; + } +} + +/// The long running operation metadata for delete processor version method. +class GoogleCloudDocumentaiUiv1beta3DeleteProcessorVersionMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3DeleteProcessorVersionMetadata(); + + GoogleCloudDocumentaiUiv1beta3DeleteProcessorVersionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } - if (stateMessage != null) { - _json['stateMessage'] = stateMessage; + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } - if (updateTime != null) { - _json['updateTime'] = updateTime; + return _json; + } +} + +/// The long running operation metadata for deploy processor version method. +class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionMetadata(); + + GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// Response message for the deploy processor version method. +class GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionResponse { + GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionResponse(); + + GoogleCloudDocumentaiUiv1beta3DeployProcessorVersionResponse.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; return _json; } } /// The long running operation metadata for disable processor method. class GoogleCloudDocumentaiUiv1beta3DisableProcessorMetadata { - /// The creation time of the operation. - core.String createTime; - - /// The state of the current disable processor operation. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : The default value. This value is used if the state - /// is omitted. - /// - "WAITING" : Request operation is waiting for scheduling. - /// - "RUNNING" : Request is being processed. - /// - "SUCCEEDED" : The operation is completed successfully. - /// - "CANCELLING" : The operation was being cancelled. - /// - "CANCELLED" : The operation was cancelled. - /// - "FAILED" : The operation has failed. - core.String state; - - /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. - core.String stateMessage; - - /// The last update time of the operation. - core.String updateTime; + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; GoogleCloudDocumentaiUiv1beta3DisableProcessorMetadata(); GoogleCloudDocumentaiUiv1beta3DisableProcessorMetadata.fromJson( core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('stateMessage')) { - stateMessage = _json['stateMessage'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } } core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (state != null) { - _json['state'] = state; - } - if (stateMessage != null) { - _json['stateMessage'] = stateMessage; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } return _json; } @@ -789,60 +862,24 @@ /// The long running operation metadata for enable processor method. class GoogleCloudDocumentaiUiv1beta3EnableProcessorMetadata { - /// The creation time of the operation. - core.String createTime; - - /// The state of the current enable processor operation. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : The default value. This value is used if the state - /// is omitted. - /// - "WAITING" : Request operation is waiting for scheduling. - /// - "RUNNING" : Request is being processed. - /// - "SUCCEEDED" : The operation is completed successfully. - /// - "CANCELLING" : The operation was being cancelled. - /// - "CANCELLED" : The operation was cancelled. - /// - "FAILED" : The operation has failed. - core.String state; - - /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. - core.String stateMessage; - - /// The last update time of the operation. - core.String updateTime; + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; GoogleCloudDocumentaiUiv1beta3EnableProcessorMetadata(); GoogleCloudDocumentaiUiv1beta3EnableProcessorMetadata.fromJson( core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('stateMessage')) { - stateMessage = _json['stateMessage'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); } } core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (state != null) { - _json['state'] = state; - } - if (stateMessage != null) { - _json['stateMessage'] = stateMessage; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); } return _json; } @@ -864,19 +901,664 @@ } } +/// Metadata of the EvaluateProcessorVersion method. +class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionMetadata(); + + GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// Metadata of the EvaluateProcessorVersion method. +class GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionResponse { + /// The evaluation result. + GoogleCloudDocumentaiUiv1beta3Evaluation evaluation; + + GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionResponse(); + + GoogleCloudDocumentaiUiv1beta3EvaluateProcessorVersionResponse.fromJson( + core.Map _json) { + if (_json.containsKey('evaluation')) { + evaluation = GoogleCloudDocumentaiUiv1beta3Evaluation.fromJson( + _json['evaluation'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (evaluation != null) { + _json['evaluation'] = evaluation.toJson(); + } + return _json; + } +} + +/// An evaluation of a ProcessorVersion's performance. +class GoogleCloudDocumentaiUiv1beta3Evaluation { + /// Metrics for all the entities in aggregate. + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics + allEntitiesMetrics; + + /// The time that the evaluation was created. + core.String createTime; + + /// Metrics across confidence levels, for different entities. + core.Map<core.String, + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics> + entityMetrics; + + /// The resource name of the evaluation. + /// + /// Format: + /// projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation} + core.String name; + + GoogleCloudDocumentaiUiv1beta3Evaluation(); + + GoogleCloudDocumentaiUiv1beta3Evaluation.fromJson(core.Map _json) { + if (_json.containsKey('allEntitiesMetrics')) { + allEntitiesMetrics = + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics + .fromJson(_json['allEntitiesMetrics'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('entityMetrics')) { + entityMetrics = (_json['entityMetrics'] as core.Map) + .cast<core.String, core.Map>() + .map( + (key, item) => core.MapEntry( + key, + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics + .fromJson(item as core.Map<core.String, core.dynamic>), + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allEntitiesMetrics != null) { + _json['allEntitiesMetrics'] = allEntitiesMetrics.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (entityMetrics != null) { + _json['entityMetrics'] = + entityMetrics.map((key, item) => core.MapEntry(key, item.toJson())); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Evaluations metrics, at a specific confidence level. +class GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics { + /// The confidence level. + core.double confidenceLevel; + + /// The metrics at the specific confidence level. + GoogleCloudDocumentaiUiv1beta3EvaluationMetrics metrics; + + GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics(); + + GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics.fromJson( + core.Map _json) { + if (_json.containsKey('confidenceLevel')) { + confidenceLevel = (_json['confidenceLevel'] as core.num).toDouble(); + } + if (_json.containsKey('metrics')) { + metrics = GoogleCloudDocumentaiUiv1beta3EvaluationMetrics.fromJson( + _json['metrics'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confidenceLevel != null) { + _json['confidenceLevel'] = confidenceLevel; + } + if (metrics != null) { + _json['metrics'] = metrics.toJson(); + } + return _json; + } +} + +/// Evaluation metrics, either in aggregate or about a specific entity. +class GoogleCloudDocumentaiUiv1beta3EvaluationMetrics { + /// The calculated f1 score. + core.double f1Score; + + /// The calculated precision. + core.double precision; + + /// The calculated recall. + core.double recall; + + GoogleCloudDocumentaiUiv1beta3EvaluationMetrics(); + + GoogleCloudDocumentaiUiv1beta3EvaluationMetrics.fromJson(core.Map _json) { + if (_json.containsKey('f1Score')) { + f1Score = (_json['f1Score'] as core.num).toDouble(); + } + if (_json.containsKey('precision')) { + precision = (_json['precision'] as core.num).toDouble(); + } + if (_json.containsKey('recall')) { + recall = (_json['recall'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (f1Score != null) { + _json['f1Score'] = f1Score; + } + if (precision != null) { + _json['precision'] = precision; + } + if (recall != null) { + _json['recall'] = recall; + } + return _json; + } +} + +/// Metrics across multiple confidence levels. +class GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics { + /// Metrics across confidence levels. + core.List<GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics> + confidenceLevelMetrics; + + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics(); + + GoogleCloudDocumentaiUiv1beta3EvaluationMultiConfidenceMetrics.fromJson( + core.Map _json) { + if (_json.containsKey('confidenceLevelMetrics')) { + confidenceLevelMetrics = (_json['confidenceLevelMetrics'] as core.List) + .map<GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics>( + (value) => + GoogleCloudDocumentaiUiv1beta3EvaluationConfidenceLevelMetrics + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confidenceLevelMetrics != null) { + _json['confidenceLevelMetrics'] = + confidenceLevelMetrics.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Gives a short summary of an evaluation, and links to the evaluation itself. +class GoogleCloudDocumentaiUiv1beta3EvaluationReference { + /// An aggregate of the statistics for the evaluation. + GoogleCloudDocumentaiUiv1beta3EvaluationMetrics aggregateMetrics; + + /// The resource name of the evaluation. + core.String evaluation; + + /// The resource name of the Long Running Operation for the evaluation. + core.String operation; + + GoogleCloudDocumentaiUiv1beta3EvaluationReference(); + + GoogleCloudDocumentaiUiv1beta3EvaluationReference.fromJson(core.Map _json) { + if (_json.containsKey('aggregateMetrics')) { + aggregateMetrics = + GoogleCloudDocumentaiUiv1beta3EvaluationMetrics.fromJson( + _json['aggregateMetrics'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('evaluation')) { + evaluation = _json['evaluation'] as core.String; + } + if (_json.containsKey('operation')) { + operation = _json['operation'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (aggregateMetrics != null) { + _json['aggregateMetrics'] = aggregateMetrics.toJson(); + } + if (evaluation != null) { + _json['evaluation'] = evaluation; + } + if (operation != null) { + _json['operation'] = operation; + } + return _json; + } +} + +/// A processor version is an implementation of a processor. +/// +/// Each processor can have multiple versions, pre-trained by Google internally +/// or up-trained by the customer. At a time, a processor can only have one +/// default version version. So the processor's behavior (when processing +/// documents) is defined by a default version. +class GoogleCloudDocumentaiUiv1beta3ProcessorVersion { + /// The time the processor version was created. + core.String createTime; + + /// The display name of the processor version. + core.String displayName; + + /// The most recently invoked evaluation for the processor version. + GoogleCloudDocumentaiUiv1beta3EvaluationReference latestEvaluation; + + /// The resource name of the processor version. + /// + /// Format: + /// projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version} + core.String name; + + /// The schema of the processor version. + /// + /// Describes the output. + GoogleCloudDocumentaiUiv1beta3Schema schema; + + /// The state of the processor version. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The processor version is in an unspecified state. + /// - "DEPLOYED" : The processor version is deployed and can be used for + /// processing. + /// - "DEPLOYING" : The processor version is being deployed. + /// - "UNDEPLOYED" : The processor version is not deployed and cannot be used + /// for processing. + /// - "UNDEPLOYING" : The processor version is being undeployed. + /// - "CREATING" : The processor version is being created. + /// - "DELETING" : The processor version is being deleted. + /// - "FAILED" : The processor version failed and is in an indeterminate + /// state. + core.String state; + + GoogleCloudDocumentaiUiv1beta3ProcessorVersion(); + + GoogleCloudDocumentaiUiv1beta3ProcessorVersion.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('latestEvaluation')) { + latestEvaluation = + GoogleCloudDocumentaiUiv1beta3EvaluationReference.fromJson( + _json['latestEvaluation'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('schema')) { + schema = GoogleCloudDocumentaiUiv1beta3Schema.fromJson( + _json['schema'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (latestEvaluation != null) { + _json['latestEvaluation'] = latestEvaluation.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (schema != null) { + _json['schema'] = schema.toJson(); + } + if (state != null) { + _json['state'] = state; + } + return _json; + } +} + +/// The schema defines the output of the processed document by a processor. +class GoogleCloudDocumentaiUiv1beta3Schema { + /// Description of the schema. + core.String description; + + /// Display name to show to users. + core.String displayName; + + /// Entity types of the schema. + core.List<GoogleCloudDocumentaiUiv1beta3SchemaEntityType> entityTypes; + + GoogleCloudDocumentaiUiv1beta3Schema(); + + GoogleCloudDocumentaiUiv1beta3Schema.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('entityTypes')) { + entityTypes = (_json['entityTypes'] as core.List) + .map<GoogleCloudDocumentaiUiv1beta3SchemaEntityType>((value) => + GoogleCloudDocumentaiUiv1beta3SchemaEntityType.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (entityTypes != null) { + _json['entityTypes'] = + entityTypes.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// EntityType is the wrapper of a label of the corresponding model with +/// detailed attributes and limitations for entity-based processors. +/// +/// Multiple types can also compose a dependency tree to represent nested types. +class GoogleCloudDocumentaiUiv1beta3SchemaEntityType { + /// Type of the entity. + /// + /// It can be either a value type (such as "text", "numeric", "date" and + /// "address"), or an object type which may contain nested entities (such as + /// "document" and "table"). + core.String baseType; + + /// Description of the entity type. + core.String description; + + /// Occurrence type limits the number of times an entity type appears in the + /// document. + /// Possible string values are: + /// - "OCCURRENCE_TYPE_UNSPECIFIED" : Unspecified occurrence type. + /// - "OPTIONAL_ONCE" : The entity type will appear zero times or once. + /// - "OPTIONAL_MULTIPLE" : The entity type will appear zero or multiple + /// times. + /// - "REQUIRED_ONCE" : The entity type will only appear exactly once. + /// - "REQUIRED_MULTIPLE" : The entity type will appear once or more times. + core.String occurrenceType; + + /// Describing the nested structure of an entity. + /// + /// An EntityType may consist of several other EntityTypes. For example, in a + /// document there can be an EntityType 'ID', which consists of EntityType + /// 'name' and 'address', with corresponding attributes, such as TEXT for both + /// types and ONCE for occurrence types. + core.List<GoogleCloudDocumentaiUiv1beta3SchemaEntityType> properties; + + /// Source of this entity type. + /// Possible string values are: + /// - "SOURCE_UNSPECIFIED" : Unspecified source. + /// - "PREDEFINED" : The entity type is in the predefined schema of a + /// pretrained version of a processor. + /// - "USER_INPUT" : The entity type is added by the users either: - during an + /// uptraining of an existing processor, or - during the process of creating a + /// customized processor. + core.String source; + + /// Name of the type. + /// + /// It must be unique within the set of same level types. + core.String type; + + GoogleCloudDocumentaiUiv1beta3SchemaEntityType(); + + GoogleCloudDocumentaiUiv1beta3SchemaEntityType.fromJson(core.Map _json) { + if (_json.containsKey('baseType')) { + baseType = _json['baseType'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('occurrenceType')) { + occurrenceType = _json['occurrenceType'] as core.String; + } + if (_json.containsKey('properties')) { + properties = (_json['properties'] as core.List) + .map<GoogleCloudDocumentaiUiv1beta3SchemaEntityType>((value) => + GoogleCloudDocumentaiUiv1beta3SchemaEntityType.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('source')) { + source = _json['source'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (baseType != null) { + _json['baseType'] = baseType; + } + if (description != null) { + _json['description'] = description; + } + if (occurrenceType != null) { + _json['occurrenceType'] = occurrenceType; + } + if (properties != null) { + _json['properties'] = properties.map((value) => value.toJson()).toList(); + } + if (source != null) { + _json['source'] = source; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// The metadata that represents a processor version being created. +class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadata(); + + GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// The response for the TrainProcessorVersion method. +class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionResponse { + /// The processor version produced by training. + GoogleCloudDocumentaiUiv1beta3ProcessorVersion processorVersion; + + GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionResponse(); + + GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionResponse.fromJson( + core.Map _json) { + if (_json.containsKey('processorVersion')) { + processorVersion = + GoogleCloudDocumentaiUiv1beta3ProcessorVersion.fromJson( + _json['processorVersion'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (processorVersion != null) { + _json['processorVersion'] = processorVersion.toJson(); + } + return _json; + } +} + +/// The long running operation metadata for the undeploy processor version +/// method. +class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionMetadata(); + + GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// Response message for the undeploy processor version method. +class GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionResponse { + GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionResponse(); + + GoogleCloudDocumentaiUiv1beta3UndeployProcessorVersionResponse.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The long running operation metadata for updating the human review +/// configuration. +class GoogleCloudDocumentaiUiv1beta3UpdateHumanReviewConfigMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3UpdateHumanReviewConfigMetadata(); + + GoogleCloudDocumentaiUiv1beta3UpdateHumanReviewConfigMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + /// The long running operation metadata for UpdateLabelerPool. class GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata(); + + GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// The long running operation metadata for batch process method. +class GoogleCloudDocumentaiV1BatchProcessMetadata { /// The creation time of the operation. core.String createTime; - /// Used only when Operation.done is false. + /// The list of response details of each document. + core.List<GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus> + individualProcessStatuses; + + /// The state of the current batch processing. /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Unspecified state. - /// - "RUNNING" : Operation is still running. - /// - "CANCELLING" : Operation is being cancelled. - /// - "SUCCEEDED" : Operation succeeded. - /// - "FAILED" : Operation failed. - /// - "CANCELLED" : Operation is cancelled. + /// - "STATE_UNSPECIFIED" : The default value. This value is used if the state + /// is omitted. + /// - "WAITING" : Request operation is waiting for scheduling. + /// - "RUNNING" : Request is being processed. + /// - "SUCCEEDED" : The batch processing completed successfully. + /// - "CANCELLING" : The batch processing was being cancelled. + /// - "CANCELLED" : The batch processing was cancelled. + /// - "FAILED" : The batch processing has failed. core.String state; /// A message providing more details about the current state of processing. @@ -887,10 +1569,149 @@ /// The last update time of the operation. core.String updateTime; - GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata(); + GoogleCloudDocumentaiV1BatchProcessMetadata(); - GoogleCloudDocumentaiUiv1beta3UpdateLabelerPoolOperationMetadata.fromJson( + GoogleCloudDocumentaiV1BatchProcessMetadata.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('individualProcessStatuses')) { + individualProcessStatuses = (_json['individualProcessStatuses'] + as core.List) + .map<GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus>( + (value) => + GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (individualProcessStatuses != null) { + _json['individualProcessStatuses'] = + individualProcessStatuses.map((value) => value.toJson()).toList(); + } + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// The status of a each individual document in the batch process. +class GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus { + /// The status of human review on the processed document. + GoogleCloudDocumentaiV1HumanReviewStatus humanReviewStatus; + + /// The source of the document, same as the \[input_gcs_source\] field in the + /// request when the batch process started. + /// + /// The batch process is started by take snapshot of that document, since a + /// user can move or change that document during the process. + core.String inputGcsSource; + + /// The output_gcs_destination (in the request as 'output_gcs_destination') of + /// the processed document if it was successful, otherwise empty. + core.String outputGcsDestination; + + /// The status of the processing of the document. + GoogleRpcStatus status; + + GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus(); + + GoogleCloudDocumentaiV1BatchProcessMetadataIndividualProcessStatus.fromJson( core.Map _json) { + if (_json.containsKey('humanReviewStatus')) { + humanReviewStatus = GoogleCloudDocumentaiV1HumanReviewStatus.fromJson( + _json['humanReviewStatus'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inputGcsSource')) { + inputGcsSource = _json['inputGcsSource'] as core.String; + } + if (_json.containsKey('outputGcsDestination')) { + outputGcsDestination = _json['outputGcsDestination'] as core.String; + } + if (_json.containsKey('status')) { + status = GoogleRpcStatus.fromJson( + _json['status'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (humanReviewStatus != null) { + _json['humanReviewStatus'] = humanReviewStatus.toJson(); + } + if (inputGcsSource != null) { + _json['inputGcsSource'] = inputGcsSource; + } + if (outputGcsDestination != null) { + _json['outputGcsDestination'] = outputGcsDestination; + } + if (status != null) { + _json['status'] = status.toJson(); + } + return _json; + } +} + +/// Response message for batch process document method. +class GoogleCloudDocumentaiV1BatchProcessResponse { + GoogleCloudDocumentaiV1BatchProcessResponse(); + + GoogleCloudDocumentaiV1BatchProcessResponse.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The common metadata for long running operations. +class GoogleCloudDocumentaiV1CommonOperationMetadata { + /// The creation time of the operation. + core.String createTime; + + /// The state of the operation. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Unspecified state. + /// - "RUNNING" : Operation is still running. + /// - "CANCELLING" : Operation is being cancelled. + /// - "SUCCEEDED" : Operation succeeded. + /// - "FAILED" : Operation failed. + /// - "CANCELLED" : Operation is cancelled. + core.String state; + + /// A message providing more details about the current state of processing. + core.String stateMessage; + + /// The last update time of the operation. + core.String updateTime; + + GoogleCloudDocumentaiV1CommonOperationMetadata(); + + GoogleCloudDocumentaiV1CommonOperationMetadata.fromJson(core.Map _json) { if (_json.containsKey('createTime')) { createTime = _json['createTime'] as core.String; } @@ -923,6 +1744,107 @@ } } +/// The status of human review on a processed document. +class GoogleCloudDocumentaiV1HumanReviewStatus { + /// The name of the operation triggered by the processed document. + /// + /// Non-empty only when the \[state\] is \[HUMAN_REVIEW_IN_PROGRESS\]. It has + /// the same response type and metadata as the long running operation returned + /// by \[ReviewDocument\] method. + core.String humanReviewOperation; + + /// The state of human review on the processing request. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : State unspecified. + /// - "HUMAN_REVIEW_SKIPPED" : Human review is skipped for the document, it's + /// either due to the human review is not enabled on the processor or the + /// processing request sets to skip it. + /// - "HUMAN_REVIEW_VALIDATION_PASSED" : Human review validation is triggered + /// and passed, so no review is needed. + /// - "HUMAN_REVIEW_IN_PROGRESS" : Human review validation is triggered and + /// the document is under review. + /// - "HUMAN_REVIEW_ERROR" : Some error happened during triggering human + /// review, see the \[state_message\] for details. + core.String state; + + /// A message providing more details about the human review state. + core.String stateMessage; + + GoogleCloudDocumentaiV1HumanReviewStatus(); + + GoogleCloudDocumentaiV1HumanReviewStatus.fromJson(core.Map _json) { + if (_json.containsKey('humanReviewOperation')) { + humanReviewOperation = _json['humanReviewOperation'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (humanReviewOperation != null) { + _json['humanReviewOperation'] = humanReviewOperation; + } + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + return _json; + } +} + +/// The long running operation metadata for review document method. +class GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiV1CommonOperationMetadata commonMetadata; + + GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata(); + + GoogleCloudDocumentaiV1ReviewDocumentOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = GoogleCloudDocumentaiV1CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + return _json; + } +} + +/// Response message for review document method. +class GoogleCloudDocumentaiV1ReviewDocumentResponse { + /// The Cloud Storage uri for the human reviewed document. + core.String gcsDestination; + + GoogleCloudDocumentaiV1ReviewDocumentResponse(); + + GoogleCloudDocumentaiV1ReviewDocumentResponse.fromJson(core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = _json['gcsDestination'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination; + } + return _json; + } +} + /// Response to an batch document processing request. /// /// This is returned in the LRO Operation after the operation is complete. @@ -1342,27 +2264,26 @@ class GoogleCloudDocumentaiV1beta1DocumentEntityNormalizedValue { /// Postal address. /// - /// See also: https: //github.com/googleapis/googleapis/blob/ // - /// master/google/type/postal_address.proto + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto GoogleTypePostalAddress addressValue; /// Date value. /// - /// Includes year, month, day. See also: https: - /// //github.com/googleapis/googleapis/blob/master/google/type/date.proto + /// Includes year, month, day. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/date.proto GoogleTypeDate dateValue; /// DateTime value. /// - /// Includes date, time, and timezone. See also: https: - /// //github.com/googleapis/googleapis/blob/ // - /// master/google/type/datetime.proto + /// Includes date, time, and timezone. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto GoogleTypeDateTime datetimeValue; /// Money value. /// - /// See also: https: //github.com/googleapis/googleapis/blob/ // - /// master/google/type/money.proto + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/money.proto GoogleTypeMoney moneyValue; /// Normalized entity value stored as a string. @@ -1706,7 +2627,8 @@ /// - "FORM_FIELD" : References a Page.form_fields element. core.String layoutType; - /// Index into the Document.pages element + /// Index into the Document.pages element, for example using Document.pages to + /// locate the related page element. /// /// Required. core.String page; @@ -3379,61 +4301,6 @@ } } -/// Parameters to control AutoML model prediction behavior. -class GoogleCloudDocumentaiV1beta2AutoMlParams { - /// Resource name of the AutoML model. - /// - /// Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`. - core.String model; - - GoogleCloudDocumentaiV1beta2AutoMlParams(); - - GoogleCloudDocumentaiV1beta2AutoMlParams.fromJson(core.Map _json) { - if (_json.containsKey('model')) { - model = _json['model'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (model != null) { - _json['model'] = model; - } - return _json; - } -} - -/// Request to batch process documents as an asynchronous operation. -/// -/// The output is written to Cloud Storage as JSON in the \[Document\] format. -class GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest { - /// Individual requests for each document. - /// - /// Required. - core.List<GoogleCloudDocumentaiV1beta2ProcessDocumentRequest> requests; - - GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest(); - - GoogleCloudDocumentaiV1beta2BatchProcessDocumentsRequest.fromJson( - core.Map _json) { - if (_json.containsKey('requests')) { - requests = (_json['requests'] as core.List) - .map<GoogleCloudDocumentaiV1beta2ProcessDocumentRequest>((value) => - GoogleCloudDocumentaiV1beta2ProcessDocumentRequest.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (requests != null) { - _json['requests'] = requests.map((value) => value.toJson()).toList(); - } - return _json; - } -} - /// Response to an batch document processing request. /// /// This is returned in the LRO Operation after the operation is complete. @@ -3866,27 +4733,26 @@ class GoogleCloudDocumentaiV1beta2DocumentEntityNormalizedValue { /// Postal address. /// - /// See also: https: //github.com/googleapis/googleapis/blob/ // - /// master/google/type/postal_address.proto + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto GoogleTypePostalAddress addressValue; /// Date value. /// - /// Includes year, month, day. See also: https: - /// //github.com/googleapis/googleapis/blob/master/google/type/date.proto + /// Includes year, month, day. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/date.proto GoogleTypeDate dateValue; /// DateTime value. /// - /// Includes date, time, and timezone. See also: https: - /// //github.com/googleapis/googleapis/blob/ // - /// master/google/type/datetime.proto + /// Includes date, time, and timezone. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto GoogleTypeDateTime datetimeValue; /// Money value. /// - /// See also: https: //github.com/googleapis/googleapis/blob/ // - /// master/google/type/money.proto + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/money.proto GoogleTypeMoney moneyValue; /// Normalized entity value stored as a string. @@ -4281,7 +5147,8 @@ /// - "FORM_FIELD" : References a Page.form_fields element. core.String layoutType; - /// Index into the Document.pages element + /// Index into the Document.pages element, for example using Document.pages to + /// locate the related page element. /// /// Required. core.String page; @@ -5666,90 +6533,6 @@ } } -/// Parameters to control entity extraction behavior. -class GoogleCloudDocumentaiV1beta2EntityExtractionParams { - /// Whether to enable entity extraction. - core.bool enabled; - - /// Model version of the entity extraction. - /// - /// Default is "builtin/stable". Specify "builtin/latest" for the latest - /// model. - core.String modelVersion; - - GoogleCloudDocumentaiV1beta2EntityExtractionParams(); - - GoogleCloudDocumentaiV1beta2EntityExtractionParams.fromJson(core.Map _json) { - if (_json.containsKey('enabled')) { - enabled = _json['enabled'] as core.bool; - } - if (_json.containsKey('modelVersion')) { - modelVersion = _json['modelVersion'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (enabled != null) { - _json['enabled'] = enabled; - } - if (modelVersion != null) { - _json['modelVersion'] = modelVersion; - } - return _json; - } -} - -/// Parameters to control form extraction behavior. -class GoogleCloudDocumentaiV1beta2FormExtractionParams { - /// Whether to enable form extraction. - core.bool enabled; - - /// Reserved for future use. - core.List<GoogleCloudDocumentaiV1beta2KeyValuePairHint> keyValuePairHints; - - /// Model version of the form extraction system. - /// - /// Default is "builtin/stable". Specify "builtin/latest" for the latest - /// model. For custom form models, specify: “custom/{model_name}". Model name - /// format is "bucket_name/path/to/modeldir" corresponding to - /// "gs://bucket_name/path/to/modeldir" where annotated examples are stored. - core.String modelVersion; - - GoogleCloudDocumentaiV1beta2FormExtractionParams(); - - GoogleCloudDocumentaiV1beta2FormExtractionParams.fromJson(core.Map _json) { - if (_json.containsKey('enabled')) { - enabled = _json['enabled'] as core.bool; - } - if (_json.containsKey('keyValuePairHints')) { - keyValuePairHints = (_json['keyValuePairHints'] as core.List) - .map<GoogleCloudDocumentaiV1beta2KeyValuePairHint>((value) => - GoogleCloudDocumentaiV1beta2KeyValuePairHint.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('modelVersion')) { - modelVersion = _json['modelVersion'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (enabled != null) { - _json['enabled'] = enabled; - } - if (keyValuePairHints != null) { - _json['keyValuePairHints'] = - keyValuePairHints.map((value) => value.toJson()).toList(); - } - if (modelVersion != null) { - _json['modelVersion'] = modelVersion; - } - return _json; - } -} - /// The Google Cloud Storage location where the output file will be written to. class GoogleCloudDocumentaiV1beta2GcsDestination { core.String uri; @@ -5852,43 +6635,6 @@ } } -/// Reserved for future use. -class GoogleCloudDocumentaiV1beta2KeyValuePairHint { - /// The key text for the hint. - core.String key; - - /// Type of the value. - /// - /// This is case-insensitive, and could be one of: ADDRESS, LOCATION, - /// ORGANIZATION, PERSON, PHONE_NUMBER, ID, NUMBER, EMAIL, PRICE, TERMS, DATE, - /// NAME. Types not in this list will be ignored. - core.List<core.String> valueTypes; - - GoogleCloudDocumentaiV1beta2KeyValuePairHint(); - - GoogleCloudDocumentaiV1beta2KeyValuePairHint.fromJson(core.Map _json) { - if (_json.containsKey('key')) { - key = _json['key'] as core.String; - } - if (_json.containsKey('valueTypes')) { - valueTypes = (_json['valueTypes'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (key != null) { - _json['key'] = key; - } - if (valueTypes != null) { - _json['valueTypes'] = valueTypes; - } - return _json; - } -} - /// A vertex represents a 2D point in the image. /// /// NOTE: the normalized vertex coordinates are relative to the original image @@ -5923,38 +6669,6 @@ } } -/// Parameters to control Optical Character Recognition (OCR) behavior. -class GoogleCloudDocumentaiV1beta2OcrParams { - /// List of languages to use for OCR. - /// - /// In most cases, an empty value yields the best results since it enables - /// automatic language detection. For languages based on the Latin alphabet, - /// setting `language_hints` is not needed. In rare cases, when the language - /// of the text in the image is known, setting a hint will help get better - /// results (although it will be a significant hindrance if the hint is - /// wrong). Document processing returns an error if one or more of the - /// specified languages is not one of the supported languages. - core.List<core.String> languageHints; - - GoogleCloudDocumentaiV1beta2OcrParams(); - - GoogleCloudDocumentaiV1beta2OcrParams.fromJson(core.Map _json) { - if (_json.containsKey('languageHints')) { - languageHints = (_json['languageHints'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (languageHints != null) { - _json['languageHints'] = languageHints; - } - return _json; - } -} - /// Contains metadata for the BatchProcessDocuments operation. class GoogleCloudDocumentaiV1beta2OperationMetadata { /// The creation time of the operation. @@ -6055,135 +6769,6 @@ } } -/// Request to process one document. -class GoogleCloudDocumentaiV1beta2ProcessDocumentRequest { - /// Controls AutoML model prediction behavior. - /// - /// AutoMlParams cannot be used together with other Params. - GoogleCloudDocumentaiV1beta2AutoMlParams automlParams; - - /// Specifies a known document type for deeper structure detection. - /// - /// Valid values are currently "general" and "invoice". If not provided, - /// "general"\ is used as default. If any other value is given, the request is - /// rejected. - core.String documentType; - - /// Controls entity extraction behavior. - /// - /// If not specified, the system will decide reasonable defaults. - GoogleCloudDocumentaiV1beta2EntityExtractionParams entityExtractionParams; - - /// Controls form extraction behavior. - /// - /// If not specified, the system will decide reasonable defaults. - GoogleCloudDocumentaiV1beta2FormExtractionParams formExtractionParams; - - /// Information about the input file. - /// - /// Required. - GoogleCloudDocumentaiV1beta2InputConfig inputConfig; - - /// Controls OCR behavior. - /// - /// If not specified, the system will decide reasonable defaults. - GoogleCloudDocumentaiV1beta2OcrParams ocrParams; - - /// The desired output location. - /// - /// This field is only needed in BatchProcessDocumentsRequest. - GoogleCloudDocumentaiV1beta2OutputConfig outputConfig; - - /// Target project and location to make a call. - /// - /// Format: `projects/{project-id}/locations/{location-id}`. If no location is - /// specified, a region will be chosen automatically. This field is only - /// populated when used in ProcessDocument method. - core.String parent; - - /// Controls table extraction behavior. - /// - /// If not specified, the system will decide reasonable defaults. - GoogleCloudDocumentaiV1beta2TableExtractionParams tableExtractionParams; - - GoogleCloudDocumentaiV1beta2ProcessDocumentRequest(); - - GoogleCloudDocumentaiV1beta2ProcessDocumentRequest.fromJson(core.Map _json) { - if (_json.containsKey('automlParams')) { - automlParams = GoogleCloudDocumentaiV1beta2AutoMlParams.fromJson( - _json['automlParams'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('documentType')) { - documentType = _json['documentType'] as core.String; - } - if (_json.containsKey('entityExtractionParams')) { - entityExtractionParams = - GoogleCloudDocumentaiV1beta2EntityExtractionParams.fromJson( - _json['entityExtractionParams'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('formExtractionParams')) { - formExtractionParams = - GoogleCloudDocumentaiV1beta2FormExtractionParams.fromJson( - _json['formExtractionParams'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('inputConfig')) { - inputConfig = GoogleCloudDocumentaiV1beta2InputConfig.fromJson( - _json['inputConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('ocrParams')) { - ocrParams = GoogleCloudDocumentaiV1beta2OcrParams.fromJson( - _json['ocrParams'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('outputConfig')) { - outputConfig = GoogleCloudDocumentaiV1beta2OutputConfig.fromJson( - _json['outputConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('parent')) { - parent = _json['parent'] as core.String; - } - if (_json.containsKey('tableExtractionParams')) { - tableExtractionParams = - GoogleCloudDocumentaiV1beta2TableExtractionParams.fromJson( - _json['tableExtractionParams'] - as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (automlParams != null) { - _json['automlParams'] = automlParams.toJson(); - } - if (documentType != null) { - _json['documentType'] = documentType; - } - if (entityExtractionParams != null) { - _json['entityExtractionParams'] = entityExtractionParams.toJson(); - } - if (formExtractionParams != null) { - _json['formExtractionParams'] = formExtractionParams.toJson(); - } - if (inputConfig != null) { - _json['inputConfig'] = inputConfig.toJson(); - } - if (ocrParams != null) { - _json['ocrParams'] = ocrParams.toJson(); - } - if (outputConfig != null) { - _json['outputConfig'] = outputConfig.toJson(); - } - if (parent != null) { - _json['parent'] = parent; - } - if (tableExtractionParams != null) { - _json['tableExtractionParams'] = tableExtractionParams.toJson(); - } - return _json; - } -} - /// Response to a single document processing request. class GoogleCloudDocumentaiV1beta2ProcessDocumentResponse { /// Information about the input file. @@ -6222,110 +6807,6 @@ } } -/// A hint for a table bounding box on the page for table parsing. -class GoogleCloudDocumentaiV1beta2TableBoundHint { - /// Bounding box hint for a table on this page. - /// - /// The coordinates must be normalized to \[0,1\] and the bounding box must be - /// an axis-aligned rectangle. - GoogleCloudDocumentaiV1beta2BoundingPoly boundingBox; - - /// Page number for multi-paged inputs this hint applies to. - /// - /// If not provided, this hint will apply to all pages by default. This value - /// is 1-based. - /// - /// Optional. - core.int pageNumber; - - GoogleCloudDocumentaiV1beta2TableBoundHint(); - - GoogleCloudDocumentaiV1beta2TableBoundHint.fromJson(core.Map _json) { - if (_json.containsKey('boundingBox')) { - boundingBox = GoogleCloudDocumentaiV1beta2BoundingPoly.fromJson( - _json['boundingBox'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('pageNumber')) { - pageNumber = _json['pageNumber'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (boundingBox != null) { - _json['boundingBox'] = boundingBox.toJson(); - } - if (pageNumber != null) { - _json['pageNumber'] = pageNumber; - } - return _json; - } -} - -/// Parameters to control table extraction behavior. -class GoogleCloudDocumentaiV1beta2TableExtractionParams { - /// Whether to enable table extraction. - core.bool enabled; - - /// Reserved for future use. - /// - /// Optional. - core.List<core.String> headerHints; - - /// Model version of the table extraction system. - /// - /// Default is "builtin/stable". Specify "builtin/latest" for the latest - /// model. - core.String modelVersion; - - /// Table bounding box hints that can be provided to complex cases which our - /// algorithm cannot locate the table(s) in. - /// - /// Optional. - core.List<GoogleCloudDocumentaiV1beta2TableBoundHint> tableBoundHints; - - GoogleCloudDocumentaiV1beta2TableExtractionParams(); - - GoogleCloudDocumentaiV1beta2TableExtractionParams.fromJson(core.Map _json) { - if (_json.containsKey('enabled')) { - enabled = _json['enabled'] as core.bool; - } - if (_json.containsKey('headerHints')) { - headerHints = (_json['headerHints'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('modelVersion')) { - modelVersion = _json['modelVersion'] as core.String; - } - if (_json.containsKey('tableBoundHints')) { - tableBoundHints = (_json['tableBoundHints'] as core.List) - .map<GoogleCloudDocumentaiV1beta2TableBoundHint>((value) => - GoogleCloudDocumentaiV1beta2TableBoundHint.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (enabled != null) { - _json['enabled'] = enabled; - } - if (headerHints != null) { - _json['headerHints'] = headerHints; - } - if (modelVersion != null) { - _json['modelVersion'] = modelVersion; - } - if (tableBoundHints != null) { - _json['tableBoundHints'] = - tableBoundHints.map((value) => value.toJson()).toList(); - } - return _json; - } -} - /// A vertex represents a 2D point in the image. /// /// NOTE: the vertex coordinates are in the same scale as the original image. @@ -6443,9 +6924,12 @@ /// /// If the human review process is not triggered, this field will be empty. It /// has the same response type and metadata as the long running operation - /// returned by ReviewDocument method. + /// returned by ReviewDocument method. . core.String humanReviewOperation; + /// The status of human review on the processed document. + GoogleCloudDocumentaiV1beta3HumanReviewStatus humanReviewStatus; + /// The source of the document, same as the \[input_gcs_source\] field in the /// request when the batch process started. /// @@ -6467,6 +6951,12 @@ if (_json.containsKey('humanReviewOperation')) { humanReviewOperation = _json['humanReviewOperation'] as core.String; } + if (_json.containsKey('humanReviewStatus')) { + humanReviewStatus = + GoogleCloudDocumentaiV1beta3HumanReviewStatus.fromJson( + _json['humanReviewStatus'] + as core.Map<core.String, core.dynamic>); + } if (_json.containsKey('inputGcsSource')) { inputGcsSource = _json['inputGcsSource'] as core.String; } @@ -6484,6 +6974,9 @@ if (humanReviewOperation != null) { _json['humanReviewOperation'] = humanReviewOperation; } + if (humanReviewStatus != null) { + _json['humanReviewStatus'] = humanReviewStatus.toJson(); + } if (inputGcsSource != null) { _json['inputGcsSource'] = inputGcsSource; } @@ -6497,6 +6990,142 @@ } } +/// Request message for batch process document method. +class GoogleCloudDocumentaiV1beta3BatchProcessRequest { + /// The overall output config for batch process. + GoogleCloudDocumentaiV1beta3DocumentOutputConfig documentOutputConfig; + + /// The input config for each single document in the batch process. + core.List<GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig> + inputConfigs; + + /// The input documents for batch process. + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig + inputDocuments; + + /// The overall output config for batch process. + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchOutputConfig outputConfig; + + /// Whether Human Review feature should be skipped for this request. + /// + /// Default to false. + core.bool skipHumanReview; + + GoogleCloudDocumentaiV1beta3BatchProcessRequest(); + + GoogleCloudDocumentaiV1beta3BatchProcessRequest.fromJson(core.Map _json) { + if (_json.containsKey('documentOutputConfig')) { + documentOutputConfig = + GoogleCloudDocumentaiV1beta3DocumentOutputConfig.fromJson( + _json['documentOutputConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inputConfigs')) { + inputConfigs = (_json['inputConfigs'] as core.List) + .map<GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig>( + (value) => + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('inputDocuments')) { + inputDocuments = + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig + .fromJson(_json['inputDocuments'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputConfig')) { + outputConfig = + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchOutputConfig + .fromJson( + _json['outputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('skipHumanReview')) { + skipHumanReview = _json['skipHumanReview'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (documentOutputConfig != null) { + _json['documentOutputConfig'] = documentOutputConfig.toJson(); + } + if (inputConfigs != null) { + _json['inputConfigs'] = + inputConfigs.map((value) => value.toJson()).toList(); + } + if (inputDocuments != null) { + _json['inputDocuments'] = inputDocuments.toJson(); + } + if (outputConfig != null) { + _json['outputConfig'] = outputConfig.toJson(); + } + if (skipHumanReview != null) { + _json['skipHumanReview'] = skipHumanReview; + } + return _json; + } +} + +/// The message for input config in batch process. +class GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig { + /// The Cloud Storage location as the source of the document. + core.String gcsSource; + + /// Mimetype of the input. + /// + /// If the input is a raw document, the supported mimetypes are + /// application/pdf, image/tiff, and image/gif. If the input is a \[Document\] + /// proto, the type should be application/json. + core.String mimeType; + + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig(); + + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchInputConfig.fromJson( + core.Map _json) { + if (_json.containsKey('gcsSource')) { + gcsSource = _json['gcsSource'] as core.String; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsSource != null) { + _json['gcsSource'] = gcsSource; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + return _json; + } +} + +/// The message for output config in batch process. +class GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchOutputConfig { + /// The output Cloud Storage directory to put the processed documents. + core.String gcsDestination; + + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchOutputConfig(); + + GoogleCloudDocumentaiV1beta3BatchProcessRequestBatchOutputConfig.fromJson( + core.Map _json) { + if (_json.containsKey('gcsDestination')) { + gcsDestination = _json['gcsDestination'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsDestination != null) { + _json['gcsDestination'] = gcsDestination; + } + return _json; + } +} + /// Response message for batch process document method. class GoogleCloudDocumentaiV1beta3BatchProcessResponse { GoogleCloudDocumentaiV1beta3BatchProcessResponse(); @@ -6511,12 +7140,52 @@ } } -/// The long running operation metadata for review document method. -class GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata { +/// A bounding polygon for the detected image annotation. +class GoogleCloudDocumentaiV1beta3BoundingPoly { + /// The bounding polygon normalized vertices. + core.List<GoogleCloudDocumentaiV1beta3NormalizedVertex> normalizedVertices; + + /// The bounding polygon vertices. + core.List<GoogleCloudDocumentaiV1beta3Vertex> vertices; + + GoogleCloudDocumentaiV1beta3BoundingPoly(); + + GoogleCloudDocumentaiV1beta3BoundingPoly.fromJson(core.Map _json) { + if (_json.containsKey('normalizedVertices')) { + normalizedVertices = (_json['normalizedVertices'] as core.List) + .map<GoogleCloudDocumentaiV1beta3NormalizedVertex>((value) => + GoogleCloudDocumentaiV1beta3NormalizedVertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('vertices')) { + vertices = (_json['vertices'] as core.List) + .map<GoogleCloudDocumentaiV1beta3Vertex>((value) => + GoogleCloudDocumentaiV1beta3Vertex.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (normalizedVertices != null) { + _json['normalizedVertices'] = + normalizedVertices.map((value) => value.toJson()).toList(); + } + if (vertices != null) { + _json['vertices'] = vertices.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// The common metadata for long running operations. +class GoogleCloudDocumentaiV1beta3CommonOperationMetadata { /// The creation time of the operation. core.String createTime; - /// Used only when Operation.done is false. + /// The state of the operation. /// Possible string values are: /// - "STATE_UNSPECIFIED" : Unspecified state. /// - "RUNNING" : Operation is still running. @@ -6527,17 +7196,14 @@ core.String state; /// A message providing more details about the current state of processing. - /// - /// For example, the error message if the operation is failed. core.String stateMessage; /// The last update time of the operation. core.String updateTime; - GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata(); + GoogleCloudDocumentaiV1beta3CommonOperationMetadata(); - GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata.fromJson( - core.Map _json) { + GoogleCloudDocumentaiV1beta3CommonOperationMetadata.fromJson(core.Map _json) { if (_json.containsKey('createTime')) { createTime = _json['createTime'] as core.String; } @@ -6570,6 +7236,2490 @@ } } +/// Document represents the canonical document resource in Document +/// Understanding AI. +/// +/// It is an interchange format that provides insights into documents and allows +/// for collaboration between users and Document Understanding AI to iterate and +/// optimize for quality. +class GoogleCloudDocumentaiV1beta3Document { + /// Inline document content, represented as a stream of bytes. + /// + /// Note: As with all `bytes` fields, protobuffers use a pure binary + /// representation, whereas JSON representations use base64. + core.String content; + core.List<core.int> get contentAsBytes => convert.base64.decode(content); + + set contentAsBytes(core.List<core.int> _bytes) { + content = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// A list of entities detected on Document.text. + /// + /// For document shards, entities in this list may cross shard boundaries. + core.List<GoogleCloudDocumentaiV1beta3DocumentEntity> entities; + + /// Relationship among Document.entities. + core.List<GoogleCloudDocumentaiV1beta3DocumentEntityRelation> entityRelations; + + /// Any error that occurred while processing this document. + GoogleRpcStatus error; + + /// An IANA published MIME type (also referred to as media type). + /// + /// For more information, see + /// https://www.iana.org/assignments/media-types/media-types.xhtml. + core.String mimeType; + + /// Visual page layout for the Document. + core.List<GoogleCloudDocumentaiV1beta3DocumentPage> pages; + + /// Revision history of this document. + core.List<GoogleCloudDocumentaiV1beta3DocumentRevision> revisions; + + /// Information about the sharding if this document is sharded part of a + /// larger document. + /// + /// If the document is not sharded, this message is not specified. + GoogleCloudDocumentaiV1beta3DocumentShardInfo shardInfo; + + /// UTF-8 encoded text in reading order from the document. + core.String text; + + /// A list of text corrections made to \[Document.text\]. + /// + /// This is usually used for annotating corrections to OCR mistakes. Text + /// changes for a given revision may not overlap with each other. + core.List<GoogleCloudDocumentaiV1beta3DocumentTextChange> textChanges; + + /// Styles for the Document.text. + core.List<GoogleCloudDocumentaiV1beta3DocumentStyle> textStyles; + + /// A list of translations on Document.text. + /// + /// For document shards, translations in this list may cross shard boundaries. + core.List<GoogleCloudDocumentaiV1beta3DocumentTranslation> translations; + + /// Currently supports Google Cloud Storage URI of the form + /// `gs://bucket_name/object_name`. + /// + /// Object versioning is not supported. See + /// [Google Cloud Storage Request URIs](https://cloud.google.com/storage/docs/reference-uris) + /// for more info. + core.String uri; + + GoogleCloudDocumentaiV1beta3Document(); + + GoogleCloudDocumentaiV1beta3Document.fromJson(core.Map _json) { + if (_json.containsKey('content')) { + content = _json['content'] as core.String; + } + if (_json.containsKey('entities')) { + entities = (_json['entities'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentEntity>((value) => + GoogleCloudDocumentaiV1beta3DocumentEntity.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('entityRelations')) { + entityRelations = (_json['entityRelations'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentEntityRelation>((value) => + GoogleCloudDocumentaiV1beta3DocumentEntityRelation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('error')) { + error = GoogleRpcStatus.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('pages')) { + pages = (_json['pages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPage>((value) => + GoogleCloudDocumentaiV1beta3DocumentPage.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('revisions')) { + revisions = (_json['revisions'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentRevision>((value) => + GoogleCloudDocumentaiV1beta3DocumentRevision.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('shardInfo')) { + shardInfo = GoogleCloudDocumentaiV1beta3DocumentShardInfo.fromJson( + _json['shardInfo'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('text')) { + text = _json['text'] as core.String; + } + if (_json.containsKey('textChanges')) { + textChanges = (_json['textChanges'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentTextChange>((value) => + GoogleCloudDocumentaiV1beta3DocumentTextChange.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('textStyles')) { + textStyles = (_json['textStyles'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentStyle>((value) => + GoogleCloudDocumentaiV1beta3DocumentStyle.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('translations')) { + translations = (_json['translations'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentTranslation>((value) => + GoogleCloudDocumentaiV1beta3DocumentTranslation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (content != null) { + _json['content'] = content; + } + if (entities != null) { + _json['entities'] = entities.map((value) => value.toJson()).toList(); + } + if (entityRelations != null) { + _json['entityRelations'] = + entityRelations.map((value) => value.toJson()).toList(); + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (pages != null) { + _json['pages'] = pages.map((value) => value.toJson()).toList(); + } + if (revisions != null) { + _json['revisions'] = revisions.map((value) => value.toJson()).toList(); + } + if (shardInfo != null) { + _json['shardInfo'] = shardInfo.toJson(); + } + if (text != null) { + _json['text'] = text; + } + if (textChanges != null) { + _json['textChanges'] = + textChanges.map((value) => value.toJson()).toList(); + } + if (textStyles != null) { + _json['textStyles'] = textStyles.map((value) => value.toJson()).toList(); + } + if (translations != null) { + _json['translations'] = + translations.map((value) => value.toJson()).toList(); + } + if (uri != null) { + _json['uri'] = uri; + } + return _json; + } +} + +/// A phrase in the text that is a known entity type, such as a person, an +/// organization, or location. +class GoogleCloudDocumentaiV1beta3DocumentEntity { + /// Confidence of detected Schema entity. + /// + /// Range \[0, 1\]. + /// + /// Optional. + core.double confidence; + + /// Canonical id. + /// + /// This will be a unique value in the entity list for this document. + /// + /// Optional. + core.String id; + + /// Use `id` field instead. + /// + /// Deprecated. + core.String mentionId; + + /// Text value in the document e.g. `1600 Amphitheatre Pkwy`. + core.String mentionText; + + /// Normalized entity value. + /// + /// Absent if the extracted value could not be converted or the type (e.g. + /// address) is not supported for certain parsers. This field is also only + /// populated for certain supported document types. + /// + /// Optional. + GoogleCloudDocumentaiV1beta3DocumentEntityNormalizedValue normalizedValue; + + /// Represents the provenance of this entity wrt. + /// + /// the location on the page where it was found. + /// + /// Optional. + GoogleCloudDocumentaiV1beta3DocumentPageAnchor pageAnchor; + + /// Entities can be nested to form a hierarchical data structure representing + /// the content in the document. + /// + /// Optional. + core.List<GoogleCloudDocumentaiV1beta3DocumentEntity> properties; + + /// The history of this annotation. + /// + /// Optional. + GoogleCloudDocumentaiV1beta3DocumentProvenance provenance; + + /// Whether the entity will be redacted for de-identification purposes. + /// + /// Optional. + core.bool redacted; + + /// Provenance of the entity. + /// + /// Text anchor indexing into the Document.text. + GoogleCloudDocumentaiV1beta3DocumentTextAnchor textAnchor; + + /// Entity type from a schema e.g. `Address`. + core.String type; + + GoogleCloudDocumentaiV1beta3DocumentEntity(); + + GoogleCloudDocumentaiV1beta3DocumentEntity.fromJson(core.Map _json) { + if (_json.containsKey('confidence')) { + confidence = (_json['confidence'] as core.num).toDouble(); + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('mentionId')) { + mentionId = _json['mentionId'] as core.String; + } + if (_json.containsKey('mentionText')) { + mentionText = _json['mentionText'] as core.String; + } + if (_json.containsKey('normalizedValue')) { + normalizedValue = + GoogleCloudDocumentaiV1beta3DocumentEntityNormalizedValue.fromJson( + _json['normalizedValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('pageAnchor')) { + pageAnchor = GoogleCloudDocumentaiV1beta3DocumentPageAnchor.fromJson( + _json['pageAnchor'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('properties')) { + properties = (_json['properties'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentEntity>((value) => + GoogleCloudDocumentaiV1beta3DocumentEntity.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('provenance')) { + provenance = GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + _json['provenance'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('redacted')) { + redacted = _json['redacted'] as core.bool; + } + if (_json.containsKey('textAnchor')) { + textAnchor = GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson( + _json['textAnchor'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confidence != null) { + _json['confidence'] = confidence; + } + if (id != null) { + _json['id'] = id; + } + if (mentionId != null) { + _json['mentionId'] = mentionId; + } + if (mentionText != null) { + _json['mentionText'] = mentionText; + } + if (normalizedValue != null) { + _json['normalizedValue'] = normalizedValue.toJson(); + } + if (pageAnchor != null) { + _json['pageAnchor'] = pageAnchor.toJson(); + } + if (properties != null) { + _json['properties'] = properties.map((value) => value.toJson()).toList(); + } + if (provenance != null) { + _json['provenance'] = provenance.toJson(); + } + if (redacted != null) { + _json['redacted'] = redacted; + } + if (textAnchor != null) { + _json['textAnchor'] = textAnchor.toJson(); + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Parsed and normalized entity value. +class GoogleCloudDocumentaiV1beta3DocumentEntityNormalizedValue { + /// Postal address. + /// + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + GoogleTypePostalAddress addressValue; + + /// Date value. + /// + /// Includes year, month, day. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + GoogleTypeDate dateValue; + + /// DateTime value. + /// + /// Includes date, time, and timezone. See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + GoogleTypeDateTime datetimeValue; + + /// Money value. + /// + /// See also: + /// https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + GoogleTypeMoney moneyValue; + + /// Normalized entity value stored as a string. + /// + /// This field is populated for supported document type (e.g. Invoice). For + /// some entity types, one of respective 'structured_value' fields may also be + /// populated. - Money/Currency type (`money_value`) is in the ISO 4217 text + /// format. - Date type (`date_value`) is in the ISO 8601 text format. - + /// Datetime type (`datetime_value`) is in the ISO 8601 text format. + /// + /// Required. + core.String text; + + GoogleCloudDocumentaiV1beta3DocumentEntityNormalizedValue(); + + GoogleCloudDocumentaiV1beta3DocumentEntityNormalizedValue.fromJson( + core.Map _json) { + if (_json.containsKey('addressValue')) { + addressValue = GoogleTypePostalAddress.fromJson( + _json['addressValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('dateValue')) { + dateValue = GoogleTypeDate.fromJson( + _json['dateValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('datetimeValue')) { + datetimeValue = GoogleTypeDateTime.fromJson( + _json['datetimeValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('moneyValue')) { + moneyValue = GoogleTypeMoney.fromJson( + _json['moneyValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('text')) { + text = _json['text'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (addressValue != null) { + _json['addressValue'] = addressValue.toJson(); + } + if (dateValue != null) { + _json['dateValue'] = dateValue.toJson(); + } + if (datetimeValue != null) { + _json['datetimeValue'] = datetimeValue.toJson(); + } + if (moneyValue != null) { + _json['moneyValue'] = moneyValue.toJson(); + } + if (text != null) { + _json['text'] = text; + } + return _json; + } +} + +/// Relationship between Entities. +class GoogleCloudDocumentaiV1beta3DocumentEntityRelation { + /// Object entity id. + core.String objectId; + + /// Relationship description. + core.String relation; + + /// Subject entity id. + core.String subjectId; + + GoogleCloudDocumentaiV1beta3DocumentEntityRelation(); + + GoogleCloudDocumentaiV1beta3DocumentEntityRelation.fromJson(core.Map _json) { + if (_json.containsKey('objectId')) { + objectId = _json['objectId'] as core.String; + } + if (_json.containsKey('relation')) { + relation = _json['relation'] as core.String; + } + if (_json.containsKey('subjectId')) { + subjectId = _json['subjectId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (objectId != null) { + _json['objectId'] = objectId; + } + if (relation != null) { + _json['relation'] = relation; + } + if (subjectId != null) { + _json['subjectId'] = subjectId; + } + return _json; + } +} + +/// Config that controls the output of documents. +/// +/// All documents will be written as a JSON file. +class GoogleCloudDocumentaiV1beta3DocumentOutputConfig { + /// Output config to write the results to Cloud Storage. + GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig + gcsOutputConfig; + + GoogleCloudDocumentaiV1beta3DocumentOutputConfig(); + + GoogleCloudDocumentaiV1beta3DocumentOutputConfig.fromJson(core.Map _json) { + if (_json.containsKey('gcsOutputConfig')) { + gcsOutputConfig = + GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig + .fromJson(_json['gcsOutputConfig'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsOutputConfig != null) { + _json['gcsOutputConfig'] = gcsOutputConfig.toJson(); + } + return _json; + } +} + +/// The configuration used when outputting documents. +class GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig { + /// The Cloud Storage uri (a directory) of the output. + core.String gcsUri; + + GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig(); + + GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig.fromJson( + core.Map _json) { + if (_json.containsKey('gcsUri')) { + gcsUri = _json['gcsUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsUri != null) { + _json['gcsUri'] = gcsUri; + } + return _json; + } +} + +/// A page in a Document. +class GoogleCloudDocumentaiV1beta3DocumentPage { + /// A list of visually detected text blocks on the page. + /// + /// A block has a set of lines (collected into paragraphs) that have a common + /// line-spacing and orientation. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageBlock> blocks; + + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Physical dimension of the page. + GoogleCloudDocumentaiV1beta3DocumentPageDimension dimension; + + /// A list of visually detected form fields on the page. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageFormField> formFields; + + /// Rendered image for this page. + /// + /// This image is preprocessed to remove any skew, rotation, and distortions + /// such that the annotation bounding boxes can be upright and axis-aligned. + GoogleCloudDocumentaiV1beta3DocumentPageImage image; + + /// Layout for the page. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// A list of visually detected text lines on the page. + /// + /// A collection of tokens that a human would perceive as a line. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageLine> lines; + + /// 1-based index for current Page in a parent Document. + /// + /// Useful when a page is taken out of a Document for individual processing. + core.int pageNumber; + + /// A list of visually detected text paragraphs on the page. + /// + /// A collection of lines that a human would perceive as a paragraph. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageParagraph> paragraphs; + + /// A list of visually detected tables on the page. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageTable> tables; + + /// A list of visually detected tokens on the page. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageToken> tokens; + + /// Transformation matrices that were applied to the original document image + /// to produce Page.image. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageMatrix> transforms; + + /// A list of detected non-text visual elements e.g. checkbox, signature etc. + /// + /// on the page. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageVisualElement> + visualElements; + + GoogleCloudDocumentaiV1beta3DocumentPage(); + + GoogleCloudDocumentaiV1beta3DocumentPage.fromJson(core.Map _json) { + if (_json.containsKey('blocks')) { + blocks = (_json['blocks'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageBlock>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageBlock.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dimension')) { + dimension = GoogleCloudDocumentaiV1beta3DocumentPageDimension.fromJson( + _json['dimension'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('formFields')) { + formFields = (_json['formFields'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageFormField>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageFormField.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('image')) { + image = GoogleCloudDocumentaiV1beta3DocumentPageImage.fromJson( + _json['image'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('lines')) { + lines = (_json['lines'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageLine>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageLine.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('pageNumber')) { + pageNumber = _json['pageNumber'] as core.int; + } + if (_json.containsKey('paragraphs')) { + paragraphs = (_json['paragraphs'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageParagraph>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageParagraph.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('tables')) { + tables = (_json['tables'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageTable>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageTable.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('tokens')) { + tokens = (_json['tokens'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageToken>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageToken.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('transforms')) { + transforms = (_json['transforms'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageMatrix>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageMatrix.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('visualElements')) { + visualElements = (_json['visualElements'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageVisualElement>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageVisualElement.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (blocks != null) { + _json['blocks'] = blocks.map((value) => value.toJson()).toList(); + } + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (dimension != null) { + _json['dimension'] = dimension.toJson(); + } + if (formFields != null) { + _json['formFields'] = formFields.map((value) => value.toJson()).toList(); + } + if (image != null) { + _json['image'] = image.toJson(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (lines != null) { + _json['lines'] = lines.map((value) => value.toJson()).toList(); + } + if (pageNumber != null) { + _json['pageNumber'] = pageNumber; + } + if (paragraphs != null) { + _json['paragraphs'] = paragraphs.map((value) => value.toJson()).toList(); + } + if (tables != null) { + _json['tables'] = tables.map((value) => value.toJson()).toList(); + } + if (tokens != null) { + _json['tokens'] = tokens.map((value) => value.toJson()).toList(); + } + if (transforms != null) { + _json['transforms'] = transforms.map((value) => value.toJson()).toList(); + } + if (visualElements != null) { + _json['visualElements'] = + visualElements.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Referencing the visual context of the entity in the Document.pages. +/// +/// Page anchors can be cross-page, consist of multiple bounding polygons and +/// optionally reference specific layout element types. +class GoogleCloudDocumentaiV1beta3DocumentPageAnchor { + /// One or more references to visual page elements + core.List<GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef> pageRefs; + + GoogleCloudDocumentaiV1beta3DocumentPageAnchor(); + + GoogleCloudDocumentaiV1beta3DocumentPageAnchor.fromJson(core.Map _json) { + if (_json.containsKey('pageRefs')) { + pageRefs = (_json['pageRefs'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pageRefs != null) { + _json['pageRefs'] = pageRefs.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Represents a weak reference to a page element within a document. +class GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef { + /// Identifies the bounding polygon of a layout element on the page. + /// + /// Optional. + GoogleCloudDocumentaiV1beta3BoundingPoly boundingPoly; + + /// Use PageRef.bounding_poly instead. + /// + /// Optional. Deprecated. + core.String layoutId; + + /// The type of the layout element that is being referenced if any. + /// + /// Optional. + /// Possible string values are: + /// - "LAYOUT_TYPE_UNSPECIFIED" : Layout Unspecified. + /// - "BLOCK" : References a Page.blocks element. + /// - "PARAGRAPH" : References a Page.paragraphs element. + /// - "LINE" : References a Page.lines element. + /// - "TOKEN" : References a Page.tokens element. + /// - "VISUAL_ELEMENT" : References a Page.visual_elements element. + /// - "TABLE" : Refrrences a Page.tables element. + /// - "FORM_FIELD" : References a Page.form_fields element. + core.String layoutType; + + /// Index into the Document.pages element, for example using Document.pages to + /// locate the related page element. + /// + /// Required. + core.String page; + + GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef(); + + GoogleCloudDocumentaiV1beta3DocumentPageAnchorPageRef.fromJson( + core.Map _json) { + if (_json.containsKey('boundingPoly')) { + boundingPoly = GoogleCloudDocumentaiV1beta3BoundingPoly.fromJson( + _json['boundingPoly'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('layoutId')) { + layoutId = _json['layoutId'] as core.String; + } + if (_json.containsKey('layoutType')) { + layoutType = _json['layoutType'] as core.String; + } + if (_json.containsKey('page')) { + page = _json['page'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boundingPoly != null) { + _json['boundingPoly'] = boundingPoly.toJson(); + } + if (layoutId != null) { + _json['layoutId'] = layoutId; + } + if (layoutType != null) { + _json['layoutType'] = layoutType; + } + if (page != null) { + _json['page'] = page; + } + return _json; + } +} + +/// A block has a set of lines (collected into paragraphs) that have a common +/// line-spacing and orientation. +class GoogleCloudDocumentaiV1beta3DocumentPageBlock { + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for Block. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// The history of this annotation. + GoogleCloudDocumentaiV1beta3DocumentProvenance provenance; + + GoogleCloudDocumentaiV1beta3DocumentPageBlock(); + + GoogleCloudDocumentaiV1beta3DocumentPageBlock.fromJson(core.Map _json) { + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('provenance')) { + provenance = GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + _json['provenance'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (provenance != null) { + _json['provenance'] = provenance.toJson(); + } + return _json; + } +} + +/// Detected language for a structural component. +class GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage { + /// Confidence of detected language. + /// + /// Range \[0, 1\]. + core.double confidence; + + /// The BCP-47 language code, such as "en-US" or "sr-Latn". + /// + /// For more information, see + /// http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + core.String languageCode; + + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage(); + + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage.fromJson( + core.Map _json) { + if (_json.containsKey('confidence')) { + confidence = (_json['confidence'] as core.num).toDouble(); + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (confidence != null) { + _json['confidence'] = confidence; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + return _json; + } +} + +/// Dimension for the page. +class GoogleCloudDocumentaiV1beta3DocumentPageDimension { + /// Page height. + core.double height; + + /// Dimension unit. + core.String unit; + + /// Page width. + core.double width; + + GoogleCloudDocumentaiV1beta3DocumentPageDimension(); + + GoogleCloudDocumentaiV1beta3DocumentPageDimension.fromJson(core.Map _json) { + if (_json.containsKey('height')) { + height = (_json['height'] as core.num).toDouble(); + } + if (_json.containsKey('unit')) { + unit = _json['unit'] as core.String; + } + if (_json.containsKey('width')) { + width = (_json['width'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (height != null) { + _json['height'] = height; + } + if (unit != null) { + _json['unit'] = unit; + } + if (width != null) { + _json['width'] = width; + } + return _json; + } +} + +/// A form field detected on the page. +class GoogleCloudDocumentaiV1beta3DocumentPageFormField { + /// Layout for the FormField name. + /// + /// e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + GoogleCloudDocumentaiV1beta3DocumentPageLayout fieldName; + + /// Layout for the FormField value. + GoogleCloudDocumentaiV1beta3DocumentPageLayout fieldValue; + + /// A list of detected languages for name together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + nameDetectedLanguages; + + /// A list of detected languages for value together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + valueDetectedLanguages; + + /// If the value is non-textual, this field represents the type. + /// + /// Current valid values are: - blank (this indicates the field_value is + /// normal text) - "unfilled_checkbox" - "filled_checkbox" + core.String valueType; + + GoogleCloudDocumentaiV1beta3DocumentPageFormField(); + + GoogleCloudDocumentaiV1beta3DocumentPageFormField.fromJson(core.Map _json) { + if (_json.containsKey('fieldName')) { + fieldName = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['fieldName'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('fieldValue')) { + fieldValue = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['fieldValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('nameDetectedLanguages')) { + nameDetectedLanguages = (_json['nameDetectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('valueDetectedLanguages')) { + valueDetectedLanguages = (_json['valueDetectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('valueType')) { + valueType = _json['valueType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (fieldName != null) { + _json['fieldName'] = fieldName.toJson(); + } + if (fieldValue != null) { + _json['fieldValue'] = fieldValue.toJson(); + } + if (nameDetectedLanguages != null) { + _json['nameDetectedLanguages'] = + nameDetectedLanguages.map((value) => value.toJson()).toList(); + } + if (valueDetectedLanguages != null) { + _json['valueDetectedLanguages'] = + valueDetectedLanguages.map((value) => value.toJson()).toList(); + } + if (valueType != null) { + _json['valueType'] = valueType; + } + return _json; + } +} + +/// Rendered image contents for this page. +class GoogleCloudDocumentaiV1beta3DocumentPageImage { + /// Raw byte content of the image. + core.String content; + core.List<core.int> get contentAsBytes => convert.base64.decode(content); + + set contentAsBytes(core.List<core.int> _bytes) { + content = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Height of the image in pixels. + core.int height; + + /// Encoding mime type for the image. + core.String mimeType; + + /// Width of the image in pixels. + core.int width; + + GoogleCloudDocumentaiV1beta3DocumentPageImage(); + + GoogleCloudDocumentaiV1beta3DocumentPageImage.fromJson(core.Map _json) { + if (_json.containsKey('content')) { + content = _json['content'] as core.String; + } + if (_json.containsKey('height')) { + height = _json['height'] as core.int; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + if (_json.containsKey('width')) { + width = _json['width'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (content != null) { + _json['content'] = content; + } + if (height != null) { + _json['height'] = height; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + if (width != null) { + _json['width'] = width; + } + return _json; + } +} + +/// Visual element describing a layout unit on a page. +class GoogleCloudDocumentaiV1beta3DocumentPageLayout { + /// The bounding polygon for the Layout. + GoogleCloudDocumentaiV1beta3BoundingPoly boundingPoly; + + /// Confidence of the current Layout within context of the object this layout + /// is for. + /// + /// e.g. confidence can be for a single token, a table, a visual element, etc. + /// depending on context. Range \[0, 1\]. + core.double confidence; + + /// Detected orientation for the Layout. + /// Possible string values are: + /// - "ORIENTATION_UNSPECIFIED" : Unspecified orientation. + /// - "PAGE_UP" : Orientation is aligned with page up. + /// - "PAGE_RIGHT" : Orientation is aligned with page right. Turn the head 90 + /// degrees clockwise from upright to read. + /// - "PAGE_DOWN" : Orientation is aligned with page down. Turn the head 180 + /// degrees from upright to read. + /// - "PAGE_LEFT" : Orientation is aligned with page left. Turn the head 90 + /// degrees counterclockwise from upright to read. + core.String orientation; + + /// Text anchor indexing into the Document.text. + GoogleCloudDocumentaiV1beta3DocumentTextAnchor textAnchor; + + GoogleCloudDocumentaiV1beta3DocumentPageLayout(); + + GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson(core.Map _json) { + if (_json.containsKey('boundingPoly')) { + boundingPoly = GoogleCloudDocumentaiV1beta3BoundingPoly.fromJson( + _json['boundingPoly'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('confidence')) { + confidence = (_json['confidence'] as core.num).toDouble(); + } + if (_json.containsKey('orientation')) { + orientation = _json['orientation'] as core.String; + } + if (_json.containsKey('textAnchor')) { + textAnchor = GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson( + _json['textAnchor'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boundingPoly != null) { + _json['boundingPoly'] = boundingPoly.toJson(); + } + if (confidence != null) { + _json['confidence'] = confidence; + } + if (orientation != null) { + _json['orientation'] = orientation; + } + if (textAnchor != null) { + _json['textAnchor'] = textAnchor.toJson(); + } + return _json; + } +} + +/// A collection of tokens that a human would perceive as a line. +/// +/// Does not cross column boundaries, can be horizontal, vertical, etc. +class GoogleCloudDocumentaiV1beta3DocumentPageLine { + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for Line. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// The history of this annotation. + GoogleCloudDocumentaiV1beta3DocumentProvenance provenance; + + GoogleCloudDocumentaiV1beta3DocumentPageLine(); + + GoogleCloudDocumentaiV1beta3DocumentPageLine.fromJson(core.Map _json) { + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('provenance')) { + provenance = GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + _json['provenance'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (provenance != null) { + _json['provenance'] = provenance.toJson(); + } + return _json; + } +} + +/// Representation for transformation matrix, intended to be compatible and used +/// with OpenCV format for image manipulation. +class GoogleCloudDocumentaiV1beta3DocumentPageMatrix { + /// Number of columns in the matrix. + core.int cols; + + /// The matrix data. + core.String data; + core.List<core.int> get dataAsBytes => convert.base64.decode(data); + + set dataAsBytes(core.List<core.int> _bytes) { + data = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Number of rows in the matrix. + core.int rows; + + /// This encodes information about what data type the matrix uses. + /// + /// For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list of + /// OpenCV primitive data types, please refer to + /// https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + core.int type; + + GoogleCloudDocumentaiV1beta3DocumentPageMatrix(); + + GoogleCloudDocumentaiV1beta3DocumentPageMatrix.fromJson(core.Map _json) { + if (_json.containsKey('cols')) { + cols = _json['cols'] as core.int; + } + if (_json.containsKey('data')) { + data = _json['data'] as core.String; + } + if (_json.containsKey('rows')) { + rows = _json['rows'] as core.int; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cols != null) { + _json['cols'] = cols; + } + if (data != null) { + _json['data'] = data; + } + if (rows != null) { + _json['rows'] = rows; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// A collection of lines that a human would perceive as a paragraph. +class GoogleCloudDocumentaiV1beta3DocumentPageParagraph { + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for Paragraph. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// The history of this annotation. + GoogleCloudDocumentaiV1beta3DocumentProvenance provenance; + + GoogleCloudDocumentaiV1beta3DocumentPageParagraph(); + + GoogleCloudDocumentaiV1beta3DocumentPageParagraph.fromJson(core.Map _json) { + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('provenance')) { + provenance = GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + _json['provenance'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (provenance != null) { + _json['provenance'] = provenance.toJson(); + } + return _json; + } +} + +/// A table representation similar to HTML table structure. +class GoogleCloudDocumentaiV1beta3DocumentPageTable { + /// Body rows of the table. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow> bodyRows; + + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Header rows of the table. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow> headerRows; + + /// Layout for Table. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + GoogleCloudDocumentaiV1beta3DocumentPageTable(); + + GoogleCloudDocumentaiV1beta3DocumentPageTable.fromJson(core.Map _json) { + if (_json.containsKey('bodyRows')) { + bodyRows = (_json['bodyRows'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('headerRows')) { + headerRows = (_json['headerRows'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow>((value) => + GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bodyRows != null) { + _json['bodyRows'] = bodyRows.map((value) => value.toJson()).toList(); + } + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (headerRows != null) { + _json['headerRows'] = headerRows.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + return _json; + } +} + +/// A cell representation inside the table. +class GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell { + /// How many columns this cell spans. + core.int colSpan; + + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for TableCell. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// How many rows this cell spans. + core.int rowSpan; + + GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell(); + + GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell.fromJson( + core.Map _json) { + if (_json.containsKey('colSpan')) { + colSpan = _json['colSpan'] as core.int; + } + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rowSpan')) { + rowSpan = _json['rowSpan'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (colSpan != null) { + _json['colSpan'] = colSpan; + } + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (rowSpan != null) { + _json['rowSpan'] = rowSpan; + } + return _json; + } +} + +/// A row of table cells. +class GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow { + /// Cells that make up this row. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell> cells; + + GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow(); + + GoogleCloudDocumentaiV1beta3DocumentPageTableTableRow.fromJson( + core.Map _json) { + if (_json.containsKey('cells')) { + cells = (_json['cells'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell>( + (value) => GoogleCloudDocumentaiV1beta3DocumentPageTableTableCell + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cells != null) { + _json['cells'] = cells.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A detected token. +class GoogleCloudDocumentaiV1beta3DocumentPageToken { + /// Detected break at the end of a Token. + GoogleCloudDocumentaiV1beta3DocumentPageTokenDetectedBreak detectedBreak; + + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for Token. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// The history of this annotation. + GoogleCloudDocumentaiV1beta3DocumentProvenance provenance; + + GoogleCloudDocumentaiV1beta3DocumentPageToken(); + + GoogleCloudDocumentaiV1beta3DocumentPageToken.fromJson(core.Map _json) { + if (_json.containsKey('detectedBreak')) { + detectedBreak = + GoogleCloudDocumentaiV1beta3DocumentPageTokenDetectedBreak.fromJson( + _json['detectedBreak'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('provenance')) { + provenance = GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + _json['provenance'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (detectedBreak != null) { + _json['detectedBreak'] = detectedBreak.toJson(); + } + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (provenance != null) { + _json['provenance'] = provenance.toJson(); + } + return _json; + } +} + +/// Detected break at the end of a Token. +class GoogleCloudDocumentaiV1beta3DocumentPageTokenDetectedBreak { + /// Detected break type. + /// Possible string values are: + /// - "TYPE_UNSPECIFIED" : Unspecified break type. + /// - "SPACE" : A single whitespace. + /// - "WIDE_SPACE" : A wider whitespace. + /// - "HYPHEN" : A hyphen that indicates that a token has been split across + /// lines. + core.String type; + + GoogleCloudDocumentaiV1beta3DocumentPageTokenDetectedBreak(); + + GoogleCloudDocumentaiV1beta3DocumentPageTokenDetectedBreak.fromJson( + core.Map _json) { + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Detected non-text visual elements e.g. checkbox, signature etc. +/// +/// on the page. +class GoogleCloudDocumentaiV1beta3DocumentPageVisualElement { + /// A list of detected languages together with confidence. + core.List<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage> + detectedLanguages; + + /// Layout for VisualElement. + GoogleCloudDocumentaiV1beta3DocumentPageLayout layout; + + /// Type of the VisualElement. + core.String type; + + GoogleCloudDocumentaiV1beta3DocumentPageVisualElement(); + + GoogleCloudDocumentaiV1beta3DocumentPageVisualElement.fromJson( + core.Map _json) { + if (_json.containsKey('detectedLanguages')) { + detectedLanguages = (_json['detectedLanguages'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentPageDetectedLanguage + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('layout')) { + layout = GoogleCloudDocumentaiV1beta3DocumentPageLayout.fromJson( + _json['layout'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (detectedLanguages != null) { + _json['detectedLanguages'] = + detectedLanguages.map((value) => value.toJson()).toList(); + } + if (layout != null) { + _json['layout'] = layout.toJson(); + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Structure to identify provenance relationships between annotations in +/// different revisions. +class GoogleCloudDocumentaiV1beta3DocumentProvenance { + /// The Id of this operation. + /// + /// Needs to be unique within the scope of the revision. + core.int id; + + /// References to the original elements that are replaced. + core.List<GoogleCloudDocumentaiV1beta3DocumentProvenanceParent> parents; + + /// The index of the revision that produced this element. + core.int revision; + + /// The type of provenance operation. + /// Possible string values are: + /// - "OPERATION_TYPE_UNSPECIFIED" : Operation type unspecified. + /// - "ADD" : Add an element. Implicit if no `parents` are set for the + /// provenance. + /// - "REMOVE" : The element is removed. No `parents` should be set. + /// - "REPLACE" : Explicitly replaces the element(s) identified by `parents`. + /// - "EVAL_REQUESTED" : Element is requested for human review. + /// - "EVAL_APPROVED" : Element is review and approved at human review, + /// confidence will be set to 1.0 + core.String type; + + GoogleCloudDocumentaiV1beta3DocumentProvenance(); + + GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson(core.Map _json) { + if (_json.containsKey('id')) { + id = _json['id'] as core.int; + } + if (_json.containsKey('parents')) { + parents = (_json['parents'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentProvenanceParent>((value) => + GoogleCloudDocumentaiV1beta3DocumentProvenanceParent.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('revision')) { + revision = _json['revision'] as core.int; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (id != null) { + _json['id'] = id; + } + if (parents != null) { + _json['parents'] = parents.map((value) => value.toJson()).toList(); + } + if (revision != null) { + _json['revision'] = revision; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Structure for referencing parent provenances. +/// +/// When an element replaces one of more other elements parent references +/// identify the elements that are replaced. +class GoogleCloudDocumentaiV1beta3DocumentProvenanceParent { + /// The id of the parent provenance. + core.int id; + + /// The index of the \[Document.revisions\] identifying the parent revision. + core.int revision; + + GoogleCloudDocumentaiV1beta3DocumentProvenanceParent(); + + GoogleCloudDocumentaiV1beta3DocumentProvenanceParent.fromJson( + core.Map _json) { + if (_json.containsKey('id')) { + id = _json['id'] as core.int; + } + if (_json.containsKey('revision')) { + revision = _json['revision'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (id != null) { + _json['id'] = id; + } + if (revision != null) { + _json['revision'] = revision; + } + return _json; + } +} + +/// Contains past or forward revisions of this document. +class GoogleCloudDocumentaiV1beta3DocumentRevision { + /// If the change was made by a person specify the name or id of that person. + core.String agent; + + /// The time that the revision was created. + core.String createTime; + + /// Human Review information of this revision. + GoogleCloudDocumentaiV1beta3DocumentRevisionHumanReview humanReview; + + /// Id of the revision. + /// + /// Unique within the context of the document. + core.String id; + + /// The revisions that this revision is based on. + /// + /// This can include one or more parent (when documents are merged.) This + /// field represents the index into the `revisions` field. + core.List<core.int> parent; + + /// If the annotation was made by processor identify the processor by its + /// resource name. + core.String processor; + + GoogleCloudDocumentaiV1beta3DocumentRevision(); + + GoogleCloudDocumentaiV1beta3DocumentRevision.fromJson(core.Map _json) { + if (_json.containsKey('agent')) { + agent = _json['agent'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('humanReview')) { + humanReview = + GoogleCloudDocumentaiV1beta3DocumentRevisionHumanReview.fromJson( + _json['humanReview'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('parent')) { + parent = (_json['parent'] as core.List) + .map<core.int>((value) => value as core.int) + .toList(); + } + if (_json.containsKey('processor')) { + processor = _json['processor'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (agent != null) { + _json['agent'] = agent; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (humanReview != null) { + _json['humanReview'] = humanReview.toJson(); + } + if (id != null) { + _json['id'] = id; + } + if (parent != null) { + _json['parent'] = parent; + } + if (processor != null) { + _json['processor'] = processor; + } + return _json; + } +} + +/// Human Review information of the document. +class GoogleCloudDocumentaiV1beta3DocumentRevisionHumanReview { + /// Human review state. + /// + /// e.g. `requested`, `succeeded`, `rejected`. + core.String state; + + /// A message providing more details about the current state of processing. + /// + /// For example, the rejection reason when the state is `rejected`. + core.String stateMessage; + + GoogleCloudDocumentaiV1beta3DocumentRevisionHumanReview(); + + GoogleCloudDocumentaiV1beta3DocumentRevisionHumanReview.fromJson( + core.Map _json) { + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + return _json; + } +} + +/// For a large document, sharding may be performed to produce several document +/// shards. +/// +/// Each document shard contains this field to detail which shard it is. +class GoogleCloudDocumentaiV1beta3DocumentShardInfo { + /// Total number of shards. + core.String shardCount; + + /// The 0-based index of this shard. + core.String shardIndex; + + /// The index of the first character in Document.text in the overall document + /// global text. + core.String textOffset; + + GoogleCloudDocumentaiV1beta3DocumentShardInfo(); + + GoogleCloudDocumentaiV1beta3DocumentShardInfo.fromJson(core.Map _json) { + if (_json.containsKey('shardCount')) { + shardCount = _json['shardCount'] as core.String; + } + if (_json.containsKey('shardIndex')) { + shardIndex = _json['shardIndex'] as core.String; + } + if (_json.containsKey('textOffset')) { + textOffset = _json['textOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (shardCount != null) { + _json['shardCount'] = shardCount; + } + if (shardIndex != null) { + _json['shardIndex'] = shardIndex; + } + if (textOffset != null) { + _json['textOffset'] = textOffset; + } + return _json; + } +} + +/// Annotation for common text style attributes. +/// +/// This adheres to CSS conventions as much as possible. +class GoogleCloudDocumentaiV1beta3DocumentStyle { + /// Text background color. + GoogleTypeColor backgroundColor; + + /// Text color. + GoogleTypeColor color; + + /// Font size. + GoogleCloudDocumentaiV1beta3DocumentStyleFontSize fontSize; + + /// Font weight. + /// + /// Possible values are normal, bold, bolder, and lighter. + /// https://www.w3schools.com/cssref/pr_font_weight.asp + core.String fontWeight; + + /// Text anchor indexing into the Document.text. + GoogleCloudDocumentaiV1beta3DocumentTextAnchor textAnchor; + + /// Text decoration. + /// + /// Follows CSS standard. + /// https://www.w3schools.com/cssref/pr_text_text-decoration.asp + core.String textDecoration; + + /// Text style. + /// + /// Possible values are normal, italic, and oblique. + /// https://www.w3schools.com/cssref/pr_font_font-style.asp + core.String textStyle; + + GoogleCloudDocumentaiV1beta3DocumentStyle(); + + GoogleCloudDocumentaiV1beta3DocumentStyle.fromJson(core.Map _json) { + if (_json.containsKey('backgroundColor')) { + backgroundColor = GoogleTypeColor.fromJson( + _json['backgroundColor'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('color')) { + color = GoogleTypeColor.fromJson( + _json['color'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('fontSize')) { + fontSize = GoogleCloudDocumentaiV1beta3DocumentStyleFontSize.fromJson( + _json['fontSize'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('fontWeight')) { + fontWeight = _json['fontWeight'] as core.String; + } + if (_json.containsKey('textAnchor')) { + textAnchor = GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson( + _json['textAnchor'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('textDecoration')) { + textDecoration = _json['textDecoration'] as core.String; + } + if (_json.containsKey('textStyle')) { + textStyle = _json['textStyle'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (backgroundColor != null) { + _json['backgroundColor'] = backgroundColor.toJson(); + } + if (color != null) { + _json['color'] = color.toJson(); + } + if (fontSize != null) { + _json['fontSize'] = fontSize.toJson(); + } + if (fontWeight != null) { + _json['fontWeight'] = fontWeight; + } + if (textAnchor != null) { + _json['textAnchor'] = textAnchor.toJson(); + } + if (textDecoration != null) { + _json['textDecoration'] = textDecoration; + } + if (textStyle != null) { + _json['textStyle'] = textStyle; + } + return _json; + } +} + +/// Font size with unit. +class GoogleCloudDocumentaiV1beta3DocumentStyleFontSize { + /// Font size for the text. + core.double size; + + /// Unit for the font size. + /// + /// Follows CSS naming (in, px, pt, etc.). + core.String unit; + + GoogleCloudDocumentaiV1beta3DocumentStyleFontSize(); + + GoogleCloudDocumentaiV1beta3DocumentStyleFontSize.fromJson(core.Map _json) { + if (_json.containsKey('size')) { + size = (_json['size'] as core.num).toDouble(); + } + if (_json.containsKey('unit')) { + unit = _json['unit'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (size != null) { + _json['size'] = size; + } + if (unit != null) { + _json['unit'] = unit; + } + return _json; + } +} + +/// Text reference indexing into the Document.text. +class GoogleCloudDocumentaiV1beta3DocumentTextAnchor { + /// Contains the content of the text span so that users do not have to look it + /// up in the text_segments. + core.String content; + + /// The text segments from the Document.text. + core.List<GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment> + textSegments; + + GoogleCloudDocumentaiV1beta3DocumentTextAnchor(); + + GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson(core.Map _json) { + if (_json.containsKey('content')) { + content = _json['content'] as core.String; + } + if (_json.containsKey('textSegments')) { + textSegments = (_json['textSegments'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment>( + (value) => + GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (content != null) { + _json['content'] = content; + } + if (textSegments != null) { + _json['textSegments'] = + textSegments.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A text segment in the Document.text. +/// +/// The indices may be out of bounds which indicate that the text extends into +/// another document shard for large sharded documents. See +/// ShardInfo.text_offset +class GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment { + /// TextSegment half open end UTF-8 char index in the Document.text. + core.String endIndex; + + /// TextSegment start UTF-8 char index in the Document.text. + core.String startIndex; + + GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment(); + + GoogleCloudDocumentaiV1beta3DocumentTextAnchorTextSegment.fromJson( + core.Map _json) { + if (_json.containsKey('endIndex')) { + endIndex = _json['endIndex'] as core.String; + } + if (_json.containsKey('startIndex')) { + startIndex = _json['startIndex'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endIndex != null) { + _json['endIndex'] = endIndex; + } + if (startIndex != null) { + _json['startIndex'] = startIndex; + } + return _json; + } +} + +/// This message is used for text changes aka. +/// +/// OCR corrections. +class GoogleCloudDocumentaiV1beta3DocumentTextChange { + /// The text that replaces the text identified in the `text_anchor`. + core.String changedText; + + /// The history of this annotation. + core.List<GoogleCloudDocumentaiV1beta3DocumentProvenance> provenance; + + /// Provenance of the correction. + /// + /// Text anchor indexing into the Document.text. There can only be a single + /// `TextAnchor.text_segments` element. If the start and end index of the text + /// segment are the same, the text change is inserted before that index. + GoogleCloudDocumentaiV1beta3DocumentTextAnchor textAnchor; + + GoogleCloudDocumentaiV1beta3DocumentTextChange(); + + GoogleCloudDocumentaiV1beta3DocumentTextChange.fromJson(core.Map _json) { + if (_json.containsKey('changedText')) { + changedText = _json['changedText'] as core.String; + } + if (_json.containsKey('provenance')) { + provenance = (_json['provenance'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentProvenance>((value) => + GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('textAnchor')) { + textAnchor = GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson( + _json['textAnchor'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (changedText != null) { + _json['changedText'] = changedText; + } + if (provenance != null) { + _json['provenance'] = provenance.map((value) => value.toJson()).toList(); + } + if (textAnchor != null) { + _json['textAnchor'] = textAnchor.toJson(); + } + return _json; + } +} + +/// A translation of the text segment. +class GoogleCloudDocumentaiV1beta3DocumentTranslation { + /// The BCP-47 language code, such as "en-US" or "sr-Latn". + /// + /// For more information, see + /// http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + core.String languageCode; + + /// The history of this annotation. + core.List<GoogleCloudDocumentaiV1beta3DocumentProvenance> provenance; + + /// Provenance of the translation. + /// + /// Text anchor indexing into the Document.text. There can only be a single + /// `TextAnchor.text_segments` element. If the start and end index of the text + /// segment are the same, the text change is inserted before that index. + GoogleCloudDocumentaiV1beta3DocumentTextAnchor textAnchor; + + /// Text translated into the target language. + core.String translatedText; + + GoogleCloudDocumentaiV1beta3DocumentTranslation(); + + GoogleCloudDocumentaiV1beta3DocumentTranslation.fromJson(core.Map _json) { + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('provenance')) { + provenance = (_json['provenance'] as core.List) + .map<GoogleCloudDocumentaiV1beta3DocumentProvenance>((value) => + GoogleCloudDocumentaiV1beta3DocumentProvenance.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('textAnchor')) { + textAnchor = GoogleCloudDocumentaiV1beta3DocumentTextAnchor.fromJson( + _json['textAnchor'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('translatedText')) { + translatedText = _json['translatedText'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (provenance != null) { + _json['provenance'] = provenance.map((value) => value.toJson()).toList(); + } + if (textAnchor != null) { + _json['textAnchor'] = textAnchor.toJson(); + } + if (translatedText != null) { + _json['translatedText'] = translatedText; + } + return _json; + } +} + +/// The status of human review on a processed document. +class GoogleCloudDocumentaiV1beta3HumanReviewStatus { + /// The name of the operation triggered by the processed document. + /// + /// Non-empty only when the \[state\] is \[HUMAN_REVIEW_IN_PROGRESS\]. It has + /// the same response type and metadata as the long running operation returned + /// by \[ReviewDocument\] method. + core.String humanReviewOperation; + + /// The state of human review on the processing request. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : State unspecified. + /// - "HUMAN_REVIEW_SKIPPED" : Human review is skipped for the document, it's + /// either due to the human review is not enabled on the processor or the + /// processing request sets to skip it. + /// - "HUMAN_REVIEW_VALIDATION_PASSED" : Human review validation is triggered + /// and passed, so no review is needed. + /// - "HUMAN_REVIEW_IN_PROGRESS" : Human review validation is triggered and + /// the document is under review. + /// - "HUMAN_REVIEW_ERROR" : Some error happened during triggering human + /// review, see the \[state_message\] for details. + core.String state; + + /// A message providing more details about the human review state. + core.String stateMessage; + + GoogleCloudDocumentaiV1beta3HumanReviewStatus(); + + GoogleCloudDocumentaiV1beta3HumanReviewStatus.fromJson(core.Map _json) { + if (_json.containsKey('humanReviewOperation')) { + humanReviewOperation = _json['humanReviewOperation'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (humanReviewOperation != null) { + _json['humanReviewOperation'] = humanReviewOperation; + } + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + return _json; + } +} + +/// A vertex represents a 2D point in the image. +/// +/// NOTE: the normalized vertex coordinates are relative to the original image +/// and range from 0 to 1. +class GoogleCloudDocumentaiV1beta3NormalizedVertex { + /// X coordinate. + core.double x; + + /// Y coordinate. + core.double y; + + GoogleCloudDocumentaiV1beta3NormalizedVertex(); + + GoogleCloudDocumentaiV1beta3NormalizedVertex.fromJson(core.Map _json) { + if (_json.containsKey('x')) { + x = (_json['x'] as core.num).toDouble(); + } + if (_json.containsKey('y')) { + y = (_json['y'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (x != null) { + _json['x'] = x; + } + if (y != null) { + _json['y'] = y; + } + return _json; + } +} + +/// Request message for the process document method. +class GoogleCloudDocumentaiV1beta3ProcessRequest { + /// The document payload, the \[content\] and \[mime_type\] fields must be + /// set. + GoogleCloudDocumentaiV1beta3Document document; + + /// An inline document proto. + GoogleCloudDocumentaiV1beta3Document inlineDocument; + + /// A raw document content (bytes). + GoogleCloudDocumentaiV1beta3RawDocument rawDocument; + + /// Whether Human Review feature should be skipped for this request. + /// + /// Default to false. + core.bool skipHumanReview; + + GoogleCloudDocumentaiV1beta3ProcessRequest(); + + GoogleCloudDocumentaiV1beta3ProcessRequest.fromJson(core.Map _json) { + if (_json.containsKey('document')) { + document = GoogleCloudDocumentaiV1beta3Document.fromJson( + _json['document'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inlineDocument')) { + inlineDocument = GoogleCloudDocumentaiV1beta3Document.fromJson( + _json['inlineDocument'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('rawDocument')) { + rawDocument = GoogleCloudDocumentaiV1beta3RawDocument.fromJson( + _json['rawDocument'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('skipHumanReview')) { + skipHumanReview = _json['skipHumanReview'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (document != null) { + _json['document'] = document.toJson(); + } + if (inlineDocument != null) { + _json['inlineDocument'] = inlineDocument.toJson(); + } + if (rawDocument != null) { + _json['rawDocument'] = rawDocument.toJson(); + } + if (skipHumanReview != null) { + _json['skipHumanReview'] = skipHumanReview; + } + return _json; + } +} + +/// Response message for the process document method. +class GoogleCloudDocumentaiV1beta3ProcessResponse { + /// The document payload, will populate fields based on the processor's + /// behavior. + GoogleCloudDocumentaiV1beta3Document document; + + /// The name of the operation triggered by the processed document. + /// + /// If the human review process is not triggered, this field will be empty. It + /// has the same response type and metadata as the long running operation + /// returned by ReviewDocument method. . + core.String humanReviewOperation; + + /// The status of human review on the processed document. + GoogleCloudDocumentaiV1beta3HumanReviewStatus humanReviewStatus; + + GoogleCloudDocumentaiV1beta3ProcessResponse(); + + GoogleCloudDocumentaiV1beta3ProcessResponse.fromJson(core.Map _json) { + if (_json.containsKey('document')) { + document = GoogleCloudDocumentaiV1beta3Document.fromJson( + _json['document'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('humanReviewOperation')) { + humanReviewOperation = _json['humanReviewOperation'] as core.String; + } + if (_json.containsKey('humanReviewStatus')) { + humanReviewStatus = + GoogleCloudDocumentaiV1beta3HumanReviewStatus.fromJson( + _json['humanReviewStatus'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (document != null) { + _json['document'] = document.toJson(); + } + if (humanReviewOperation != null) { + _json['humanReviewOperation'] = humanReviewOperation; + } + if (humanReviewStatus != null) { + _json['humanReviewStatus'] = humanReviewStatus.toJson(); + } + return _json; + } +} + +/// Payload message of raw document content (bytes). +class GoogleCloudDocumentaiV1beta3RawDocument { + /// Inline document content. + core.String content; + core.List<core.int> get contentAsBytes => convert.base64.decode(content); + + set contentAsBytes(core.List<core.int> _bytes) { + content = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// An IANA MIME type (RFC6838) indicating the nature and format of the + /// \[content\]. + core.String mimeType; + + GoogleCloudDocumentaiV1beta3RawDocument(); + + GoogleCloudDocumentaiV1beta3RawDocument.fromJson(core.Map _json) { + if (_json.containsKey('content')) { + content = _json['content'] as core.String; + } + if (_json.containsKey('mimeType')) { + mimeType = _json['mimeType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (content != null) { + _json['content'] = content; + } + if (mimeType != null) { + _json['mimeType'] = mimeType; + } + return _json; + } +} + +/// The long running operation metadata for review document method. +class GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata { + /// The basic metadata of the long running operation. + GoogleCloudDocumentaiV1beta3CommonOperationMetadata commonMetadata; + + /// The creation time of the operation. + core.String createTime; + + /// Used only when Operation.done is false. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Unspecified state. + /// - "RUNNING" : Operation is still running. + /// - "CANCELLING" : Operation is being cancelled. + /// - "SUCCEEDED" : Operation succeeded. + /// - "FAILED" : Operation failed. + /// - "CANCELLED" : Operation is cancelled. + core.String state; + + /// A message providing more details about the current state of processing. + /// + /// For example, the error message if the operation is failed. + core.String stateMessage; + + /// The last update time of the operation. + core.String updateTime; + + GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata(); + + GoogleCloudDocumentaiV1beta3ReviewDocumentOperationMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('commonMetadata')) { + commonMetadata = + GoogleCloudDocumentaiV1beta3CommonOperationMetadata.fromJson( + _json['commonMetadata'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonMetadata != null) { + _json['commonMetadata'] = commonMetadata.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Request message for review document method. +class GoogleCloudDocumentaiV1beta3ReviewDocumentRequest { + /// The document that needs human review. + GoogleCloudDocumentaiV1beta3Document document; + + /// An inline document proto. + GoogleCloudDocumentaiV1beta3Document inlineDocument; + + GoogleCloudDocumentaiV1beta3ReviewDocumentRequest(); + + GoogleCloudDocumentaiV1beta3ReviewDocumentRequest.fromJson(core.Map _json) { + if (_json.containsKey('document')) { + document = GoogleCloudDocumentaiV1beta3Document.fromJson( + _json['document'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inlineDocument')) { + inlineDocument = GoogleCloudDocumentaiV1beta3Document.fromJson( + _json['inlineDocument'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (document != null) { + _json['document'] = document.toJson(); + } + if (inlineDocument != null) { + _json['inlineDocument'] = inlineDocument.toJson(); + } + return _json; + } +} + /// Response message for review document method. class GoogleCloudDocumentaiV1beta3ReviewDocumentResponse { /// The Cloud Storage uri for the human reviewed document. @@ -6592,6 +9742,157 @@ } } +/// A vertex represents a 2D point in the image. +/// +/// NOTE: the vertex coordinates are in the same scale as the original image. +class GoogleCloudDocumentaiV1beta3Vertex { + /// X coordinate. + core.int x; + + /// Y coordinate. + core.int y; + + GoogleCloudDocumentaiV1beta3Vertex(); + + GoogleCloudDocumentaiV1beta3Vertex.fromJson(core.Map _json) { + if (_json.containsKey('x')) { + x = _json['x'] as core.int; + } + if (_json.containsKey('y')) { + y = _json['y'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (x != null) { + _json['x'] = x; + } + if (y != null) { + _json['y'] = y; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class GoogleCloudLocationListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<GoogleCloudLocationLocation> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + GoogleCloudLocationListLocationsResponse(); + + GoogleCloudLocationListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<GoogleCloudLocationLocation>((value) => + GoogleCloudLocationLocation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class GoogleCloudLocationLocation { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + GoogleCloudLocationLocation(); + + GoogleCloudLocationLocation.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + /// This resource represents a long-running operation that is the result of a /// network API call. class GoogleLongrunningOperation { @@ -6877,30 +10178,30 @@ } } -/// Represents a whole or partial calendar date, e.g. a birthday. +/// Represents a whole or partial calendar date, such as a birthday. /// -/// The time of day and time zone are either specified elsewhere or are not -/// significant. The date is relative to the Proleptic Gregorian Calendar. This -/// can represent: * A full date, with non-zero year, month and day values * A -/// month and day value, with a zero year, e.g. an anniversary * A year on its -/// own, with zero month and day values * A year and month value, with a zero -/// day, e.g. a credit card expiration date Related types are -/// google.type.TimeOfDay and `google.protobuf.Timestamp`. +/// The time of day and time zone are either specified elsewhere or are +/// insignificant. The date is relative to the Gregorian Calendar. This can +/// represent one of the following: * A full date, with non-zero year, month, +/// and day values * A month and day value, with a zero year, such as an +/// anniversary * A year on its own, with zero month and day values * A year and +/// month value, with a zero day, such as a credit card expiration date Related +/// types are google.type.TimeOfDay and `google.protobuf.Timestamp`. class GoogleTypeDate { - /// Day of month. + /// Day of a month. /// - /// Must be from 1 to 31 and valid for the year and month, or 0 if specifying - /// a year by itself or a year and month where the day is not significant. + /// Must be from 1 to 31 and valid for the year and month, or 0 to specify a + /// year by itself or a year and month where the day isn't significant. core.int day; - /// Month of year. + /// Month of a year. /// - /// Must be from 1 to 12, or 0 if specifying a year without a month and day. + /// Must be from 1 to 12, or 0 to specify a year without a month and day. core.int month; - /// Year of date. + /// Year of the date. /// - /// Must be from 1 to 9999, or 0 if specifying a date without a year. + /// Must be from 1 to 9999, or 0 to specify a date without a year. core.int year; GoogleTypeDate(); @@ -6932,17 +10233,22 @@ } } -/// Represents civil time in one of a few possible ways: * When utc_offset is -/// set and time_zone is unset: a civil time on a calendar day with a particular -/// offset from UTC. +/// Represents civil time (or occasionally physical time). /// -/// * When time_zone is set and utc_offset is unset: a civil time on a calendar -/// day in a particular time zone. * When neither time_zone nor utc_offset is -/// set: a civil time on a calendar day in local time. The date is relative to -/// the Proleptic Gregorian Calendar. If year is 0, the DateTime is considered -/// not to have a specific year. month and day must have valid, non-zero values. -/// This type is more flexible than some applications may want. Make sure to -/// document and validate your application's limitations. +/// This type can represent a civil time in one of a few possible ways: * When +/// utc_offset is set and time_zone is unset: a civil time on a calendar day +/// with a particular offset from UTC. * When time_zone is set and utc_offset is +/// unset: a civil time on a calendar day in a particular time zone. * When +/// neither time_zone nor utc_offset is set: a civil time on a calendar day in +/// local time. The date is relative to the Proleptic Gregorian Calendar. If +/// year is 0, the DateTime is considered not to have a specific year. month and +/// day must have valid, non-zero values. This type may also be used to +/// represent a physical time if all the date and time fields are set and either +/// case of the `time_offset` oneof is set. Consider using `Timestamp` message +/// for physical time instead. If your use case also would like to store the +/// user's timezone, that can be done in another field. This type is more +/// flexible than some applications may want. Make sure to document and validate +/// your application's limitations. class GoogleTypeDateTime { /// Day of month. /// @@ -7072,7 +10378,7 @@ /// Represents an amount of money with its currency type. class GoogleTypeMoney { - /// The 3-letter currency code defined in ISO 4217. + /// The three-letter currency code defined in ISO 4217. core.String currencyCode; /// Number of nano (10^-9) units of the amount.
diff --git a/generated/googleapis_beta/lib/domains/v1beta1.dart b/generated/googleapis_beta/lib/domains/v1beta1.dart new file mode 100644 index 0000000..ebc2cc1 --- /dev/null +++ b/generated/googleapis_beta/lib/domains/v1beta1.dart
@@ -0,0 +1,3655 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Cloud Domains API - v1beta1 +/// +/// Enables management and configuration of domain names. +/// +/// For more information, see <https://cloud.google.com/domains/> +/// +/// Create an instance of [CloudDomainsApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsOperationsResource] +/// - [ProjectsLocationsRegistrationsResource] +library domains.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Enables management and configuration of domain names. +class CloudDomainsApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + CloudDomainsApi(http.Client client, + {core.String rootUrl = 'https://domains.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsRegistrationsResource get registrations => + ProjectsLocationsRegistrationsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsRegistrationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsRegistrationsResource(commons.ApiRequester client) + : _requester = client; + + /// Updates a `Registration`'s contact settings. + /// + /// Some changes require confirmation by the domain's registrant contact . + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [registration] - Required. The name of the `Registration` whose contact + /// settings are being updated, in the format `projects / * /locations / * + /// /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> configureContactSettings( + ConfigureContactSettingsRequest request, + core.String registration, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (registration == null) { + throw core.ArgumentError('Parameter registration is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$registration') + + ':configureContactSettings'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a `Registration`'s DNS settings. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [registration] - Required. The name of the `Registration` whose DNS + /// settings are being updated, in the format `projects / * /locations / * + /// /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> configureDnsSettings( + ConfigureDnsSettingsRequest request, + core.String registration, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (registration == null) { + throw core.ArgumentError('Parameter registration is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$registration') + + ':configureDnsSettings'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a `Registration`'s management settings. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [registration] - Required. The name of the `Registration` whose management + /// settings are being updated, in the format `projects / * /locations / * + /// /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> configureManagementSettings( + ConfigureManagementSettingsRequest request, + core.String registration, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (registration == null) { + throw core.ArgumentError('Parameter registration is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$registration') + + ':configureManagementSettings'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a `Registration` resource. + /// + /// This method only works on resources in one of the following states: * + /// `state` is `EXPORTED` with `expire_time` in the past * `state` is + /// `REGISTRATION_FAILED` + /// + /// Request parameters: + /// + /// [name] - Required. The name of the `Registration` to delete, in the format + /// `projects / * /locations / * /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Exports a `Registration` that you no longer want to use with Cloud + /// Domains. + /// + /// You can continue to use the domain in + /// [Google Domains](https://domains.google/) until it expires. If the export + /// is successful: * The resource's `state` becomes `EXPORTED`, meaning that + /// it is no longer managed by Cloud Domains * Because individual users can + /// own domains in Google Domains, the calling user becomes the domain's sole + /// owner. Permissions for the domain are subsequently managed in Google + /// Domains. * Without further action, the domain does not renew + /// automatically. The new owner can set up billing in Google Domains to renew + /// the domain if needed. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the `Registration` to export, in the format + /// `projects / * /locations / * /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> export( + ExportRegistrationRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':export'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the details of a `Registration` resource. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the `Registration` to get, in the format + /// `projects / * /locations / * /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Registration]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Registration> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + Registration.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists the `Registration` resources in a project. + /// + /// Request parameters: + /// + /// [parent] - Required. The project and location from which to list + /// `Registration`s, specified in the format `projects / * /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - Filter expression to restrict the `Registration`s returned. The + /// expression must specify the field name, a comparison operator, and the + /// value that you want to use for filtering. The value must be a string, a + /// number, a boolean, or an enum value. The comparison operator should be one + /// of =, !=, >, <, >=, <=, or : for prefix or wildcard matches. For example, + /// to filter to a specific domain name, use an expression like + /// `domainName="example.com"`. You can also check for the existence of a + /// field; for example, to find domains using custom DNS settings, use an + /// expression like `dnsSettings.customDns:*`. You can also create compound + /// filters by combining expressions with the `AND` and `OR` operators. For + /// example, to find domains that are suspended or have specific issues + /// flagged, use an expression like `(state=SUSPENDED) OR (issue:*)`. + /// + /// [pageSize] - Maximum number of results to return. + /// + /// [pageToken] - When set to the `next_page_token` from a prior response, + /// provides the next page of results. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListRegistrationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListRegistrationsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/registrations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListRegistrationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates select fields of a `Registration` resource, notably `labels`. + /// + /// To update other fields, use the appropriate custom update method: * To + /// update management settings, see `ConfigureManagementSettings` * To update + /// DNS configuration, see `ConfigureDnsSettings` * To update contact + /// information, see `ConfigureContactSettings` + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Name of the `Registration` resource, in the format + /// `projects / * /locations / * /registrations/`. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [updateMask] - Required. The field mask describing which fields to update + /// as a comma-separated list. For example, if only the labels are being + /// updated, the `update_mask` would be `"labels"`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + Registration request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Registers a new domain name and creates a corresponding `Registration` + /// resource. + /// + /// Call `RetrieveRegisterParameters` first to check availability of the + /// domain name and determine parameters like price that are needed to build a + /// call to this method. A successful call creates a `Registration` resource + /// in state `REGISTRATION_PENDING`, which resolves to `ACTIVE` within 1-2 + /// minutes, indicating that the domain was successfully registered. If the + /// resource ends up in state `REGISTRATION_FAILED`, it indicates that the + /// domain was not registered successfully, and you can safely delete the + /// resource and retry registration. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource of the `Registration`. Must be in + /// the format `projects / * /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> register( + RegisterDomainRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/registrations:register'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Resets the authorization code of the `Registration` to a new random + /// string. + /// + /// You can call this method only after 60 days have elapsed since the initial + /// domain registration. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [registration] - Required. The name of the `Registration` whose + /// authorization code is being reset, in the format `projects / * /locations + /// / * /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [AuthorizationCode]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<AuthorizationCode> resetAuthorizationCode( + ResetAuthorizationCodeRequest request, + core.String registration, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (registration == null) { + throw core.ArgumentError('Parameter registration is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$registration') + + ':resetAuthorizationCode'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => AuthorizationCode.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the authorization code of the `Registration` for the purpose of + /// transferring the domain to another registrar. + /// + /// You can call this method only after 60 days have elapsed since the initial + /// domain registration. + /// + /// Request parameters: + /// + /// [registration] - Required. The name of the `Registration` whose + /// authorization code is being retrieved, in the format `projects / * + /// /locations / * /registrations / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [AuthorizationCode]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<AuthorizationCode> retrieveAuthorizationCode( + core.String registration, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (registration == null) { + throw core.ArgumentError('Parameter registration is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$registration') + + ':retrieveAuthorizationCode'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => AuthorizationCode.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets parameters needed to register a new domain name, including price and + /// up-to-date availability. + /// + /// Use the returned values to call `RegisterDomain`. + /// + /// Request parameters: + /// + /// [location] - Required. The location. Must be in the format `projects / * + /// /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [domainName] - Required. The domain name. Unicode domain names must be + /// expressed in Punycode format. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [RetrieveRegisterParametersResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<RetrieveRegisterParametersResponse> retrieveRegisterParameters( + core.String location, { + core.String domainName, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (location == null) { + throw core.ArgumentError('Parameter location is required.'); + } + if (domainName != null) { + _queryParams['domainName'] = [domainName]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$location') + + '/registrations:retrieveRegisterParameters'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => RetrieveRegisterParametersResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Searches for available domain names similar to the provided query. + /// + /// Availability results from this method are approximate; call + /// `RetrieveRegisterParameters` on a domain before registering to confirm + /// availability. + /// + /// Request parameters: + /// + /// [location] - Required. The location. Must be in the format `projects / * + /// /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [query] - Required. String used to search for available domain names. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SearchDomainsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SearchDomainsResponse> searchDomains( + core.String location, { + core.String query, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (location == null) { + throw core.ArgumentError('Parameter location is required.'); + } + if (query != null) { + _queryParams['query'] = [query]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$location') + + '/registrations:searchDomains'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SearchDomainsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/registrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Specifies the audit configuration for a service. +/// +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. An AuditConfig must have one +/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` +/// and a specific service, the union of the two AuditConfigs is used for that +/// service: the log_types specified in each AuditConfig are enabled, and the +/// exempted_members in each AuditLogConfig are exempted. Example Policy with +/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", +/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ +/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": +/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", +/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": +/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +class AuditConfig { + /// The configuration for logging of each type of permission. + core.List<AuditLogConfig> auditLogConfigs; + + /// Specifies a service that will be enabled for audit logging. + /// + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + core.String service; + + AuditConfig(); + + AuditConfig.fromJson(core.Map _json) { + if (_json.containsKey('auditLogConfigs')) { + auditLogConfigs = (_json['auditLogConfigs'] as core.List) + .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('service')) { + service = _json['service'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditLogConfigs != null) { + _json['auditLogConfigs'] = + auditLogConfigs.map((value) => value.toJson()).toList(); + } + if (service != null) { + _json['service'] = service; + } + return _json; + } +} + +/// Provides the configuration for logging a type of permissions. +/// +/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", +/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": +/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while +/// exempting jose@example.com from DATA_READ logging. +class AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// + /// Follows the same format of Binding.members. + core.List<core.String> exemptedMembers; + + /// The log type that this config enables. + /// Possible string values are: + /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. + /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy + /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create + /// - "DATA_READ" : Data reads. Example: CloudSQL Users list + core.String logType; + + AuditLogConfig(); + + AuditLogConfig.fromJson(core.Map _json) { + if (_json.containsKey('exemptedMembers')) { + exemptedMembers = (_json['exemptedMembers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('logType')) { + logType = _json['logType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exemptedMembers != null) { + _json['exemptedMembers'] = exemptedMembers; + } + if (logType != null) { + _json['logType'] = logType; + } + return _json; + } +} + +/// Defines an authorization code. +class AuthorizationCode { + /// The Authorization Code in ASCII. + /// + /// It can be used to transfer the domain to or from another registrar. + core.String code; + + AuthorizationCode(); + + AuthorizationCode.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + return _json; + } +} + +/// Associates `members` with a `role`. +class Binding { + /// The condition that is associated with this binding. + /// + /// If the condition evaluates to `true`, then this binding applies to the + /// current request. If the condition evaluates to `false`, then this binding + /// does not apply to the current request. However, a different role binding + /// might grant the same role to one or more of the members in this binding. + /// To learn which resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition; + + /// Specifies the identities requesting access for a Cloud Platform resource. + /// + /// `members` can have the following values: * `allUsers`: A special + /// identifier that represents anyone who is on the internet; with or without + /// a Google account. * `allAuthenticatedUsers`: A special identifier that + /// represents anyone who is authenticated with a Google account or a service + /// account. * `user:{emailid}`: An email address that represents a specific + /// Google account. For example, `alice@example.com` . * + /// `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * + /// `group:{emailid}`: An email address that represents a Google group. For + /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a user that has + /// been recently deleted. For example, + /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, + /// this value reverts to `user:{emailid}` and the recovered user retains the + /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a service account + /// that has been recently deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If + /// the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email + /// address (plus unique identifier) representing a Google group that has been + /// recently deleted. For example, + /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, + /// this value reverts to `group:{emailid}` and the recovered group retains + /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) + /// that represents all the users of that domain. For example, `google.com` or + /// `example.com`. + core.List<core.String> members; + + /// Role that is assigned to `members`. + /// + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + core.String role; + + Binding(); + + Binding.fromJson(core.Map _json) { + if (_json.containsKey('condition')) { + condition = Expr.fromJson( + _json['condition'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('members')) { + members = (_json['members'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('role')) { + role = _json['role'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (condition != null) { + _json['condition'] = condition.toJson(); + } + if (members != null) { + _json['members'] = members; + } + if (role != null) { + _json['role'] = role; + } + return _json; + } +} + +/// Request for the `ConfigureContactSettings` method. +class ConfigureContactSettingsRequest { + /// The list of contact notices that the caller acknowledges. + /// + /// The notices required here depend on the values specified in + /// `contact_settings`. + core.List<core.String> contactNotices; + + /// Fields of the `ContactSettings` to update. + ContactSettings contactSettings; + + /// The field mask describing which fields to update as a comma-separated + /// list. + /// + /// For example, if only the registrant contact is being updated, the + /// `update_mask` would be `"registrant_contact"`. + /// + /// Required. + core.String updateMask; + + /// Validate the request without actually updating the contact settings. + core.bool validateOnly; + + ConfigureContactSettingsRequest(); + + ConfigureContactSettingsRequest.fromJson(core.Map _json) { + if (_json.containsKey('contactNotices')) { + contactNotices = (_json['contactNotices'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('contactSettings')) { + contactSettings = ContactSettings.fromJson( + _json['contactSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + if (_json.containsKey('validateOnly')) { + validateOnly = _json['validateOnly'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (contactNotices != null) { + _json['contactNotices'] = contactNotices; + } + if (contactSettings != null) { + _json['contactSettings'] = contactSettings.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + if (validateOnly != null) { + _json['validateOnly'] = validateOnly; + } + return _json; + } +} + +/// Request for the `ConfigureDnsSettings` method. +class ConfigureDnsSettingsRequest { + /// Fields of the `DnsSettings` to update. + DnsSettings dnsSettings; + + /// The field mask describing which fields to update as a comma-separated + /// list. + /// + /// For example, if only the name servers are being updated for an existing + /// Custom DNS configuration, the `update_mask` would be + /// `"custom_dns.name_servers"`. When changing the DNS provider from one type + /// to another, pass the new provider's field name as part of the field mask. + /// For example, when changing from a Google Domains DNS configuration to a + /// Custom DNS configuration, the `update_mask` would be `"custom_dns"`. // + /// + /// Required. + core.String updateMask; + + /// Validate the request without actually updating the DNS settings. + core.bool validateOnly; + + ConfigureDnsSettingsRequest(); + + ConfigureDnsSettingsRequest.fromJson(core.Map _json) { + if (_json.containsKey('dnsSettings')) { + dnsSettings = DnsSettings.fromJson( + _json['dnsSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + if (_json.containsKey('validateOnly')) { + validateOnly = _json['validateOnly'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dnsSettings != null) { + _json['dnsSettings'] = dnsSettings.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + if (validateOnly != null) { + _json['validateOnly'] = validateOnly; + } + return _json; + } +} + +/// Request for the `ConfigureManagementSettings` method. +class ConfigureManagementSettingsRequest { + /// Fields of the `ManagementSettings` to update. + ManagementSettings managementSettings; + + /// The field mask describing which fields to update as a comma-separated + /// list. + /// + /// For example, if only the transfer lock is being updated, the `update_mask` + /// would be `"transfer_lock_state"`. + /// + /// Required. + core.String updateMask; + + ConfigureManagementSettingsRequest(); + + ConfigureManagementSettingsRequest.fromJson(core.Map _json) { + if (_json.containsKey('managementSettings')) { + managementSettings = ManagementSettings.fromJson( + _json['managementSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (managementSettings != null) { + _json['managementSettings'] = managementSettings.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// Details required for a contact associated with a `Registration`. +class Contact { + /// Email address of the contact. + /// + /// Required. + core.String email; + + /// Fax number of the contact in international format. + /// + /// For example, `"+1-800-555-0123"`. + core.String faxNumber; + + /// Phone number of the contact in international format. + /// + /// For example, `"+1-800-555-0123"`. + /// + /// Required. + core.String phoneNumber; + + /// Postal address of the contact. + /// + /// Required. + PostalAddress postalAddress; + + Contact(); + + Contact.fromJson(core.Map _json) { + if (_json.containsKey('email')) { + email = _json['email'] as core.String; + } + if (_json.containsKey('faxNumber')) { + faxNumber = _json['faxNumber'] as core.String; + } + if (_json.containsKey('phoneNumber')) { + phoneNumber = _json['phoneNumber'] as core.String; + } + if (_json.containsKey('postalAddress')) { + postalAddress = PostalAddress.fromJson( + _json['postalAddress'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (email != null) { + _json['email'] = email; + } + if (faxNumber != null) { + _json['faxNumber'] = faxNumber; + } + if (phoneNumber != null) { + _json['phoneNumber'] = phoneNumber; + } + if (postalAddress != null) { + _json['postalAddress'] = postalAddress.toJson(); + } + return _json; + } +} + +/// Defines the contact information associated with a `Registration`. +/// +/// [ICANN](https://icann.org/) requires all domain names to have associated +/// contact information. The `registrant_contact` is considered the domain's +/// legal owner, and often the other contacts are identical. +class ContactSettings { + /// The administrative contact for the `Registration`. + /// + /// Required. + Contact adminContact; + + /// Privacy setting for the contacts associated with the `Registration`. + /// + /// Required. + /// Possible string values are: + /// - "CONTACT_PRIVACY_UNSPECIFIED" : The contact privacy settings are + /// undefined. + /// - "PUBLIC_CONTACT_DATA" : All the data from `ContactSettings` is publicly + /// available. When setting this option, you must also provide a + /// `PUBLIC_CONTACT_DATA_ACKNOWLEDGEMENT` in the `contact_notices` field of + /// the request. + /// - "PRIVATE_CONTACT_DATA" : None of the data from `ContactSettings` is + /// publicly available. Instead, proxy contact data is published for your + /// domain. Email sent to the proxy email address is forwarded to the + /// registrant's email address. Cloud Domains provides this privacy proxy + /// service at no additional cost. + /// - "REDACTED_CONTACT_DATA" : Some data from `ContactSettings` is publicly + /// available. The actual information redacted depends on the domain. For + /// details, see + /// [the registration privacy article](https://support.google.com/domains/answer/3251242). + core.String privacy; + + /// The registrant contact for the `Registration`. + /// + /// *Caution: Anyone with access to this email address, phone number, and/or + /// postal address can take control of the domain.* *Warning: For new + /// `Registration`s, the registrant will receive an email confirmation that + /// they must complete within 15 days to avoid domain suspension.* + /// + /// Required. + Contact registrantContact; + + /// The technical contact for the `Registration`. + /// + /// Required. + Contact technicalContact; + + ContactSettings(); + + ContactSettings.fromJson(core.Map _json) { + if (_json.containsKey('adminContact')) { + adminContact = Contact.fromJson( + _json['adminContact'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('privacy')) { + privacy = _json['privacy'] as core.String; + } + if (_json.containsKey('registrantContact')) { + registrantContact = Contact.fromJson( + _json['registrantContact'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('technicalContact')) { + technicalContact = Contact.fromJson( + _json['technicalContact'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (adminContact != null) { + _json['adminContact'] = adminContact.toJson(); + } + if (privacy != null) { + _json['privacy'] = privacy; + } + if (registrantContact != null) { + _json['registrantContact'] = registrantContact.toJson(); + } + if (technicalContact != null) { + _json['technicalContact'] = technicalContact.toJson(); + } + return _json; + } +} + +/// Configuration for an arbitrary DNS provider. +class CustomDns { + /// The list of DS records for this domain, which are used to enable DNSSEC. + /// + /// The domain's DNS provider can provide the values to set here. If this + /// field is empty, DNSSEC is disabled. + core.List<DsRecord> dsRecords; + + /// A list of name servers that store the DNS zone for this domain. + /// + /// Each name server is a domain name, with Unicode domain names expressed in + /// Punycode format. + /// + /// Required. + core.List<core.String> nameServers; + + CustomDns(); + + CustomDns.fromJson(core.Map _json) { + if (_json.containsKey('dsRecords')) { + dsRecords = (_json['dsRecords'] as core.List) + .map<DsRecord>((value) => + DsRecord.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nameServers')) { + nameServers = (_json['nameServers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dsRecords != null) { + _json['dsRecords'] = dsRecords.map((value) => value.toJson()).toList(); + } + if (nameServers != null) { + _json['nameServers'] = nameServers; + } + return _json; + } +} + +/// Defines the DNS configuration of a `Registration`, including name servers, +/// DNSSEC, and glue records. +class DnsSettings { + /// An arbitrary DNS provider identified by its name servers. + CustomDns customDns; + + /// The list of glue records for this `Registration`. + /// + /// Commonly empty. + core.List<GlueRecord> glueRecords; + + /// The free DNS zone provided by [Google Domains](https://domains.google/). + GoogleDomainsDns googleDomainsDns; + + DnsSettings(); + + DnsSettings.fromJson(core.Map _json) { + if (_json.containsKey('customDns')) { + customDns = CustomDns.fromJson( + _json['customDns'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('glueRecords')) { + glueRecords = (_json['glueRecords'] as core.List) + .map<GlueRecord>((value) => + GlueRecord.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('googleDomainsDns')) { + googleDomainsDns = GoogleDomainsDns.fromJson( + _json['googleDomainsDns'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (customDns != null) { + _json['customDns'] = customDns.toJson(); + } + if (glueRecords != null) { + _json['glueRecords'] = + glueRecords.map((value) => value.toJson()).toList(); + } + if (googleDomainsDns != null) { + _json['googleDomainsDns'] = googleDomainsDns.toJson(); + } + return _json; + } +} + +/// Defines a Delegation Signer (DS) record, which is needed to enable DNSSEC +/// for a domain. +/// +/// It contains a digest (hash) of a DNSKEY record that must be present in the +/// domain's DNS zone. +class DsRecord { + /// The algorithm used to generate the referenced DNSKEY. + /// Possible string values are: + /// - "ALGORITHM_UNSPECIFIED" : The algorithm is unspecified. + /// - "DSA" : DSA/SHA1. Not recommended for new deployments. + /// - "ECC" : ECC. Not recommended for new deployments. + /// - "RSASHA1" : RSA/SHA-1. Not recommended for new deployments. + /// - "DSANSEC3SHA1" : DSA-NSEC3-SHA1. Not recommended for new deployments. + /// - "RSASHA1NSEC3SHA1" : RSA/SHA1-NSEC3-SHA1. Not recommended for new + /// deployments. + /// - "RSASHA256" : RSA/SHA-256. + /// - "RSASHA512" : RSA/SHA-512. + /// - "ECCGOST" : GOST R 34.10-2001. + /// - "ECDSAP256SHA256" : ECDSA Curve P-256 with SHA-256. + /// - "ECDSAP384SHA384" : ECDSA Curve P-384 with SHA-384. + /// - "ED25519" : Ed25519. + /// - "ED448" : Ed448. + core.String algorithm; + + /// The digest generated from the referenced DNSKEY. + core.String digest; + + /// The hash function used to generate the digest of the referenced DNSKEY. + /// Possible string values are: + /// - "DIGEST_TYPE_UNSPECIFIED" : The DigestType is unspecified. + /// - "SHA1" : SHA-1. Not recommended for new deployments. + /// - "SHA256" : SHA-256. + /// - "GOST3411" : GOST R 34.11-94. + /// - "SHA384" : SHA-384. + core.String digestType; + + /// The key tag of the record. + /// + /// Must be set in range 0 -- 65535. + core.int keyTag; + + DsRecord(); + + DsRecord.fromJson(core.Map _json) { + if (_json.containsKey('algorithm')) { + algorithm = _json['algorithm'] as core.String; + } + if (_json.containsKey('digest')) { + digest = _json['digest'] as core.String; + } + if (_json.containsKey('digestType')) { + digestType = _json['digestType'] as core.String; + } + if (_json.containsKey('keyTag')) { + keyTag = _json['keyTag'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (algorithm != null) { + _json['algorithm'] = algorithm; + } + if (digest != null) { + _json['digest'] = digest; + } + if (digestType != null) { + _json['digestType'] = digestType; + } + if (keyTag != null) { + _json['keyTag'] = keyTag; + } + return _json; + } +} + +/// Request for the `ExportRegistration` method. +class ExportRegistrationRequest { + ExportRegistrationRequest(); + + ExportRegistrationRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. +/// +/// CEL is a C-like expression language. The syntax and semantics of CEL are +/// documented at https://github.com/google/cel-spec. Example (Comparison): +/// title: "Summary size limit" description: "Determines if a summary is less +/// than 100 chars" expression: "document.summary.size() < 100" Example +/// (Equality): title: "Requestor is owner" description: "Determines if +/// requestor is the document owner" expression: "document.owner == +/// request.auth.claims.email" Example (Logic): title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): title: "Notification string" description: +/// "Create a notification string with a timestamp." expression: "'New message +/// received at ' + string(document.create_time)" The exact variables and +/// functions that may be referenced within an expression are determined by the +/// service that evaluates it. See the service documentation for additional +/// information. +class Expr { + /// Description of the expression. + /// + /// This is a longer text which describes the expression, e.g. when hovered + /// over it in a UI. + /// + /// Optional. + core.String description; + + /// Textual representation of an expression in Common Expression Language + /// syntax. + core.String expression; + + /// String indicating the location of the expression for error reporting, e.g. + /// a file name and a position in the file. + /// + /// Optional. + core.String location; + + /// Title for the expression, i.e. a short string describing its purpose. + /// + /// This can be used e.g. in UIs which allow to enter the expression. + /// + /// Optional. + core.String title; + + Expr(); + + Expr.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('location')) { + location = _json['location'] as core.String; + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (location != null) { + _json['location'] = location; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// Defines a host on your domain that is a DNS name server for your domain +/// and/or other domains. +/// +/// Glue records are a way of making the IP address of a name server known, even +/// when it serves DNS queries for its parent domain. For example, when +/// `ns.example.com` is a name server for `example.com`, the host +/// `ns.example.com` must have a glue record to break the circular DNS +/// reference. +class GlueRecord { + /// Domain name of the host in Punycode format. + /// + /// Required. + core.String hostName; + + /// List of IPv4 addresses corresponding to this host in the standard decimal + /// format (e.g. `198.51.100.1`). + /// + /// At least one of `ipv4_address` and `ipv6_address` must be set. + core.List<core.String> ipv4Addresses; + + /// List of IPv6 addresses corresponding to this host in the standard + /// hexadecimal format (e.g. `2001:db8::`). + /// + /// At least one of `ipv4_address` and `ipv6_address` must be set. + core.List<core.String> ipv6Addresses; + + GlueRecord(); + + GlueRecord.fromJson(core.Map _json) { + if (_json.containsKey('hostName')) { + hostName = _json['hostName'] as core.String; + } + if (_json.containsKey('ipv4Addresses')) { + ipv4Addresses = (_json['ipv4Addresses'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('ipv6Addresses')) { + ipv6Addresses = (_json['ipv6Addresses'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (hostName != null) { + _json['hostName'] = hostName; + } + if (ipv4Addresses != null) { + _json['ipv4Addresses'] = ipv4Addresses; + } + if (ipv6Addresses != null) { + _json['ipv6Addresses'] = ipv6Addresses; + } + return _json; + } +} + +/// Configuration for using the free DNS zone provided by Google Domains as a +/// `Registration`'s `dns_provider`. +/// +/// You cannot configure the DNS zone itself using the API. To configure the DNS +/// zone, go to [Google Domains](https://domains.google/). +class GoogleDomainsDns { + /// The list of DS records published for this domain. + /// + /// The list is automatically populated when `ds_state` is + /// `DS_RECORDS_PUBLISHED`, otherwise it remains empty. + /// + /// Output only. + core.List<DsRecord> dsRecords; + + /// The state of DS records for this domain. + /// + /// Used to enable or disable automatic DNSSEC. + /// + /// Required. + /// Possible string values are: + /// - "DS_STATE_UNSPECIFIED" : DS state is unspecified. + /// - "DS_RECORDS_UNPUBLISHED" : DNSSEC is disabled for this domain. No DS + /// records for this domain are published in the parent DNS zone. + /// - "DS_RECORDS_PUBLISHED" : DNSSEC is enabled for this domain. Appropriate + /// DS records for this domain are published in the parent DNS zone. This + /// option is valid only if the DNS zone referenced in the `Registration`'s + /// `dns_provider` field is already DNSSEC-signed. + core.String dsState; + + /// A list of name servers that store the DNS zone for this domain. + /// + /// Each name server is a domain name, with Unicode domain names expressed in + /// Punycode format. This field is automatically populated with the name + /// servers assigned to the Google Domains DNS zone. + /// + /// Output only. + core.List<core.String> nameServers; + + GoogleDomainsDns(); + + GoogleDomainsDns.fromJson(core.Map _json) { + if (_json.containsKey('dsRecords')) { + dsRecords = (_json['dsRecords'] as core.List) + .map<DsRecord>((value) => + DsRecord.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dsState')) { + dsState = _json['dsState'] as core.String; + } + if (_json.containsKey('nameServers')) { + nameServers = (_json['nameServers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dsRecords != null) { + _json['dsRecords'] = dsRecords.map((value) => value.toJson()).toList(); + } + if (dsState != null) { + _json['dsState'] = dsState; + } + if (nameServers != null) { + _json['nameServers'] = nameServers; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class ListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<Operation> operations; + + ListOperationsResponse(); + + ListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response for the `ListRegistrations` method. +class ListRegistrationsResponse { + /// When present, there are more results to retrieve. + /// + /// Set `page_token` to this value on a subsequent call to get the next page + /// of results. + core.String nextPageToken; + + /// A list of `Registration`s. + core.List<Registration> registrations; + + ListRegistrationsResponse(); + + ListRegistrationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('registrations')) { + registrations = (_json['registrations'] as core.List) + .map<Registration>((value) => Registration.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (registrations != null) { + _json['registrations'] = + registrations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Defines renewal, billing, and transfer settings for a `Registration`. +class ManagementSettings { + /// The renewal method for this `Registration`. + /// + /// Output only. + /// Possible string values are: + /// - "RENEWAL_METHOD_UNSPECIFIED" : The renewal method is undefined. + /// - "AUTOMATIC_RENEWAL" : The domain is automatically renewed each year . To + /// disable automatic renewals, export the domain by calling + /// `ExportRegistration` . + /// - "MANUAL_RENEWAL" : The domain must be explicitly renewed each year + /// before its `expire_time`. This option is only available when the + /// `Registration` is in state `EXPORTED`. To manage the domain's current + /// billing and renewal settings, go to + /// [Google Domains](https://domains.google/). + core.String renewalMethod; + + /// Controls whether the domain can be transferred to another registrar. + /// Possible string values are: + /// - "TRANSFER_LOCK_STATE_UNSPECIFIED" : The state is unspecified. + /// - "UNLOCKED" : The domain is unlocked and can be transferred to another + /// registrar. + /// - "LOCKED" : The domain is locked and cannot be transferred to another + /// registrar. + core.String transferLockState; + + ManagementSettings(); + + ManagementSettings.fromJson(core.Map _json) { + if (_json.containsKey('renewalMethod')) { + renewalMethod = _json['renewalMethod'] as core.String; + } + if (_json.containsKey('transferLockState')) { + transferLockState = _json['transferLockState'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (renewalMethod != null) { + _json['renewalMethod'] = renewalMethod; + } + if (transferLockState != null) { + _json['transferLockState'] = transferLockState; + } + return _json; + } +} + +/// Represents an amount of money with its currency type. +class Money { + /// The three-letter currency code defined in ISO 4217. + core.String currencyCode; + + /// Number of nano (10^-9) units of the amount. + /// + /// The value must be between -999,999,999 and +999,999,999 inclusive. If + /// `units` is positive, `nanos` must be positive or zero. If `units` is zero, + /// `nanos` can be positive, zero, or negative. If `units` is negative, + /// `nanos` must be negative or zero. For example $-1.75 is represented as + /// `units`=-1 and `nanos`=-750,000,000. + core.int nanos; + + /// The whole units of the amount. + /// + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + core.String units; + + Money(); + + Money.fromJson(core.Map _json) { + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('nanos')) { + nanos = _json['nanos'] as core.int; + } + if (_json.containsKey('units')) { + units = _json['units'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (nanos != null) { + _json['nanos'] = nanos; + } + if (units != null) { + _json['units'] = units; + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class Operation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + Status error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +/// +/// Output only. +class OperationMetadata { + /// API version used to start the operation. + core.String apiVersion; + + /// The time the operation was created. + core.String createTime; + + /// The time the operation finished running. + core.String endTime; + + /// Human-readable status of the operation, if any. + core.String statusDetail; + + /// Server-defined resource path for the target of the operation. + core.String target; + + /// Name of the verb executed by the operation. + core.String verb; + + OperationMetadata(); + + OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('statusDetail')) { + statusDetail = _json['statusDetail'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (statusDetail != null) { + _json['statusDetail'] = statusDetail; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service +/// accounts, Google groups, and domains (such as G Suite). A `role` is a named +/// list of permissions; each `role` can be an IAM predefined role or a +/// user-created custom role. For some types of Google Cloud resources, a +/// `binding` can also specify a `condition`, which is a logical expression that +/// allows access to a resource only if the expression evaluates to `true`. A +/// condition can add constraints based on attributes of the request, the +/// resource, or both. To learn which resources support conditions in their IAM +/// policies, see the +/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +/// **JSON example:** { "bindings": \[ { "role": +/// "roles/resourcemanager.organizationAdmin", "members": \[ +/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": +/// "roles/resourcemanager.organizationViewer", "members": \[ +/// "user:eve@example.com" \], "condition": { "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", "expression": +/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": +/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - +/// user:mike@example.com - group:admins@example.com - domain:google.com - +/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer condition: title: expirable +/// access description: Does not grant access after Sep 2020 expression: +/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - +/// version: 3 For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +class Policy { + /// Specifies cloud audit logging configuration for this policy. + core.List<AuditConfig> auditConfigs; + + /// Associates a list of `members` to a `role`. + /// + /// Optionally, may specify a `condition` that determines how and when the + /// `bindings` are applied. Each of the `bindings` must contain at least one + /// member. + core.List<Binding> bindings; + + /// `etag` is used for optimistic concurrency control as a way to help prevent + /// simultaneous updates of a policy from overwriting each other. + /// + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the + /// policy. **Important:** If you use IAM Conditions, you must include the + /// `etag` field whenever you call `setIamPolicy`. If you omit this field, + /// then IAM allows you to overwrite a version `3` policy with a version `1` + /// policy, and all of the conditions in the version `3` policy are lost. + core.String etag; + core.List<core.int> get etagAsBytes => convert.base64.decode(etag); + + set etagAsBytes(core.List<core.int> _bytes) { + etag = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. Any operation that affects conditional role bindings must + /// specify version `3`. This requirement applies to the following operations: + /// * Getting a policy that includes a conditional role binding * Adding a + /// conditional role binding to a policy * Changing a conditional role binding + /// in a policy * Removing any role binding, with or without a condition, from + /// a policy that includes conditions **Important:** If you use IAM + /// Conditions, you must include the `etag` field whenever you call + /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a + /// version `3` policy with a version `1` policy, and all of the conditions in + /// the version `3` policy are lost. If a policy does not include any + /// conditions, operations on that policy may specify any valid version or + /// leave the field unset. To learn which resources support conditions in + /// their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + core.int version; + + Policy(); + + Policy.fromJson(core.Map _json) { + if (_json.containsKey('auditConfigs')) { + auditConfigs = (_json['auditConfigs'] as core.List) + .map<AuditConfig>((value) => AuditConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('bindings')) { + bindings = (_json['bindings'] as core.List) + .map<Binding>((value) => + Binding.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('etag')) { + etag = _json['etag'] as core.String; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditConfigs != null) { + _json['auditConfigs'] = + auditConfigs.map((value) => value.toJson()).toList(); + } + if (bindings != null) { + _json['bindings'] = bindings.map((value) => value.toJson()).toList(); + } + if (etag != null) { + _json['etag'] = etag; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// Represents a postal address, e.g. for postal delivery or payments addresses. +/// +/// Given a postal address, a postal service can deliver items to a premise, +/// P.O. Box or similar. It is not intended to model geographical locations +/// (roads, towns, mountains). In typical usage an address would be created via +/// user input or from importing existing data, depending on the type of +/// process. Advice on address input / editing: - Use an i18n-ready address +/// widget such as https://github.com/google/libaddressinput) - Users should not +/// be presented with UI elements for input or editing of fields outside +/// countries where that field is used. For more guidance on how to use this +/// schema, please see: https://support.google.com/business/answer/6397478 +class PostalAddress { + /// Unstructured address lines describing the lower levels of an address. + /// + /// Because values in address_lines do not have type information and may + /// sometimes contain multiple values in a single field (e.g. "Austin, TX"), + /// it is important that the line order is clear. The order of address lines + /// should be "envelope order" for the country/region of the address. In + /// places where this can vary (e.g. Japan), address_language is used to make + /// it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" + /// for small-to-large). This way, the most specific line of an address can be + /// selected based on the language. The minimum permitted structural + /// representation of an address consists of a region_code with all remaining + /// information placed in the address_lines. It would be possible to format + /// such an address very approximately without geocoding, but no semantic + /// reasoning could be made about any of the address components until it was + /// at least partially resolved. Creating an address only containing a + /// region_code and address_lines, and then geocoding is the recommended way + /// to handle completely unstructured addresses (as opposed to guessing which + /// parts of the address should be localities or administrative areas). + core.List<core.String> addressLines; + + /// Highest administrative subdivision which is used for postal addresses of a + /// country or region. + /// + /// For example, this can be a state, a province, an oblast, or a prefecture. + /// Specifically, for Spain this is the province and not the autonomous + /// community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use + /// an administrative area in postal addresses. E.g. in Switzerland this + /// should be left unpopulated. + /// + /// Optional. + core.String administrativeArea; + + /// BCP-47 language code of the contents of this address (if known). + /// + /// This is often the UI language of the input form or is expected to match + /// one of the languages used in the address' country/region, or their + /// transliterated equivalents. This can affect formatting in certain + /// countries, but is not critical to the correctness of the data and will + /// never affect any validation or other non-formatting related operations. If + /// this value is not known, it should be omitted (rather than specifying a + /// possibly incorrect default). Examples: "zh-Hant", "ja", "ja-Latn", "en". + /// + /// Optional. + core.String languageCode; + + /// Generally refers to the city/town portion of the address. + /// + /// Examples: US city, IT comune, UK post town. In regions of the world where + /// localities are not well defined or do not fit into this structure well, + /// leave locality empty and use address_lines. + /// + /// Optional. + core.String locality; + + /// The name of the organization at the address. + /// + /// Optional. + core.String organization; + + /// Postal code of the address. + /// + /// Not all countries use or require postal codes to be present, but where + /// they are used, they may trigger additional validation with other parts of + /// the address (e.g. state/zip validation in the U.S.A.). + /// + /// Optional. + core.String postalCode; + + /// The recipient at the address. + /// + /// This field may, under certain circumstances, contain multiline + /// information. For example, it might contain "care of" information. + /// + /// Optional. + core.List<core.String> recipients; + + /// CLDR region code of the country/region of the address. + /// + /// This is never inferred and it is up to the user to ensure the value is + /// correct. See http://cldr.unicode.org/ and + /// http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + /// for details. Example: "CH" for Switzerland. + /// + /// Required. + core.String regionCode; + + /// The schema revision of the `PostalAddress`. + /// + /// This must be set to 0, which is the latest revision. All new revisions + /// **must** be backward compatible with old revisions. + core.int revision; + + /// Additional, country-specific, sorting code. + /// + /// This is not used in most regions. Where it is used, the value is either a + /// string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or + /// just a number alone, representing the "sector code" (Jamaica), "delivery + /// area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + /// + /// Optional. + core.String sortingCode; + + /// Sublocality of the address. + /// + /// For example, this can be neighborhoods, boroughs, districts. + /// + /// Optional. + core.String sublocality; + + PostalAddress(); + + PostalAddress.fromJson(core.Map _json) { + if (_json.containsKey('addressLines')) { + addressLines = (_json['addressLines'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('administrativeArea')) { + administrativeArea = _json['administrativeArea'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('locality')) { + locality = _json['locality'] as core.String; + } + if (_json.containsKey('organization')) { + organization = _json['organization'] as core.String; + } + if (_json.containsKey('postalCode')) { + postalCode = _json['postalCode'] as core.String; + } + if (_json.containsKey('recipients')) { + recipients = (_json['recipients'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('regionCode')) { + regionCode = _json['regionCode'] as core.String; + } + if (_json.containsKey('revision')) { + revision = _json['revision'] as core.int; + } + if (_json.containsKey('sortingCode')) { + sortingCode = _json['sortingCode'] as core.String; + } + if (_json.containsKey('sublocality')) { + sublocality = _json['sublocality'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (addressLines != null) { + _json['addressLines'] = addressLines; + } + if (administrativeArea != null) { + _json['administrativeArea'] = administrativeArea; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (locality != null) { + _json['locality'] = locality; + } + if (organization != null) { + _json['organization'] = organization; + } + if (postalCode != null) { + _json['postalCode'] = postalCode; + } + if (recipients != null) { + _json['recipients'] = recipients; + } + if (regionCode != null) { + _json['regionCode'] = regionCode; + } + if (revision != null) { + _json['revision'] = revision; + } + if (sortingCode != null) { + _json['sortingCode'] = sortingCode; + } + if (sublocality != null) { + _json['sublocality'] = sublocality; + } + return _json; + } +} + +/// Request for the `RegisterDomain` method. +class RegisterDomainRequest { + /// The list of contact notices that the caller acknowledges. + /// + /// The notices required here depend on the values specified in + /// `registration.contact_settings`. + core.List<core.String> contactNotices; + + /// The list of domain notices that you acknowledge. + /// + /// Call `RetrieveRegisterParameters` to see the notices that need + /// acknowledgement. + core.List<core.String> domainNotices; + + /// The complete `Registration` resource to be created. + /// + /// Required. + Registration registration; + + /// When true, only validation will be performed, without actually registering + /// the domain. + /// + /// Follows: + /// https://cloud.google.com/apis/design/design_patterns#request_validation + core.bool validateOnly; + + /// Yearly price to register or renew the domain. + /// + /// The value that should be put here can be obtained from + /// RetrieveRegisterParameters or SearchDomains calls. + /// + /// Required. + Money yearlyPrice; + + RegisterDomainRequest(); + + RegisterDomainRequest.fromJson(core.Map _json) { + if (_json.containsKey('contactNotices')) { + contactNotices = (_json['contactNotices'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('domainNotices')) { + domainNotices = (_json['domainNotices'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('registration')) { + registration = Registration.fromJson( + _json['registration'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('validateOnly')) { + validateOnly = _json['validateOnly'] as core.bool; + } + if (_json.containsKey('yearlyPrice')) { + yearlyPrice = Money.fromJson( + _json['yearlyPrice'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (contactNotices != null) { + _json['contactNotices'] = contactNotices; + } + if (domainNotices != null) { + _json['domainNotices'] = domainNotices; + } + if (registration != null) { + _json['registration'] = registration.toJson(); + } + if (validateOnly != null) { + _json['validateOnly'] = validateOnly; + } + if (yearlyPrice != null) { + _json['yearlyPrice'] = yearlyPrice.toJson(); + } + return _json; + } +} + +/// Parameters required to register a new domain. +class RegisterParameters { + /// Indicates whether the domain is available for registration. + /// + /// This value is accurate when obtained by calling + /// `RetrieveRegisterParameters`, but is approximate when obtained by calling + /// `SearchDomains`. + /// Possible string values are: + /// - "AVAILABILITY_UNSPECIFIED" : The availability is unspecified. + /// - "AVAILABLE" : The domain is available for registration. + /// - "UNAVAILABLE" : The domain is not available for registration. Generally + /// this means it is already registered to another party. + /// - "UNSUPPORTED" : The domain is not currently supported by Cloud Domains, + /// but may be available elsewhere. + /// - "UNKNOWN" : Cloud Domains is unable to determine domain availability, + /// generally due to system maintenance at the domain name registry. + core.String availability; + + /// The domain name. + /// + /// Unicode domain names are expressed in Punycode format. + core.String domainName; + + /// Notices about special properties of the domain. + core.List<core.String> domainNotices; + + /// Contact privacy options that the domain supports. + core.List<core.String> supportedPrivacy; + + /// Price to register or renew the domain for one year. + Money yearlyPrice; + + RegisterParameters(); + + RegisterParameters.fromJson(core.Map _json) { + if (_json.containsKey('availability')) { + availability = _json['availability'] as core.String; + } + if (_json.containsKey('domainName')) { + domainName = _json['domainName'] as core.String; + } + if (_json.containsKey('domainNotices')) { + domainNotices = (_json['domainNotices'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('supportedPrivacy')) { + supportedPrivacy = (_json['supportedPrivacy'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('yearlyPrice')) { + yearlyPrice = Money.fromJson( + _json['yearlyPrice'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (availability != null) { + _json['availability'] = availability; + } + if (domainName != null) { + _json['domainName'] = domainName; + } + if (domainNotices != null) { + _json['domainNotices'] = domainNotices; + } + if (supportedPrivacy != null) { + _json['supportedPrivacy'] = supportedPrivacy; + } + if (yearlyPrice != null) { + _json['yearlyPrice'] = yearlyPrice.toJson(); + } + return _json; + } +} + +/// The `Registration` resource facilitates managing and configuring domain name +/// registrations. +/// +/// To create a new `Registration` resource, find a suitable domain name by +/// calling the `SearchDomains` method with a query to see available domain name +/// options. After choosing a name, call `RetrieveRegisterParameters` to ensure +/// availability and obtain information like pricing, which is needed to build a +/// call to `RegisterDomain`. +class Registration { + /// Settings for contact information linked to the `Registration`. + /// + /// You cannot update these with the `UpdateRegistration` method. To update + /// these settings, use the `ConfigureContactSettings` method. + /// + /// Required. + ContactSettings contactSettings; + + /// The creation timestamp of the `Registration` resource. + /// + /// Output only. + core.String createTime; + + /// Settings controlling the DNS configuration of the `Registration`. + /// + /// You cannot update these with the `UpdateRegistration` method. To update + /// these settings, use the `ConfigureDnsSettings` method. + DnsSettings dnsSettings; + + /// The domain name. + /// + /// Unicode domain names must be expressed in Punycode format. + /// + /// Required. Immutable. + core.String domainName; + + /// The expiration timestamp of the `Registration`. + /// + /// Output only. + core.String expireTime; + + /// The set of issues with the `Registration` that require attention. + /// + /// Output only. + core.List<core.String> issues; + + /// Set of labels associated with the `Registration`. + core.Map<core.String, core.String> labels; + + /// Settings for management of the `Registration`, including renewal, billing, + /// and transfer. + /// + /// You cannot update these with the `UpdateRegistration` method. To update + /// these settings, use the `ConfigureManagementSettings` method. + ManagementSettings managementSettings; + + /// Name of the `Registration` resource, in the format `projects / * + /// /locations / * /registrations/`. + /// + /// Output only. + core.String name; + + /// Pending contact settings for the `Registration`. + /// + /// Updates to the `contact_settings` field that change its + /// `registrant_contact` or `privacy` fields require email confirmation by the + /// `registrant_contact` before taking effect. This field is set only if there + /// are pending updates to the `contact_settings` that have not yet been + /// confirmed. To confirm the changes, the `registrant_contact` must follow + /// the instructions in the email they receive. + /// + /// Output only. + ContactSettings pendingContactSettings; + + /// The state of the `Registration` + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state is undefined. + /// - "REGISTRATION_PENDING" : The domain is being registered. + /// - "REGISTRATION_FAILED" : The domain registration failed. You can delete + /// resources in this state to allow registration to be retried. + /// - "ACTIVE" : The domain is registered and operational. The domain renews + /// automatically as long as it remains in this state. + /// - "SUSPENDED" : The domain is suspended and inoperative. For more details, + /// see the `issues` field. + /// - "EXPORTED" : The domain has been exported from Cloud Domains to + /// [Google Domains](https://domains.google/). You can no longer update it + /// with this API, and information shown about it may be stale. Without + /// further action, domains in this state expire at their `expire_time`. You + /// can delete the resource after the `expire_time` has passed. + core.String state; + + /// Set of options for the `contact_settings.privacy` field that this + /// `Registration` supports. + /// + /// Output only. + core.List<core.String> supportedPrivacy; + + Registration(); + + Registration.fromJson(core.Map _json) { + if (_json.containsKey('contactSettings')) { + contactSettings = ContactSettings.fromJson( + _json['contactSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('dnsSettings')) { + dnsSettings = DnsSettings.fromJson( + _json['dnsSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('domainName')) { + domainName = _json['domainName'] as core.String; + } + if (_json.containsKey('expireTime')) { + expireTime = _json['expireTime'] as core.String; + } + if (_json.containsKey('issues')) { + issues = (_json['issues'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('managementSettings')) { + managementSettings = ManagementSettings.fromJson( + _json['managementSettings'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('pendingContactSettings')) { + pendingContactSettings = ContactSettings.fromJson( + _json['pendingContactSettings'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('supportedPrivacy')) { + supportedPrivacy = (_json['supportedPrivacy'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (contactSettings != null) { + _json['contactSettings'] = contactSettings.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (dnsSettings != null) { + _json['dnsSettings'] = dnsSettings.toJson(); + } + if (domainName != null) { + _json['domainName'] = domainName; + } + if (expireTime != null) { + _json['expireTime'] = expireTime; + } + if (issues != null) { + _json['issues'] = issues; + } + if (labels != null) { + _json['labels'] = labels; + } + if (managementSettings != null) { + _json['managementSettings'] = managementSettings.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (pendingContactSettings != null) { + _json['pendingContactSettings'] = pendingContactSettings.toJson(); + } + if (state != null) { + _json['state'] = state; + } + if (supportedPrivacy != null) { + _json['supportedPrivacy'] = supportedPrivacy; + } + return _json; + } +} + +/// Request for the `ResetAuthorizationCode` method. +class ResetAuthorizationCodeRequest { + ResetAuthorizationCodeRequest(); + + ResetAuthorizationCodeRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Response for the `RetrieveRegisterParameters` method. +class RetrieveRegisterParametersResponse { + /// Parameters to use when calling the `RegisterDomain` method. + RegisterParameters registerParameters; + + RetrieveRegisterParametersResponse(); + + RetrieveRegisterParametersResponse.fromJson(core.Map _json) { + if (_json.containsKey('registerParameters')) { + registerParameters = RegisterParameters.fromJson( + _json['registerParameters'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (registerParameters != null) { + _json['registerParameters'] = registerParameters.toJson(); + } + return _json; + } +} + +/// Response for the `SearchDomains` method. +class SearchDomainsResponse { + /// Results of the domain name search. + core.List<RegisterParameters> registerParameters; + + SearchDomainsResponse(); + + SearchDomainsResponse.fromJson(core.Map _json) { + if (_json.containsKey('registerParameters')) { + registerParameters = (_json['registerParameters'] as core.List) + .map<RegisterParameters>((value) => RegisterParameters.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (registerParameters != null) { + _json['registerParameters'] = + registerParameters.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for `SetIamPolicy` method. +class SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. + /// + /// The size of the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) might + /// reject them. + Policy policy; + + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. + /// + /// Only the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: `paths: "bindings, etag"` + core.String updateMask; + + SetIamPolicyRequest(); + + SetIamPolicyRequest.fromJson(core.Map _json) { + if (_json.containsKey('policy')) { + policy = Policy.fromJson( + _json['policy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (policy != null) { + _json['policy'] = policy.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class Status { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + Status(); + + Status.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// Request message for `TestIamPermissions` method. +class TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. + /// + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// For more information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + core.List<core.String> permissions; + + TestIamPermissionsRequest(); + + TestIamPermissionsRequest.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Response message for `TestIamPermissions` method. +class TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + core.List<core.String> permissions; + + TestIamPermissionsResponse(); + + TestIamPermissionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/firebase/v1beta1.dart b/generated/googleapis_beta/lib/firebase/v1beta1.dart index 3ab7600..ac0f7b4 100644 --- a/generated/googleapis_beta/lib/firebase/v1beta1.dart +++ b/generated/googleapis_beta/lib/firebase/v1beta1.dart
@@ -833,9 +833,23 @@ /// [filter] - A query string compatible with Google's /// \[AIP-160\](https://google.aip.dev/160) standard. Use any of the following /// fields in a query: * - /// \[`appId`\](../projects.apps#FirebaseProjectInfo.FIELDS.app_id) * - /// \[`namespace`\](../projects.apps#FirebaseProjectInfo.FIELDS.namespace) * - /// \[`platform`\](../projects.apps#FirebaseProjectInfo.FIELDS.platform) + /// \[`app_id`\](../projects.apps#FirebaseAppInfo.FIELDS.app_id) * + /// \[`namespace`\](../projects.apps#FirebaseAppInfo.FIELDS.namespace) * + /// \[`platform`\](../projects.apps#FirebaseAppInfo.FIELDS.platform) We also + /// support the following "virtual" fields (fields which are not actually part + /// of the returned resource object, but can be queried as if they are + /// pre-populated with specific values): * `sha1_hash`: This field is + /// considered to be a repeated `string` field, populated with the list of all + /// SHA-1 certificate fingerprints registered with the app. This list is empty + /// if the app is not an Android app. * `sha256_hash`: This field is + /// considered to be a repeated `string` field, populated with the list of all + /// SHA-256 certificate fingerprints registered with the app. This list is + /// empty if the app is not an Android app. * `app_store_id`: This field is + /// considered to be a singular `string` field, populated with the Apple App + /// Store ID registered with the app. This field is empty if the app is not an + /// iOS app. * `team_id`: This field is considered to be a singular `string` + /// field, populated with the Apple team ID registered with the app. This + /// field is empty if the app is not an iOS app. /// /// [pageSize] - The maximum number of Apps to return in the response. The /// server may return fewer than this value at its discretion. If no value is
diff --git a/generated/googleapis_beta/lib/firebasedatabase/v1beta.dart b/generated/googleapis_beta/lib/firebasedatabase/v1beta.dart new file mode 100644 index 0000000..ed5ba09 --- /dev/null +++ b/generated/googleapis_beta/lib/firebasedatabase/v1beta.dart
@@ -0,0 +1,668 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Firebase Realtime Database Management API - v1beta +/// +/// The Firebase Realtime Database Management API enables programmatic +/// provisioning and management of Realtime Database instances. +/// +/// For more information, see +/// <https://firebase.google.com/docs/reference/rest/database/database-management/rest/> +/// +/// Create an instance of [FirebaseRealtimeDatabaseApi] to access these +/// resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsInstancesResource] +library firebasedatabase.v1beta; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// The Firebase Realtime Database Management API enables programmatic +/// provisioning and management of Realtime Database instances. +class FirebaseRealtimeDatabaseApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + /// View your data across Google Cloud Platform services + static const cloudPlatformReadOnlyScope = + 'https://www.googleapis.com/auth/cloud-platform.read-only'; + + /// View and administer all your Firebase data and settings + static const firebaseScope = 'https://www.googleapis.com/auth/firebase'; + + /// View all your Firebase data and settings + static const firebaseReadonlyScope = + 'https://www.googleapis.com/auth/firebase.readonly'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + FirebaseRealtimeDatabaseApi(http.Client client, + {core.String rootUrl = 'https://firebasedatabase.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsInstancesResource get instances => + ProjectsLocationsInstancesResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsInstancesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsInstancesResource(commons.ApiRequester client) + : _requester = client; + + /// Requests that a new DatabaseInstance be created. + /// + /// The state of a successfully created DatabaseInstance is ACTIVE. Only + /// available for projects on the Blaze plan. Projects can be upgraded using + /// the Cloud Billing API + /// https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. + /// Note that it might take a few minutes for billing enablement state to + /// propagate to Firebase systems. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - The parent project for which to create a database instance, in + /// the form: `projects/{project-number}/locations/{location-id}`. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [databaseId] - The globally unique identifier of the database instance. + /// + /// [validateOnly] - When set to true, the request will be validated but not + /// submitted. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [DatabaseInstance]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<DatabaseInstance> create( + DatabaseInstance request, + core.String parent, { + core.String databaseId, + core.bool validateOnly, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (databaseId != null) { + _queryParams['databaseId'] = [databaseId]; + } + if (validateOnly != null) { + _queryParams['validateOnly'] = ['${validateOnly}']; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/instances'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => DatabaseInstance.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Marks a DatabaseInstance to be deleted. + /// + /// The DatabaseInstance will be purged within 30 days. The default database + /// cannot be deleted. IDs for deleted database instances may never be + /// recovered or re-used. The Database may only be deleted if it is already in + /// a DISABLED state. + /// + /// Request parameters: + /// + /// [name] - The fully qualified resource name of the database instance, in + /// the form: + /// `projects/{project-number}/locations/{location-id}/instances/{database-id}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [DatabaseInstance]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<DatabaseInstance> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => DatabaseInstance.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Disables a DatabaseInstance. + /// + /// The database can be re-enabled later using ReenableDatabaseInstance. When + /// a database is disabled, all reads and writes are denied, including view + /// access in the Firebase console. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The fully qualified resource name of the database instance, in + /// the form: + /// `projects/{project-number}/locations/{location-id}/instances/{database-id}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [DatabaseInstance]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<DatabaseInstance> disable( + DisableDatabaseInstanceRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name') + ':disable'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => DatabaseInstance.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the DatabaseInstance identified by the specified resource name. + /// + /// Request parameters: + /// + /// [name] - The fully qualified resource name of the database instance, in + /// the form: + /// `projects/{project-number}/locations/{location-id}/instances/{database-id}`. + /// `database-id` is a globally unique identifier across all parent + /// collections. For convenience, this method allows you to supply `-` as a + /// wildcard character in place of specific collections under `projects` and + /// `locations`. The resulting wildcarding form of the method is: + /// `projects/-/locations/-/instances/{database-id}`. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [DatabaseInstance]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<DatabaseInstance> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => DatabaseInstance.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists each DatabaseInstance associated with the specified parent project. + /// + /// The list items are returned in no particular order, but will be a + /// consistent view of the database instances when additional requests are + /// made with a `pageToken`. The resulting list contains instances in any + /// STATE. The list results may be stale by a few seconds. Use + /// GetDatabaseInstance for consistent reads. + /// + /// Request parameters: + /// + /// [parent] - The parent project for which to list database instances, in the + /// form: `projects/{project-number}/locations/{location-id}` To list across + /// all locations, use a parent in the form: + /// `projects/{project-number}/locations/-` + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of database instances to return in the + /// response. The server may return fewer than this at its discretion. If no + /// value is specified (or too large a value is specified), then the server + /// will impose its own limit. + /// + /// [pageToken] - Token returned from a previous call to + /// `ListDatabaseInstances` indicating where in the set of database instances + /// to resume listing. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListDatabaseInstancesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListDatabaseInstancesResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/instances'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListDatabaseInstancesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Enables a DatabaseInstance. + /// + /// The database must have been disabled previously using + /// DisableDatabaseInstance. The state of a successfully reenabled + /// DatabaseInstance is ACTIVE. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The fully qualified resource name of the database instance, in + /// the form: + /// `projects/{project-number}/locations/{location-id}/instances/{database-id}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [DatabaseInstance]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<DatabaseInstance> reenable( + ReenableDatabaseInstanceRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':reenable'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => DatabaseInstance.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Representation of a Realtime Database instance. +/// +/// Details on interacting with contents of a DatabaseInstance can be found at: +/// https://firebase.google.com/docs/database/rest/start. +class DatabaseInstance { + /// The globally unique hostname of the database. + /// + /// Immutable. + core.String databaseUrl; + + /// The fully qualified resource name of the database instance, in the form: + /// `projects/{project-number}/locations/{location-id}/instances/{database-id}`. + /// + /// Currently the only supported location is 'us-central1'. + core.String name; + + /// The resource name of the project this instance belongs to. + /// + /// For example: `projects/{project-number}`. + core.String project; + + /// The database's lifecycle state. + /// + /// Read-only. + /// Possible string values are: + /// - "LIFECYCLE_STATE_UNSPECIFIED" : Unspecified state, likely the result of + /// an error on the backend. This is only used for distinguishing unset + /// values. + /// - "ACTIVE" : The normal and active state. + /// - "DISABLED" : The database is in a disabled state. It can be re-enabled + /// later. + /// - "DELETED" : The database is in a deleted state. + core.String state; + + /// The database instance type. + /// + /// On creation only USER_DATABASE is allowed, which is also the default when + /// omitted. + /// Possible string values are: + /// - "DATABASE_INSTANCE_TYPE_UNSPECIFIED" : Unknown state, likely the result + /// of an error on the backend. This is only used for distinguishing unset + /// values. + /// - "DEFAULT_DATABASE" : The default database that is provisioned when a + /// project is created. + /// - "USER_DATABASE" : A database that the user created. + core.String type; + + DatabaseInstance(); + + DatabaseInstance.fromJson(core.Map _json) { + if (_json.containsKey('databaseUrl')) { + databaseUrl = _json['databaseUrl'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('project')) { + project = _json['project'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (databaseUrl != null) { + _json['databaseUrl'] = databaseUrl; + } + if (name != null) { + _json['name'] = name; + } + if (project != null) { + _json['project'] = project; + } + if (state != null) { + _json['state'] = state; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// The request sent to the DisableDatabaseInstance method. +class DisableDatabaseInstanceRequest { + DisableDatabaseInstanceRequest(); + + DisableDatabaseInstanceRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The response from the ListDatabaseInstances method. +class ListDatabaseInstancesResponse { + /// List of each DatabaseInstance that is in the parent Firebase project. + core.List<DatabaseInstance> instances; + + /// If the result list is too large to fit in a single response, then a token + /// is returned. + /// + /// If the string is empty, then this response is the last page of results. + /// This token can be used in a subsequent call to `ListDatabaseInstances` to + /// find the next group of database instances. Page tokens are short-lived and + /// should not be persisted. + core.String nextPageToken; + + ListDatabaseInstancesResponse(); + + ListDatabaseInstancesResponse.fromJson(core.Map _json) { + if (_json.containsKey('instances')) { + instances = (_json['instances'] as core.List) + .map<DatabaseInstance>((value) => DatabaseInstance.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (instances != null) { + _json['instances'] = instances.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// The request sent to the ReenableDatabaseInstance method. +class ReenableDatabaseInstanceRequest { + ReenableDatabaseInstanceRequest(); + + ReenableDatabaseInstanceRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/firebasehosting/v1beta1.dart b/generated/googleapis_beta/lib/firebasehosting/v1beta1.dart deleted file mode 100644 index 062dcb5..0000000 --- a/generated/googleapis_beta/lib/firebasehosting/v1beta1.dart +++ /dev/null
@@ -1,5015 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Firebase Hosting API - v1beta1 -/// -/// The Firebase Hosting REST API enables programmatic and customizable -/// deployments to your Firebase-hosted sites. Use this REST API to deploy new -/// or updated hosting configurations and content files. -/// -/// For more information, see <https://firebase.google.com/docs/hosting/> -/// -/// Create an instance of [FirebaseHostingApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsOperationsResource] -/// - [ProjectsSitesResource] -/// - [ProjectsSitesChannelsResource] -/// - [ProjectsSitesChannelsReleasesResource] -/// - [ProjectsSitesDomainsResource] -/// - [ProjectsSitesReleasesResource] -/// - [ProjectsSitesVersionsResource] -/// - [ProjectsSitesVersionsFilesResource] -/// - [SitesResource] -/// - [SitesChannelsResource] -/// - [SitesChannelsReleasesResource] -/// - [SitesDomainsResource] -/// - [SitesReleasesResource] -/// - [SitesVersionsResource] -/// - [SitesVersionsFilesResource] -library firebasehosting.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// The Firebase Hosting REST API enables programmatic and customizable -/// deployments to your Firebase-hosted sites. -/// -/// Use this REST API to deploy new or updated hosting configurations and -/// content files. -class FirebaseHostingApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - /// View and administer all your Firebase data and settings - static const firebaseScope = 'https://www.googleapis.com/auth/firebase'; - - /// View all your Firebase data and settings - static const firebaseReadonlyScope = - 'https://www.googleapis.com/auth/firebase.readonly'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - SitesResource get sites => SitesResource(_requester); - - FirebaseHostingApi(http.Client client, - {core.String rootUrl = 'https://firebasehosting.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsOperationsResource get operations => - ProjectsOperationsResource(_requester); - ProjectsSitesResource get sites => ProjectsSitesResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesResource { - final commons.ApiRequester _requester; - - ProjectsSitesChannelsResource get channels => - ProjectsSitesChannelsResource(_requester); - ProjectsSitesDomainsResource get domains => - ProjectsSitesDomainsResource(_requester); - ProjectsSitesReleasesResource get releases => - ProjectsSitesReleasesResource(_requester); - ProjectsSitesVersionsResource get versions => - ProjectsSitesVersionsResource(_requester); - - ProjectsSitesResource(commons.ApiRequester client) : _requester = client; - - /// Gets the Hosting metadata for a specific site. - /// - /// Request parameters: - /// - /// [name] - Required. The site for which to get the SiteConfig, in the - /// format: sites/ site-name/config - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+/config$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SiteConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SiteConfig> getConfig( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SiteConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the Hosting metadata for a specific site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The site for which to update the SiteConfig, in the - /// format: sites/ site-name/config - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+/config$`. - /// - /// [updateMask] - A set of field names from your \[site - /// configuration\](../sites.SiteConfig) that you want to update. A field will - /// be overwritten if, and only if, it's in the mask. If a mask is not - /// provided then a default mask of only - /// \[`max_versions`\](../sites.SiteConfig.max_versions) will be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SiteConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SiteConfig> updateConfig( - SiteConfig request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SiteConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesChannelsResource { - final commons.ApiRequester _requester; - - ProjectsSitesChannelsReleasesResource get releases => - ProjectsSitesChannelsReleasesResource(_requester); - - ProjectsSitesChannelsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new channel in the specified site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site in which this channel should be created. - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [channelId] - Required. Immutable. A unique id within the site to identify - /// the channel. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> create( - Channel request, - core.String parent, { - core.String channelId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (channelId != null) { - _queryParams['channelId'] = [channelId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/channels'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a channel of a site. - /// - /// The `live` channel cannot be deleted. - /// - /// Request parameters: - /// - /// [name] - Required. The fully-qualified identifier for the site. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves information for the specified channel of a site. - /// - /// Request parameters: - /// - /// [name] - Required. The fully-qualified identifier for the channel. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the channels for the specified site. - /// - /// All sites have a default "live" channel. - /// - /// Request parameters: - /// - /// [parent] - Required. The site from which to list channels. - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of versions to return. The service may - /// return fewer than this value. If unspecified, at most 25 channels will be - /// returned. The maximum value is 100; valuupdateses above 100 will be - /// coerced to 100 - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListChannelsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListChannelsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/channels'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListChannelsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates information for the specified channel of a site. - /// - /// This method will implicitly create a channel if it doesn't exist. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The fully-qualified identifier of the Channel. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [updateMask] - A comma-separated list of fields to be updated in this - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> patch( - Channel request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesChannelsReleasesResource { - final commons.ApiRequester _requester; - - ProjectsSitesChannelsReleasesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new release which makes the content of the specified version - /// actively display on the appropriate URL(s). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site that the release belongs to, in the format: - /// sites/ site-name - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [versionName] - The unique identifier for a version, in the format: - /// /sites/site-name /versions/versionID The site-name in this version - /// identifier must match the site-name in the `parent` parameter. This query - /// parameter must be empty if the `type` field in the request body is - /// `SITE_DISABLE`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Release]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Release> create( - Release request, - core.String parent, { - core.String versionName, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (versionName != null) { - _queryParams['versionName'] = [versionName]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Release.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the releases that have been created on the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 100. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListReleasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListReleasesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListReleasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesDomainsResource { - final commons.ApiRequester _requester; - - ProjectsSitesDomainsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a domain mapping on the specified site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to create the domain association for, in - /// the format: sites/site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> create( - Domain request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/domains'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the existing domain mapping on the specified site. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain association to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a domain mapping on the specified site. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain configuration to get. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the domains for the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list domains, in the format: - /// sites/ site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 50. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListDomainsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListDomainsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/domains'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListDomainsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified domain mapping, creating the mapping as if it does - /// not exist. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain association to update or create, - /// if an association doesn't already exist. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> update( - Domain request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesReleasesResource { - final commons.ApiRequester _requester; - - ProjectsSitesReleasesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new release which makes the content of the specified version - /// actively display on the appropriate URL(s). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site that the release belongs to, in the format: - /// sites/ site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [versionName] - The unique identifier for a version, in the format: - /// /sites/site-name /versions/versionID The site-name in this version - /// identifier must match the site-name in the `parent` parameter. This query - /// parameter must be empty if the `type` field in the request body is - /// `SITE_DISABLE`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Release]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Release> create( - Release request, - core.String parent, { - core.String versionName, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (versionName != null) { - _queryParams['versionName'] = [versionName]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Release.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the releases that have been created on the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 100. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListReleasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListReleasesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListReleasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesVersionsResource { - final commons.ApiRequester _requester; - - ProjectsSitesVersionsFilesResource get files => - ProjectsSitesVersionsFilesResource(_requester); - - ProjectsSitesVersionsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new version on the target site using the content of the - /// specified version. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The target site where the cloned version will reside, - /// in the format: `sites/{site}` - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> clone( - CloneVersionRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions:clone'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a new version for a site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to create the version for, in the format: - /// sites/ site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [sizeBytes] - The self-reported size of the version. This value is used - /// for a pre-emptive quota check for legacy version uploads. - /// - /// [versionId] - A unique id for the new version. This is was only specified - /// for legacy version creations, and should be blank. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> create( - Version request, - core.String parent, { - core.String sizeBytes, - core.String versionId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (sizeBytes != null) { - _queryParams['sizeBytes'] = [sizeBytes]; - } - if (versionId != null) { - _queryParams['versionId'] = [versionId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified version. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the version to be deleted, in the format: - /// sites/ site-name/versions/versionID - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the versions that have been created on the specified site. - /// - /// Will include filtering in the future. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern `^projects/\[^/\]+/sites/\[^/\]+$`. - /// - /// [filter] - The filter string used to return a subset of versions in the - /// response. Currently supported fields for filtering are: name, status, and - /// create_time. Filter processing will be implemented in accordance with - /// go/filtering. - /// - /// [pageSize] - The maximum number of versions to return. The service may - /// return fewer than this value. If unspecified, at most 25 versions will be - /// returned. The maximum value is 100; values above 100 will be coerced to - /// 100 - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified metadata for a version. - /// - /// Note that this method will fail with `FAILED_PRECONDITION` in the event of - /// an invalid state transition. The only valid transition for a version is - /// currently from a `CREATED` status to a `FINALIZED` status. Use - /// \[`DeleteVersion`\](../sites.versions/delete) to set the status of a - /// version to `DELETED`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The unique identifier for a version, in the format: - /// sites/site-name /versions/versionID This name is provided in the response - /// body when you call the \[`CreateVersion`\](../sites.versions/create) - /// endpoint. - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [updateMask] - A set of field names from your - /// \[version\](../sites.versions) that you want to update. A field will be - /// overwritten if, and only if, it's in the mask. If a mask is not provided - /// then a default mask of only - /// \[`status`\](../sites.versions#Version.FIELDS.status) will be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> patch( - Version request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Adds content files to a version. - /// - /// Each file must be under 2 GB. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The version to add files to, in the format: - /// sites/site-name /versions/versionID - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PopulateVersionFilesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PopulateVersionFilesResponse> populateFiles( - PopulateVersionFilesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - ':populateFiles'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PopulateVersionFilesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsSitesVersionsFilesResource { - final commons.ApiRequester _requester; - - ProjectsSitesVersionsFilesResource(commons.ApiRequester client) - : _requester = client; - - /// Lists the remaining files to be uploaded for the specified version. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to list files for, in the format: - /// sites/site-name /versions/versionID - /// Value must have pattern - /// `^projects/\[^/\]+/sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 1000. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// This will be the encoded version of a - /// firebase.hosting.proto.metadata.ListFilesPageToken. - /// - /// [status] - The type of files in the version that should be listed. - /// Possible string values are: - /// - "STATUS_UNSPECIFIED" : The default status; should not be intentionally - /// used. - /// - "EXPECTED" : The file has been included in the version and is expected - /// to be uploaded in the near future. - /// - "ACTIVE" : The file has already been uploaded to Firebase Hosting. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionFilesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionFilesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String status, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (status != null) { - _queryParams['status'] = [status]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/files'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionFilesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesResource { - final commons.ApiRequester _requester; - - SitesChannelsResource get channels => SitesChannelsResource(_requester); - SitesDomainsResource get domains => SitesDomainsResource(_requester); - SitesReleasesResource get releases => SitesReleasesResource(_requester); - SitesVersionsResource get versions => SitesVersionsResource(_requester); - - SitesResource(commons.ApiRequester client) : _requester = client; - - /// Gets the Hosting metadata for a specific site. - /// - /// Request parameters: - /// - /// [name] - Required. The site for which to get the SiteConfig, in the - /// format: sites/ site-name/config - /// Value must have pattern `^sites/\[^/\]+/config$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SiteConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SiteConfig> getConfig( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SiteConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the Hosting metadata for a specific site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The site for which to update the SiteConfig, in the - /// format: sites/ site-name/config - /// Value must have pattern `^sites/\[^/\]+/config$`. - /// - /// [updateMask] - A set of field names from your \[site - /// configuration\](../sites.SiteConfig) that you want to update. A field will - /// be overwritten if, and only if, it's in the mask. If a mask is not - /// provided then a default mask of only - /// \[`max_versions`\](../sites.SiteConfig.max_versions) will be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SiteConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SiteConfig> updateConfig( - SiteConfig request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SiteConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesChannelsResource { - final commons.ApiRequester _requester; - - SitesChannelsReleasesResource get releases => - SitesChannelsReleasesResource(_requester); - - SitesChannelsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a new channel in the specified site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site in which this channel should be created. - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [channelId] - Required. Immutable. A unique id within the site to identify - /// the channel. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> create( - Channel request, - core.String parent, { - core.String channelId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (channelId != null) { - _queryParams['channelId'] = [channelId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/channels'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a channel of a site. - /// - /// The `live` channel cannot be deleted. - /// - /// Request parameters: - /// - /// [name] - Required. The fully-qualified identifier for the site. - /// Value must have pattern `^sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves information for the specified channel of a site. - /// - /// Request parameters: - /// - /// [name] - Required. The fully-qualified identifier for the channel. - /// Value must have pattern `^sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the channels for the specified site. - /// - /// All sites have a default "live" channel. - /// - /// Request parameters: - /// - /// [parent] - Required. The site from which to list channels. - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of versions to return. The service may - /// return fewer than this value. If unspecified, at most 25 channels will be - /// returned. The maximum value is 100; valuupdateses above 100 will be - /// coerced to 100 - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListChannelsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListChannelsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/channels'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListChannelsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates information for the specified channel of a site. - /// - /// This method will implicitly create a channel if it doesn't exist. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The fully-qualified identifier of the Channel. - /// Value must have pattern `^sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [updateMask] - A comma-separated list of fields to be updated in this - /// request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Channel]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Channel> patch( - Channel request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Channel.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesChannelsReleasesResource { - final commons.ApiRequester _requester; - - SitesChannelsReleasesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new release which makes the content of the specified version - /// actively display on the appropriate URL(s). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site that the release belongs to, in the format: - /// sites/ site-name - /// Value must have pattern `^sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [versionName] - The unique identifier for a version, in the format: - /// /sites/site-name /versions/versionID The site-name in this version - /// identifier must match the site-name in the `parent` parameter. This query - /// parameter must be empty if the `type` field in the request body is - /// `SITE_DISABLE`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Release]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Release> create( - Release request, - core.String parent, { - core.String versionName, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (versionName != null) { - _queryParams['versionName'] = [versionName]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Release.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the releases that have been created on the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern `^sites/\[^/\]+/channels/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 100. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListReleasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListReleasesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListReleasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesDomainsResource { - final commons.ApiRequester _requester; - - SitesDomainsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a domain mapping on the specified site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to create the domain association for, in - /// the format: sites/site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> create( - Domain request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/domains'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the existing domain mapping on the specified site. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain association to delete. - /// Value must have pattern `^sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a domain mapping on the specified site. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain configuration to get. - /// Value must have pattern `^sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the domains for the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list domains, in the format: - /// sites/ site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 50. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListDomainsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListDomainsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/domains'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListDomainsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified domain mapping, creating the mapping as if it does - /// not exist. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the domain association to update or create, - /// if an association doesn't already exist. - /// Value must have pattern `^sites/\[^/\]+/domains/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Domain]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Domain> update( - Domain request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Domain.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesReleasesResource { - final commons.ApiRequester _requester; - - SitesReleasesResource(commons.ApiRequester client) : _requester = client; - - /// Creates a new release which makes the content of the specified version - /// actively display on the appropriate URL(s). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The site that the release belongs to, in the format: - /// sites/ site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [versionName] - The unique identifier for a version, in the format: - /// /sites/site-name /versions/versionID The site-name in this version - /// identifier must match the site-name in the `parent` parameter. This query - /// parameter must be empty if the `type` field in the request body is - /// `SITE_DISABLE`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Release]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Release> create( - Release request, - core.String parent, { - core.String versionName, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (versionName != null) { - _queryParams['versionName'] = [versionName]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Release.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the releases that have been created on the specified site. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 100. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListReleasesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListReleasesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/releases'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListReleasesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesVersionsResource { - final commons.ApiRequester _requester; - - SitesVersionsFilesResource get files => - SitesVersionsFilesResource(_requester); - - SitesVersionsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a new version on the target site using the content of the - /// specified version. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The target site where the cloned version will reside, - /// in the format: `sites/{site}` - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> clone( - CloneVersionRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions:clone'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a new version for a site. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to create the version for, in the format: - /// sites/ site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [sizeBytes] - The self-reported size of the version. This value is used - /// for a pre-emptive quota check for legacy version uploads. - /// - /// [versionId] - A unique id for the new version. This is was only specified - /// for legacy version creations, and should be blank. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> create( - Version request, - core.String parent, { - core.String sizeBytes, - core.String versionId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (sizeBytes != null) { - _queryParams['sizeBytes'] = [sizeBytes]; - } - if (versionId != null) { - _queryParams['versionId'] = [versionId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the specified version. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the version to be deleted, in the format: - /// sites/ site-name/versions/versionID - /// Value must have pattern `^sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the versions that have been created on the specified site. - /// - /// Will include filtering in the future. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent for which to list files, in the format: - /// sites/site-name - /// Value must have pattern `^sites/\[^/\]+$`. - /// - /// [filter] - The filter string used to return a subset of versions in the - /// response. Currently supported fields for filtering are: name, status, and - /// create_time. Filter processing will be implemented in accordance with - /// go/filtering. - /// - /// [pageSize] - The maximum number of versions to return. The service may - /// return fewer than this value. If unspecified, at most 25 versions will be - /// returned. The maximum value is 100; values above 100 will be coerced to - /// 100 - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/versions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the specified metadata for a version. - /// - /// Note that this method will fail with `FAILED_PRECONDITION` in the event of - /// an invalid state transition. The only valid transition for a version is - /// currently from a `CREATED` status to a `FINALIZED` status. Use - /// \[`DeleteVersion`\](../sites.versions/delete) to set the status of a - /// version to `DELETED`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The unique identifier for a version, in the format: - /// sites/site-name /versions/versionID This name is provided in the response - /// body when you call the \[`CreateVersion`\](../sites.versions/create) - /// endpoint. - /// Value must have pattern `^sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [updateMask] - A set of field names from your - /// \[version\](../sites.versions) that you want to update. A field will be - /// overwritten if, and only if, it's in the mask. If a mask is not provided - /// then a default mask of only - /// \[`status`\](../sites.versions#Version.FIELDS.status) will be used. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Version]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Version> patch( - Version request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Version.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Adds content files to a version. - /// - /// Each file must be under 2 GB. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The version to add files to, in the format: - /// sites/site-name /versions/versionID - /// Value must have pattern `^sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PopulateVersionFilesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PopulateVersionFilesResponse> populateFiles( - PopulateVersionFilesRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - ':populateFiles'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PopulateVersionFilesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class SitesVersionsFilesResource { - final commons.ApiRequester _requester; - - SitesVersionsFilesResource(commons.ApiRequester client) : _requester = client; - - /// Lists the remaining files to be uploaded for the specified version. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent to list files for, in the format: - /// sites/site-name /versions/versionID - /// Value must have pattern `^sites/\[^/\]+/versions/\[^/\]+$`. - /// - /// [pageSize] - The page size to return. Defaults to 1000. - /// - /// [pageToken] - The next_page_token from a previous request, if provided. - /// This will be the encoded version of a - /// firebase.hosting.proto.metadata.ListFilesPageToken. - /// - /// [status] - The type of files in the version that should be listed. - /// Possible string values are: - /// - "STATUS_UNSPECIFIED" : The default status; should not be intentionally - /// used. - /// - "EXPECTED" : The file has been included in the version and is expected - /// to be uploaded in the near future. - /// - "ACTIVE" : The file has already been uploaded to Firebase Hosting. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVersionFilesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVersionFilesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String status, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (status != null) { - _queryParams['status'] = [status]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/files'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVersionFilesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Contains metadata about the user who performed an action, such as creating a -/// release or finalizing a version. -class ActingUser { - /// The email address of the user when the user performed the action. - core.String email; - - /// A profile image URL for the user. - /// - /// May not be present if the user has changed their email address or deleted - /// their account. - core.String imageUrl; - - ActingUser(); - - ActingUser.fromJson(core.Map _json) { - if (_json.containsKey('email')) { - email = _json['email'] as core.String; - } - if (_json.containsKey('imageUrl')) { - imageUrl = _json['imageUrl'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (email != null) { - _json['email'] = email; - } - if (imageUrl != null) { - _json['imageUrl'] = imageUrl; - } - return _json; - } -} - -/// Represents a DNS certificate challenge. -class CertDnsChallenge { - /// The domain name upon which the DNS challenge must be satisfied. - core.String domainName; - - /// The value that must be present as a TXT record on the domain name to - /// satisfy the challenge. - core.String token; - - CertDnsChallenge(); - - CertDnsChallenge.fromJson(core.Map _json) { - if (_json.containsKey('domainName')) { - domainName = _json['domainName'] as core.String; - } - if (_json.containsKey('token')) { - token = _json['token'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domainName != null) { - _json['domainName'] = domainName; - } - if (token != null) { - _json['token'] = token; - } - return _json; - } -} - -/// Represents an HTTP certificate challenge. -class CertHttpChallenge { - /// The URL path on which to serve the specified token to satisfy the - /// certificate challenge. - core.String path; - - /// The token to serve at the specified URL path to satisfy the certificate - /// challenge. - core.String token; - - CertHttpChallenge(); - - CertHttpChallenge.fromJson(core.Map _json) { - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('token')) { - token = _json['token'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (path != null) { - _json['path'] = path; - } - if (token != null) { - _json['token'] = token; - } - return _json; - } -} - -/// A `Channel` represents a stream of releases for a site. -/// -/// All sites have a default `live` channel that serves content to the live -/// Firebase-provided domains and any connected custom domains. -class Channel { - /// The time at which the channel was created. - /// - /// Output only. - core.String createTime; - - /// The time at which the channel will be automatically deleted. - /// - /// If null, the channel will not be automatically deleted. This field is - /// present in output whether set directly or via the `ttl` field. - core.String expireTime; - - /// Text labels used for extra metadata and/or filtering. - core.Map<core.String, core.String> labels; - - /// The fully-qualified identifier of the Channel. - core.String name; - - /// The current release for the channel, if any. - /// - /// Output only. - Release release; - - /// The number of previous releases to retain on the channel for rollback or - /// other purposes. - /// - /// Must be a number between 1-100. Defaults to 10 for new channels. - core.int retainedReleaseCount; - - /// Input only. - /// - /// A time-to-live for this channel. Sets `expire_time` to the provided - /// duration past the time of the request. - core.String ttl; - - /// The time at which the channel was last updated. - /// - /// Output only. - core.String updateTime; - - /// The URL at which the channel can be viewed. - /// - /// For the `live` channel, the content of the current release may also be - /// visible at other URLs. - /// - /// Output only. - core.String url; - - Channel(); - - Channel.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('expireTime')) { - expireTime = _json['expireTime'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('release')) { - release = Release.fromJson( - _json['release'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('retainedReleaseCount')) { - retainedReleaseCount = _json['retainedReleaseCount'] as core.int; - } - if (_json.containsKey('ttl')) { - ttl = _json['ttl'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - if (_json.containsKey('url')) { - url = _json['url'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (expireTime != null) { - _json['expireTime'] = expireTime; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (release != null) { - _json['release'] = release.toJson(); - } - if (retainedReleaseCount != null) { - _json['retainedReleaseCount'] = retainedReleaseCount; - } - if (ttl != null) { - _json['ttl'] = ttl; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - if (url != null) { - _json['url'] = url; - } - return _json; - } -} - -/// The request sent to CloneVersion. -class CloneVersionRequest { - /// If provided, only paths that do not match any of the regexes in this list - /// will be included in the new version. - PathFilter exclude; - - /// If true, immediately finalize the version after cloning is complete. - core.bool finalize; - - /// If provided, only paths that match one or more regexes in this list will - /// be included in the new version. - PathFilter include; - - /// The name of the version to be cloned, in the format: - /// `sites/{site}/versions/{version}` - /// - /// Required. - core.String sourceVersion; - - CloneVersionRequest(); - - CloneVersionRequest.fromJson(core.Map _json) { - if (_json.containsKey('exclude')) { - exclude = PathFilter.fromJson( - _json['exclude'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('finalize')) { - finalize = _json['finalize'] as core.bool; - } - if (_json.containsKey('include')) { - include = PathFilter.fromJson( - _json['include'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('sourceVersion')) { - sourceVersion = _json['sourceVersion'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exclude != null) { - _json['exclude'] = exclude.toJson(); - } - if (finalize != null) { - _json['finalize'] = finalize; - } - if (include != null) { - _json['include'] = include.toJson(); - } - if (sourceVersion != null) { - _json['sourceVersion'] = sourceVersion; - } - return _json; - } -} - -/// A configured rewrite that directs requests to a Cloud Run service. -/// -/// If the Cloud Run service does not exist when setting or updating your -/// Firebase Hosting configuration, then the request fails. Any errors from the -/// Cloud Run service are passed to the end user (for example, if you delete a -/// service, any requests directed to that service receive a `404` error). -class CloudRunRewrite { - /// User-provided region where the Cloud Run service is hosted. - /// - /// Defaults to `us-central1` if not supplied. - /// - /// Optional. - core.String region; - - /// User-defined ID of the Cloud Run service. - /// - /// Required. - core.String serviceId; - - CloudRunRewrite(); - - CloudRunRewrite.fromJson(core.Map _json) { - if (_json.containsKey('region')) { - region = _json['region'] as core.String; - } - if (_json.containsKey('serviceId')) { - serviceId = _json['serviceId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (region != null) { - _json['region'] = region; - } - if (serviceId != null) { - _json['serviceId'] = serviceId; - } - return _json; - } -} - -/// The intended behavior and status information of a domain. -class Domain { - /// The domain name of the association. - /// - /// Required. - core.String domainName; - - /// If set, the domain should redirect with the provided parameters. - DomainRedirect domainRedirect; - - /// Information about the provisioning of certificates and the health of the - /// DNS resolution for the domain. - /// - /// Output only. - DomainProvisioning provisioning; - - /// The site name of the association. - /// - /// Required. - core.String site; - - /// Additional status of the domain association. - /// - /// Output only. - /// Possible string values are: - /// - "DOMAIN_STATUS_UNSPECIFIED" : Unspecified domain association status. - /// - "DOMAIN_CHANGE_PENDING" : An external operation is in progress on the - /// domain association and no further operations can be performed until it is - /// complete. Formerly used for metabase updates. Not currently used - /// - "DOMAIN_ACTIVE" : The domain association is active and no additional - /// action is required. - /// - "DOMAIN_VERIFICATION_REQUIRED" : The domain was previously verified in - /// the legacy system. User must reverify the domain through the ownership - /// service. - /// - "DOMAIN_VERIFICATION_LOST" : The domain verification has been lost and - /// the domain is in the grace period before being removed from the Firebase - /// Hosting site. - core.String status; - - /// The time at which the domain was last updated. - /// - /// Output only. - core.String updateTime; - - Domain(); - - Domain.fromJson(core.Map _json) { - if (_json.containsKey('domainName')) { - domainName = _json['domainName'] as core.String; - } - if (_json.containsKey('domainRedirect')) { - domainRedirect = DomainRedirect.fromJson( - _json['domainRedirect'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('provisioning')) { - provisioning = DomainProvisioning.fromJson( - _json['provisioning'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('site')) { - site = _json['site'] as core.String; - } - if (_json.containsKey('status')) { - status = _json['status'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domainName != null) { - _json['domainName'] = domainName; - } - if (domainRedirect != null) { - _json['domainRedirect'] = domainRedirect.toJson(); - } - if (provisioning != null) { - _json['provisioning'] = provisioning.toJson(); - } - if (site != null) { - _json['site'] = site; - } - if (status != null) { - _json['status'] = status; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// The current certificate provisioning status information for a domain. -class DomainProvisioning { - /// The TXT records (for the certificate challenge) that were found at the - /// last DNS fetch. - core.List<core.String> certChallengeDiscoveredTxt; - - /// The DNS challenge for generating a certificate. - CertDnsChallenge certChallengeDns; - - /// The HTTP challenge for generating a certificate. - CertHttpChallenge certChallengeHttp; - - /// The certificate provisioning status; updated when Firebase Hosting - /// provisions an SSL certificate for the domain. - /// Possible string values are: - /// - "CERT_STATUS_UNSPECIFIED" : Unspecified certificate provisioning status. - /// - "CERT_PENDING" : Waiting for certificate challenge to be created. - /// - "CERT_MISSING" : Waiting for certificate challenge to be met. - /// - "CERT_PROCESSING" : Certificate challenge met; attempting to - /// acquire/propagate certificate. - /// - "CERT_PROPAGATING" : Certificate obtained; propagating to the CDN. - /// - "CERT_ACTIVE" : Certificate provisioned and deployed across the CDN. - /// - "CERT_ERROR" : Certificate provisioning failed in a non-recoverable - /// manner. - core.String certStatus; - - /// The IPs found at the last DNS fetch. - core.List<core.String> discoveredIps; - - /// The time at which the last DNS fetch occurred. - core.String dnsFetchTime; - - /// The DNS record match status as of the last DNS fetch. - /// Possible string values are: - /// - "DNS_STATUS_UNSPECIFIED" : Unspecified DNS status. - /// - "DNS_PENDING" : No DNS records have been specified for this domain yet. - /// - "DNS_MISSING" : None of the required DNS records have been detected on - /// the domain. - /// - "DNS_PARTIAL_MATCH" : Some of the required DNS records were detected, - /// but not all of them. No extra (non-required) DNS records were detected. - /// - "DNS_MATCH" : All required DNS records were detected. No extra - /// (non-required) DNS records were detected. - /// - "DNS_EXTRANEOUS_MATCH" : The domain has at least one of the required DNS - /// records, and it has at least one extra (non-required) DNS record. - core.String dnsStatus; - - /// The list of IPs to which the domain is expected to resolve. - core.List<core.String> expectedIps; - - DomainProvisioning(); - - DomainProvisioning.fromJson(core.Map _json) { - if (_json.containsKey('certChallengeDiscoveredTxt')) { - certChallengeDiscoveredTxt = - (_json['certChallengeDiscoveredTxt'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('certChallengeDns')) { - certChallengeDns = CertDnsChallenge.fromJson( - _json['certChallengeDns'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('certChallengeHttp')) { - certChallengeHttp = CertHttpChallenge.fromJson( - _json['certChallengeHttp'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('certStatus')) { - certStatus = _json['certStatus'] as core.String; - } - if (_json.containsKey('discoveredIps')) { - discoveredIps = (_json['discoveredIps'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('dnsFetchTime')) { - dnsFetchTime = _json['dnsFetchTime'] as core.String; - } - if (_json.containsKey('dnsStatus')) { - dnsStatus = _json['dnsStatus'] as core.String; - } - if (_json.containsKey('expectedIps')) { - expectedIps = (_json['expectedIps'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (certChallengeDiscoveredTxt != null) { - _json['certChallengeDiscoveredTxt'] = certChallengeDiscoveredTxt; - } - if (certChallengeDns != null) { - _json['certChallengeDns'] = certChallengeDns.toJson(); - } - if (certChallengeHttp != null) { - _json['certChallengeHttp'] = certChallengeHttp.toJson(); - } - if (certStatus != null) { - _json['certStatus'] = certStatus; - } - if (discoveredIps != null) { - _json['discoveredIps'] = discoveredIps; - } - if (dnsFetchTime != null) { - _json['dnsFetchTime'] = dnsFetchTime; - } - if (dnsStatus != null) { - _json['dnsStatus'] = dnsStatus; - } - if (expectedIps != null) { - _json['expectedIps'] = expectedIps; - } - return _json; - } -} - -/// Defines the behavior of a domain-level redirect. -/// -/// Domain redirects preserve the path of the redirect but replace the requested -/// domain with the one specified in the redirect configuration. -class DomainRedirect { - /// The domain name to redirect to. - /// - /// Required. - core.String domainName; - - /// The redirect status code. - /// - /// Required. - /// Possible string values are: - /// - "REDIRECT_TYPE_UNSPECIFIED" : The default redirect type; should not be - /// intentionlly used. - /// - "MOVED_PERMANENTLY" : The redirect will respond with an HTTP status code - /// of `301 Moved Permanently`. - core.String type; - - DomainRedirect(); - - DomainRedirect.fromJson(core.Map _json) { - if (_json.containsKey('domainName')) { - domainName = _json['domainName'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domainName != null) { - _json['domainName'] = domainName; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A \[`header`\](/docs/hosting/full-config#headers) is an object that -/// specifies a URL pattern that, if matched to the request URL path, triggers -/// Hosting to apply the specified custom response headers. -class Header { - /// The user-supplied - /// \[glob\](/docs/hosting/full-config#glob_pattern_matching) to match against - /// the request URL path. - core.String glob; - - /// The additional headers to add to the response. - /// - /// Required. - core.Map<core.String, core.String> headers; - - /// The user-supplied RE2 regular expression to match against the request URL - /// path. - core.String regex; - - Header(); - - Header.fromJson(core.Map _json) { - if (_json.containsKey('glob')) { - glob = _json['glob'] as core.String; - } - if (_json.containsKey('headers')) { - headers = - (_json['headers'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('regex')) { - regex = _json['regex'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (glob != null) { - _json['glob'] = glob; - } - if (headers != null) { - _json['headers'] = headers; - } - if (regex != null) { - _json['regex'] = regex; - } - return _json; - } -} - -/// If provided, i18n rewrites are enabled. -class I18nConfig { - /// The user-supplied path where country and language specific content will be - /// looked for within the public directory. - /// - /// Required. - core.String root; - - I18nConfig(); - - I18nConfig.fromJson(core.Map _json) { - if (_json.containsKey('root')) { - root = _json['root'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (root != null) { - _json['root'] = root; - } - return _json; - } -} - -/// The response returned by ListChannels. -class ListChannelsResponse { - /// The list of channels. - core.List<Channel> channels; - - /// If there are additional releases remaining beyond the ones in this - /// response, then supply this token in the next - /// \[`list`\](../sites.channels/list) call to continue with the next set of - /// releases. - core.String nextPageToken; - - ListChannelsResponse(); - - ListChannelsResponse.fromJson(core.Map _json) { - if (_json.containsKey('channels')) { - channels = (_json['channels'] as core.List) - .map<Channel>((value) => - Channel.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (channels != null) { - _json['channels'] = channels.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response to listing Domains. -class ListDomainsResponse { - /// The list of domains, if any exist. - core.List<Domain> domains; - - /// The pagination token, if more results exist. - core.String nextPageToken; - - ListDomainsResponse(); - - ListDomainsResponse.fromJson(core.Map _json) { - if (_json.containsKey('domains')) { - domains = (_json['domains'] as core.List) - .map<Domain>((value) => - Domain.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (domains != null) { - _json['domains'] = domains.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -class ListReleasesResponse { - /// If there are additional releases remaining beyond the ones in this - /// response, then supply this token in the next - /// \[`list`\](../sites.versions.files/list) call to continue with the next - /// set of releases. - core.String nextPageToken; - - /// The list of hashes of files that still need to be uploaded, if any exist. - core.List<Release> releases; - - ListReleasesResponse(); - - ListReleasesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('releases')) { - releases = (_json['releases'] as core.List) - .map<Release>((value) => - Release.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (releases != null) { - _json['releases'] = releases.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -class ListVersionFilesResponse { - /// The list path/hashes in the specified version. - core.List<VersionFile> files; - - /// The pagination token, if more results exist. - core.String nextPageToken; - - ListVersionFilesResponse(); - - ListVersionFilesResponse.fromJson(core.Map _json) { - if (_json.containsKey('files')) { - files = (_json['files'] as core.List) - .map<VersionFile>((value) => VersionFile.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (files != null) { - _json['files'] = files.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -class ListVersionsResponse { - /// The pagination token, if more results exist - core.String nextPageToken; - - /// The list of versions, if any exist. - core.List<Version> versions; - - ListVersionsResponse(); - - ListVersionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('versions')) { - versions = (_json['versions'] as core.List) - .map<Version>((value) => - Version.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (versions != null) { - _json['versions'] = versions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// A representation of filter path. -class PathFilter { - /// An array of regexes to filter by. - core.List<core.String> regexes; - - PathFilter(); - - PathFilter.fromJson(core.Map _json) { - if (_json.containsKey('regexes')) { - regexes = (_json['regexes'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (regexes != null) { - _json['regexes'] = regexes; - } - return _json; - } -} - -/// The request to populate a Version's Files. -class PopulateVersionFilesRequest { - /// A set of file paths to the hashes corresponding to assets that should be - /// added to the version. - /// - /// Note that a file path to an empty hash will remove the path from the - /// version. Calculate a hash by Gzipping the file then taking the SHA256 hash - /// of the newly compressed file. - core.Map<core.String, core.String> files; - - PopulateVersionFilesRequest(); - - PopulateVersionFilesRequest.fromJson(core.Map _json) { - if (_json.containsKey('files')) { - files = (_json['files'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (files != null) { - _json['files'] = files; - } - return _json; - } -} - -class PopulateVersionFilesResponse { - /// The content hashes of the specified files that need to be uploaded to the - /// specified endpoint. - core.List<core.String> uploadRequiredHashes; - - /// The URL to which the files should be uploaded, in the format: - /// "https://upload-firebasehosting.googleapis.com/upload/sites/site-name - /// /versions/versionID/files". - /// - /// Perform a multipart `POST` of the Gzipped file contents to the URL using a - /// forward slash and the hash of the file appended to the end. - core.String uploadUrl; - - PopulateVersionFilesResponse(); - - PopulateVersionFilesResponse.fromJson(core.Map _json) { - if (_json.containsKey('uploadRequiredHashes')) { - uploadRequiredHashes = (_json['uploadRequiredHashes'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('uploadUrl')) { - uploadUrl = _json['uploadUrl'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (uploadRequiredHashes != null) { - _json['uploadRequiredHashes'] = uploadRequiredHashes; - } - if (uploadUrl != null) { - _json['uploadUrl'] = uploadUrl; - } - return _json; - } -} - -/// Version preview configuration. -/// -/// If active and unexpired, this version will be accessible via a custom URL -/// even if it is not the currently released version. -class PreviewConfig { - /// If true, preview URLs are enabled for this version. - core.bool active; - - /// Indicates the expiration time for previewing this version; preview URL - /// requests received after this time will 404. - core.String expireTime; - - PreviewConfig(); - - PreviewConfig.fromJson(core.Map _json) { - if (_json.containsKey('active')) { - active = _json['active'] as core.bool; - } - if (_json.containsKey('expireTime')) { - expireTime = _json['expireTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (active != null) { - _json['active'] = active; - } - if (expireTime != null) { - _json['expireTime'] = expireTime; - } - return _json; - } -} - -/// A \[`redirect`\](/docs/hosting/full-config#redirects) object specifies a URL -/// pattern that, if matched to the request URL path, triggers Hosting to -/// respond with a redirect to the specified destination path. -class Redirect { - /// The user-supplied - /// \[glob\](/docs/hosting/full-config#glob_pattern_matching) to match against - /// the request URL path. - core.String glob; - - /// The value to put in the HTTP location header of the response. - /// - /// The location can contain capture group values from the pattern using a `:` - /// prefix to identify the segment and an optional `*` to capture the rest of - /// the URL. For example: "glob": "/:capture*", "statusCode": 301, "location": - /// "https://example.com/foo/:capture" - /// - /// Required. - core.String location; - - /// The user-supplied RE2 regular expression to match against the request URL - /// path. - core.String regex; - - /// The status HTTP code to return in the response. - /// - /// It must be a valid 3xx status code. - /// - /// Required. - core.int statusCode; - - Redirect(); - - Redirect.fromJson(core.Map _json) { - if (_json.containsKey('glob')) { - glob = _json['glob'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('regex')) { - regex = _json['regex'] as core.String; - } - if (_json.containsKey('statusCode')) { - statusCode = _json['statusCode'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (glob != null) { - _json['glob'] = glob; - } - if (location != null) { - _json['location'] = location; - } - if (regex != null) { - _json['regex'] = regex; - } - if (statusCode != null) { - _json['statusCode'] = statusCode; - } - return _json; - } -} - -/// A `Release` is a particular \[collection of configurations and -/// files\](sites.versions) that is set to be public at a particular time. -class Release { - /// The deploy description when the release was created. - /// - /// The value can be up to 512 characters. - core.String message; - - /// The unique identifier for the release, in the format: sites/ - /// site-name/releases/releaseID This name is provided in the response body - /// when you call the \[`CreateRelease`\](sites.releases/create) endpoint. - /// - /// Output only. - core.String name; - - /// The time at which the version is set to be public. - /// - /// Output only. - core.String releaseTime; - - /// Identifies the user who created the release. - /// - /// Output only. - ActingUser releaseUser; - - /// Explains the reason for the release. - /// - /// Specify a value for this field only when creating a `SITE_DISABLE` type - /// release. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : An unspecified type. Indicates that a version was - /// released. This is the default value when no other `type` is explicitly - /// specified. - /// - "DEPLOY" : A version was uploaded to Firebase Hosting and released. - /// - "ROLLBACK" : The release points back to a previously deployed version. - /// - "SITE_DISABLE" : The release prevents the site from serving content. - /// Firebase Hosting acts as if the site never existed. - core.String type; - - /// The configuration and content that was released. - /// - /// Output only. - Version version; - - Release(); - - Release.fromJson(core.Map _json) { - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('releaseTime')) { - releaseTime = _json['releaseTime'] as core.String; - } - if (_json.containsKey('releaseUser')) { - releaseUser = ActingUser.fromJson( - _json['releaseUser'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - if (_json.containsKey('version')) { - version = Version.fromJson( - _json['version'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (message != null) { - _json['message'] = message; - } - if (name != null) { - _json['name'] = name; - } - if (releaseTime != null) { - _json['releaseTime'] = releaseTime; - } - if (releaseUser != null) { - _json['releaseUser'] = releaseUser.toJson(); - } - if (type != null) { - _json['type'] = type; - } - if (version != null) { - _json['version'] = version.toJson(); - } - return _json; - } -} - -/// A \[`rewrite`\](/docs/hosting/full-config#rewrites) object specifies a URL -/// pattern that, if matched to the request URL path, triggers Hosting to -/// respond as if the service were given the specified destination URL. -class Rewrite { - /// The request will be forwarded to Firebase Dynamic Links. - core.bool dynamicLinks; - - /// The function to proxy requests to. - /// - /// Must match the exported function name exactly. - core.String function; - - /// The user-supplied - /// \[glob\](/docs/hosting/full-config#glob_pattern_matching) to match against - /// the request URL path. - core.String glob; - - /// The URL path to rewrite the request to. - core.String path; - - /// The user-supplied RE2 regular expression to match against the request URL - /// path. - core.String regex; - - /// The request will be forwarded to Cloud Run. - CloudRunRewrite run; - - Rewrite(); - - Rewrite.fromJson(core.Map _json) { - if (_json.containsKey('dynamicLinks')) { - dynamicLinks = _json['dynamicLinks'] as core.bool; - } - if (_json.containsKey('function')) { - function = _json['function'] as core.String; - } - if (_json.containsKey('glob')) { - glob = _json['glob'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('regex')) { - regex = _json['regex'] as core.String; - } - if (_json.containsKey('run')) { - run = CloudRunRewrite.fromJson( - _json['run'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (dynamicLinks != null) { - _json['dynamicLinks'] = dynamicLinks; - } - if (function != null) { - _json['function'] = function; - } - if (glob != null) { - _json['glob'] = glob; - } - if (path != null) { - _json['path'] = path; - } - if (regex != null) { - _json['regex'] = regex; - } - if (run != null) { - _json['run'] = run.toJson(); - } - return _json; - } -} - -/// The configuration for how incoming requests to a site should be routed and -/// processed before serving content. -/// -/// The URL request paths are matched against the specified URL patterns in the -/// configuration, then Hosting applies the applicable configuration according -/// to a specific \[priority -/// order\](/docs/hosting/full-config#hosting_priority_order). -class ServingConfig { - /// How to handle well known App Association files. - /// Possible string values are: - /// - "AUTO" : The app association files will be automatically created from - /// the apps that exist in the Firebase project. - /// - "NONE" : No special handling of the app association files will occur, - /// these paths will result in a 404 unless caught with a Rewrite. - core.String appAssociation; - - /// Defines whether to drop the file extension from uploaded files. - core.bool cleanUrls; - - /// An array of objects, where each object specifies a URL pattern that, if - /// matched to the request URL path, triggers Hosting to apply the specified - /// custom response headers. - core.List<Header> headers; - - /// Defines i18n rewrite behavior. - /// - /// Optional. - I18nConfig i18n; - - /// An array of objects (called redirect rules), where each rule specifies a - /// URL pattern that, if matched to the request URL path, triggers Hosting to - /// respond with a redirect to the specified destination path. - core.List<Redirect> redirects; - - /// An array of objects (called rewrite rules), where each rule specifies a - /// URL pattern that, if matched to the request URL path, triggers Hosting to - /// respond as if the service were given the specified destination URL. - core.List<Rewrite> rewrites; - - /// Defines how to handle a trailing slash in the URL path. - /// Possible string values are: - /// - "TRAILING_SLASH_BEHAVIOR_UNSPECIFIED" : No behavior is specified. Files - /// are served at their exact location only, and trailing slashes are only - /// added to directory indexes. - /// - "ADD" : Trailing slashes are _added_ to directory indexes as well as to - /// any URL path not ending in a file extension. - /// - "REMOVE" : Trailing slashes are _removed_ from directory indexes as well - /// as from any URL path not ending in a file extension. - core.String trailingSlashBehavior; - - ServingConfig(); - - ServingConfig.fromJson(core.Map _json) { - if (_json.containsKey('appAssociation')) { - appAssociation = _json['appAssociation'] as core.String; - } - if (_json.containsKey('cleanUrls')) { - cleanUrls = _json['cleanUrls'] as core.bool; - } - if (_json.containsKey('headers')) { - headers = (_json['headers'] as core.List) - .map<Header>((value) => - Header.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('i18n')) { - i18n = I18nConfig.fromJson( - _json['i18n'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('redirects')) { - redirects = (_json['redirects'] as core.List) - .map<Redirect>((value) => - Redirect.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('rewrites')) { - rewrites = (_json['rewrites'] as core.List) - .map<Rewrite>((value) => - Rewrite.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('trailingSlashBehavior')) { - trailingSlashBehavior = _json['trailingSlashBehavior'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (appAssociation != null) { - _json['appAssociation'] = appAssociation; - } - if (cleanUrls != null) { - _json['cleanUrls'] = cleanUrls; - } - if (headers != null) { - _json['headers'] = headers.map((value) => value.toJson()).toList(); - } - if (i18n != null) { - _json['i18n'] = i18n.toJson(); - } - if (redirects != null) { - _json['redirects'] = redirects.map((value) => value.toJson()).toList(); - } - if (rewrites != null) { - _json['rewrites'] = rewrites.map((value) => value.toJson()).toList(); - } - if (trailingSlashBehavior != null) { - _json['trailingSlashBehavior'] = trailingSlashBehavior; - } - return _json; - } -} - -/// A `SiteConfig` contains metadata associated with a specific site that -/// controls Firebase Hosting serving behavior -class SiteConfig { - /// Whether or not web requests made by site visitors are logged via Cloud - /// Logging. - core.bool cloudLoggingEnabled; - - /// The number of FINALIZED versions that will be held for a site before - /// automatic deletion. - /// - /// When a new version is deployed, content for versions in storage in excess - /// of this number will be deleted, and will no longer be billed for storage - /// usage. Oldest versions will be deleted first; sites are created with an - /// unlimited number of max_versions by default. - core.String maxVersions; - - SiteConfig(); - - SiteConfig.fromJson(core.Map _json) { - if (_json.containsKey('cloudLoggingEnabled')) { - cloudLoggingEnabled = _json['cloudLoggingEnabled'] as core.bool; - } - if (_json.containsKey('maxVersions')) { - maxVersions = _json['maxVersions'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudLoggingEnabled != null) { - _json['cloudLoggingEnabled'] = cloudLoggingEnabled; - } - if (maxVersions != null) { - _json['maxVersions'] = maxVersions; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// A `Version` is the collection of configuration and \[static -/// files\](sites.versions.files) that determine how a site is displayed. -class Version { - /// The configuration for the behavior of the site. - /// - /// This configuration exists in the - /// \[`firebase.json`\](/docs/cli/#the_firebasejson_file) file. - ServingConfig config; - - /// The time at which the version was created. - /// - /// Output only. - core.String createTime; - - /// Identifies the user who created the version. - /// - /// Output only. - ActingUser createUser; - - /// The time at which the version was `DELETED`. - /// - /// Output only. - core.String deleteTime; - - /// Identifies the user who `DELETED` the version. - /// - /// Output only. - ActingUser deleteUser; - - /// The total number of files associated with the version. - /// - /// This value is calculated after a version is `FINALIZED`. - /// - /// Output only. - core.String fileCount; - - /// The time at which the version was `FINALIZED`. - /// - /// Output only. - core.String finalizeTime; - - /// Identifies the user who `FINALIZED` the version. - /// - /// Output only. - ActingUser finalizeUser; - - /// The labels used for extra metadata and/or filtering. - core.Map<core.String, core.String> labels; - - /// The unique identifier for a version, in the format: sites/site-name - /// /versions/versionID This name is provided in the response body when you - /// call the \[`CreateVersion`\](../sites.versions/create) endpoint. - core.String name; - - /// Version preview configuration for the site version. - /// - /// This configuration specfies whether previewing is enabled for this site - /// version. Version previews allow you to preview your site at a custom URL - /// before releasing it as the live version. - PreviewConfig preview; - - /// The deploy status of a version. - /// - /// For a successful deploy, call the - /// \[`CreateVersion`\](sites.versions/create) endpoint to make a new version - /// (`CREATED` status), \[upload all desired - /// files\](sites.versions/populateFiles) to the version, then - /// \[update\](sites.versions/patch) the version to the `FINALIZED` status. - /// Note that if you leave the version in the `CREATED` state for more than 12 - /// hours, the system will automatically mark the version as `ABANDONED`. You - /// can also change the status of a version to `DELETED` by calling the - /// \[`DeleteVersion`\](sites.versions/delete) endpoint. - /// Possible string values are: - /// - "VERSION_STATUS_UNSPECIFIED" : The default status; should not be - /// intentionally used. - /// - "CREATED" : The version has been created, and content is currently being - /// added to the version. - /// - "FINALIZED" : All content has been added to the version, and the version - /// can no longer be changed. - /// - "DELETED" : The version has been deleted. - /// - "ABANDONED" : The version was not updated to `FINALIZED` within 12 hours - /// and was automatically deleted. - /// - "EXPIRED" : The version is outside the site-configured limit for the - /// number of retained versions, so the version's content is scheduled for - /// deletion. - /// - "CLONING" : The version is being cloned from another version. All - /// content is still being copied over. - core.String status; - - /// The total stored bytesize of the version. - /// - /// This value is calculated after a version is `FINALIZED`. - /// - /// Output only. - core.String versionBytes; - - Version(); - - Version.fromJson(core.Map _json) { - if (_json.containsKey('config')) { - config = ServingConfig.fromJson( - _json['config'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('createUser')) { - createUser = ActingUser.fromJson( - _json['createUser'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('deleteTime')) { - deleteTime = _json['deleteTime'] as core.String; - } - if (_json.containsKey('deleteUser')) { - deleteUser = ActingUser.fromJson( - _json['deleteUser'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('fileCount')) { - fileCount = _json['fileCount'] as core.String; - } - if (_json.containsKey('finalizeTime')) { - finalizeTime = _json['finalizeTime'] as core.String; - } - if (_json.containsKey('finalizeUser')) { - finalizeUser = ActingUser.fromJson( - _json['finalizeUser'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('preview')) { - preview = PreviewConfig.fromJson( - _json['preview'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('status')) { - status = _json['status'] as core.String; - } - if (_json.containsKey('versionBytes')) { - versionBytes = _json['versionBytes'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (config != null) { - _json['config'] = config.toJson(); - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (createUser != null) { - _json['createUser'] = createUser.toJson(); - } - if (deleteTime != null) { - _json['deleteTime'] = deleteTime; - } - if (deleteUser != null) { - _json['deleteUser'] = deleteUser.toJson(); - } - if (fileCount != null) { - _json['fileCount'] = fileCount; - } - if (finalizeTime != null) { - _json['finalizeTime'] = finalizeTime; - } - if (finalizeUser != null) { - _json['finalizeUser'] = finalizeUser.toJson(); - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (preview != null) { - _json['preview'] = preview.toJson(); - } - if (status != null) { - _json['status'] = status; - } - if (versionBytes != null) { - _json['versionBytes'] = versionBytes; - } - return _json; - } -} - -/// A static content file that is part of a version. -class VersionFile { - /// The SHA256 content hash of the file. - core.String hash; - - /// The URI at which the file's content should display. - core.String path; - - /// The current status of a particular file in the specified version. - /// - /// The value will be either `pending upload` or `uploaded`. - /// - /// Output only. - /// Possible string values are: - /// - "STATUS_UNSPECIFIED" : The default status; should not be intentionally - /// used. - /// - "EXPECTED" : The file has been included in the version and is expected - /// to be uploaded in the near future. - /// - "ACTIVE" : The file has already been uploaded to Firebase Hosting. - core.String status; - - VersionFile(); - - VersionFile.fromJson(core.Map _json) { - if (_json.containsKey('hash')) { - hash = _json['hash'] as core.String; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - if (_json.containsKey('status')) { - status = _json['status'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (hash != null) { - _json['hash'] = hash; - } - if (path != null) { - _json['path'] = path; - } - if (status != null) { - _json['status'] = status; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/firebaseml/v1beta2.dart b/generated/googleapis_beta/lib/firebaseml/v1beta2.dart deleted file mode 100644 index 1d4f25f..0000000 --- a/generated/googleapis_beta/lib/firebaseml/v1beta2.dart +++ /dev/null
@@ -1,915 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Firebase ML API - v1beta2 -/// -/// Access custom machine learning models hosted via Firebase ML. -/// -/// For more information, see <https://firebase.google.com> -/// -/// Create an instance of [FirebaseMLApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsModelsResource] -/// - [ProjectsOperationsResource] -library firebaseml.v1beta2; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Access custom machine learning models hosted via Firebase ML. -class FirebaseMLApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - FirebaseMLApi(http.Client client, - {core.String rootUrl = 'https://firebaseml.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsModelsResource get models => ProjectsModelsResource(_requester); - ProjectsOperationsResource get operations => - ProjectsOperationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsModelsResource { - final commons.ApiRequester _requester; - - ProjectsModelsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a model in Firebase ML. - /// - /// The longrunning operation will eventually return a Model - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent project resource where the model is to be - /// created. The parent must have the form `projects/{project_id}` - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Model request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/models'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a model - /// - /// Request parameters: - /// - /// [name] - Required. The name of the model to delete. The name must have the - /// form `projects/{project_id}/models/{model_id}` - /// Value must have pattern `^projects/\[^/\]+/models/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a model resource. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the model to get. The name must have the - /// form `projects/{project_id}/models/{model_id}` - /// Value must have pattern `^projects/\[^/\]+/models/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Model]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Model> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Model.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists the models - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the parent to list models for. The parent - /// must have the form \`projects/{project_id}' - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - A filter for the list e.g. 'tags: abc' to list models which are - /// tagged with "abc" - /// - /// [pageSize] - The maximum number of items to return - /// - /// [pageToken] - The next_page_token value returned from a previous List - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListModelsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListModelsResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/models'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListModelsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a model. - /// - /// The longrunning operation will eventually return a Model. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the Model. Model names have the form - /// `projects/{project_id}/models/{model_id}` The name is ignored when - /// creating a model. - /// Value must have pattern `^projects/\[^/\]+/models/\[^/\]+$`. - /// - /// [updateMask] - The update mask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Model request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsOperationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern `^projects/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The response for list models -class ListModelsResponse { - /// The list of models - core.List<Model> models; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - ListModelsResponse(); - - ListModelsResponse.fromJson(core.Map _json) { - if (_json.containsKey('models')) { - models = (_json['models'] as core.List) - .map<Model>((value) => - Model.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (models != null) { - _json['models'] = models.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// An ML model hosted in Firebase ML -class Model { - /// Lists operation ids associated with this model whose status is NOT done. - /// - /// Output only. - core.List<Operation> activeOperations; - - /// Timestamp when this model was created in Firebase ML. - /// - /// Output only. - core.String createTime; - - /// The name of the model to create. - /// - /// The name can be up to 32 characters long and can consist only of ASCII - /// Latin letters A-Z and a-z, underscores(_) and ASCII digits 0-9. It must - /// start with a letter. - /// - /// Required. - core.String displayName; - - /// See RFC7232 https://tools.ietf.org/html/rfc7232#section-2.3 - /// - /// Output only. - core.String etag; - - /// The model_hash will change if a new file is available for download. - /// - /// Output only. - core.String modelHash; - - /// The resource name of the Model. - /// - /// Model names have the form `projects/{project_id}/models/{model_id}` The - /// name is ignored when creating a model. - core.String name; - - /// State common to all model types. - /// - /// Includes publishing and validation information. - ModelState state; - - /// User defined tags which can be used to group/filter models during listing - core.List<core.String> tags; - - /// A TFLite Model - TfLiteModel tfliteModel; - - /// Timestamp when this model was updated in Firebase ML. - /// - /// Output only. - core.String updateTime; - - Model(); - - Model.fromJson(core.Map _json) { - if (_json.containsKey('activeOperations')) { - activeOperations = (_json['activeOperations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('modelHash')) { - modelHash = _json['modelHash'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('state')) { - state = ModelState.fromJson( - _json['state'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('tags')) { - tags = (_json['tags'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('tfliteModel')) { - tfliteModel = TfLiteModel.fromJson( - _json['tfliteModel'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (activeOperations != null) { - _json['activeOperations'] = - activeOperations.map((value) => value.toJson()).toList(); - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (etag != null) { - _json['etag'] = etag; - } - if (modelHash != null) { - _json['modelHash'] = modelHash; - } - if (name != null) { - _json['name'] = name; - } - if (state != null) { - _json['state'] = state.toJson(); - } - if (tags != null) { - _json['tags'] = tags; - } - if (tfliteModel != null) { - _json['tfliteModel'] = tfliteModel.toJson(); - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// This is returned in the longrunning operations for create/update. -class ModelOperationMetadata { - /// - /// Possible string values are: - /// - "BASIC_OPERATION_STATUS_UNSPECIFIED" : The status is unspecified - /// - "BASIC_OPERATION_STATUS_UPLOADING" : The model file is being uploaded - /// - "BASIC_OPERATION_STATUS_VERIFYING" : The model file is being verified - core.String basicOperationStatus; - - /// The name of the model we are creating/updating The name must have the form - /// `projects/{project_id}/models/{model_id}` - core.String name; - - ModelOperationMetadata(); - - ModelOperationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('basicOperationStatus')) { - basicOperationStatus = _json['basicOperationStatus'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (basicOperationStatus != null) { - _json['basicOperationStatus'] = basicOperationStatus; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// State common to all model types. -/// -/// Includes publishing and validation information. -class ModelState { - /// Indicates if this model has been published. - core.bool published; - - /// Indicates the latest validation error on the model if any. - /// - /// A model may have validation errors if there were problems during the model - /// creation/update. e.g. in the case of a TfLiteModel, if a tflite model file - /// was missing or in the wrong format. This field will be empty for valid - /// models. - /// - /// Output only. - Status validationError; - - ModelState(); - - ModelState.fromJson(core.Map _json) { - if (_json.containsKey('published')) { - published = _json['published'] as core.bool; - } - if (_json.containsKey('validationError')) { - validationError = Status.fromJson( - _json['validationError'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (published != null) { - _json['published'] = published; - } - if (validationError != null) { - _json['validationError'] = validationError.toJson(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Information that is specific to TfLite models. -class TfLiteModel { - /// The AutoML model id referencing a model you created with the AutoML API. - /// - /// The name should have format 'projects//locations//models/' (This is the - /// model resource name returned from the AutoML API) - core.String automlModel; - - /// The TfLite file containing the model. - /// - /// (Stored in Google Cloud). The gcs_tflite_uri should have form: - /// gs://some-bucket/some-model.tflite Note: If you update the file in the - /// original location, it is necessary to call UpdateModel for ML to pick up - /// and validate the updated file. - core.String gcsTfliteUri; - - /// The size of the TFLite model - /// - /// Output only. - core.String sizeBytes; - - TfLiteModel(); - - TfLiteModel.fromJson(core.Map _json) { - if (_json.containsKey('automlModel')) { - automlModel = _json['automlModel'] as core.String; - } - if (_json.containsKey('gcsTfliteUri')) { - gcsTfliteUri = _json['gcsTfliteUri'] as core.String; - } - if (_json.containsKey('sizeBytes')) { - sizeBytes = _json['sizeBytes'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (automlModel != null) { - _json['automlModel'] = automlModel; - } - if (gcsTfliteUri != null) { - _json['gcsTfliteUri'] = gcsTfliteUri; - } - if (sizeBytes != null) { - _json['sizeBytes'] = sizeBytes; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/gameservices/v1beta.dart b/generated/googleapis_beta/lib/gameservices/v1beta.dart deleted file mode 100644 index c665a57..0000000 --- a/generated/googleapis_beta/lib/gameservices/v1beta.dart +++ /dev/null
@@ -1,5702 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Game Services API - v1beta -/// -/// Deploy and manage infrastructure for global multiplayer gaming experiences. -/// -/// For more information, see <https://cloud.google.com/solutions/gaming/> -/// -/// Create an instance of [GameServicesApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsGameServerDeploymentsResource] -/// - [ProjectsLocationsGameServerDeploymentsConfigsResource] -/// - [ProjectsLocationsOperationsResource] -/// - [ProjectsLocationsRealmsResource] -/// - [ProjectsLocationsRealmsGameServerClustersResource] -library gameservices.v1beta; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Deploy and manage infrastructure for global multiplayer gaming experiences. -class GameServicesApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - GameServicesApi(http.Client client, - {core.String rootUrl = 'https://gameservices.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsGameServerDeploymentsResource get gameServerDeployments => - ProjectsLocationsGameServerDeploymentsResource(_requester); - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - ProjectsLocationsRealmsResource get realms => - ProjectsLocationsRealmsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [includeUnrevealedLocations] - If true, the returned list will include - /// locations which are not yet revealed. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.bool includeUnrevealedLocations, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (includeUnrevealedLocations != null) { - _queryParams['includeUnrevealedLocations'] = [ - '${includeUnrevealedLocations}' - ]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsGameServerDeploymentsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsGameServerDeploymentsConfigsResource get configs => - ProjectsLocationsGameServerDeploymentsConfigsResource(_requester); - - ProjectsLocationsGameServerDeploymentsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new game server deployment in a given project and location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [deploymentId] - Required. The ID of the game server delpoyment resource - /// to be created. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - GameServerDeployment request, - core.String parent, { - core.String deploymentId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (deploymentId != null) { - _queryParams['deploymentId'] = [deploymentId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/gameServerDeployments'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single game server deployment. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server delpoyment to delete. Uses - /// the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves information about the current state of the game server - /// deployment. - /// - /// Gathers all the Agones fleets and Agones autoscalers, including fleets - /// running an older version of the game server deployment. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server delpoyment. Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [FetchDeploymentStateResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<FetchDeploymentStateResponse> fetchDeploymentState( - FetchDeploymentStateRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':fetchDeploymentState'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => FetchDeploymentStateResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single game server deployment. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server delpoyment to retrieve. - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GameServerDeployment]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GameServerDeployment> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GameServerDeployment.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for a resource. - /// - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details a single game server deployment rollout. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server delpoyment to retrieve. - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GameServerDeploymentRollout]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GameServerDeploymentRollout> getRollout( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name') + '/rollout'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GameServerDeploymentRollout.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists game server deployments in a given project and location. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to apply to list results. - /// - /// [orderBy] - Optional. Specifies the ordering of results following syntax - /// at https://cloud.google.com/apis/design/design_patterns#sorting_order. - /// - /// [pageSize] - Optional. The maximum number of items to return. If - /// unspecified, the server will pick an appropriate default. The server may - /// return fewer items than requested. A caller should only rely on response's - /// next_page_token to determine if there are more GameServerDeployments left - /// to be queried. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListGameServerDeploymentsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListGameServerDeploymentsResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/gameServerDeployments'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListGameServerDeploymentsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Patches a game server deployment. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the game server deployment. Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-deployment`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [updateMask] - Required. Mask of fields to update. At least one path must - /// be supplied in this field. For the `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - GameServerDeployment request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Previews the game server deployment rollout. - /// - /// This API does not mutate the rollout resource. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the game server deployment rollout. Uses the - /// form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-deployment/rollout`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [previewTime] - Optional. The target timestamp to compute the preview. - /// Defaults to the immediately after the proposed rollout completes. - /// - /// [updateMask] - Optional. Mask of fields to update. At least one path must - /// be supplied in this field. For the `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PreviewGameServerDeploymentRolloutResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PreviewGameServerDeploymentRolloutResponse> previewRollout( - GameServerDeploymentRollout request, - core.String name, { - core.String previewTime, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (previewTime != null) { - _queryParams['previewTime'] = [previewTime]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/rollout:preview'; - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PreviewGameServerDeploymentRolloutResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on the specified resource. - /// - /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, - /// and `PERMISSION_DENIED` errors. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Patches a single game server deployment rollout. - /// - /// The method will not return an error if the update does not affect any - /// existing realms. For example - if the default_game_server_config is - /// changed but all existing realms use the override, that is valid. - /// Similarly, if a non existing realm is explicitly called out in - /// game_server_config_overrides field, that will also not result in an error. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the game server deployment rollout. Uses the - /// form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-deployment/rollout`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [updateMask] - Required. Mask of fields to update. At least one path must - /// be supplied in this field. For the `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> updateRollout( - GameServerDeploymentRollout request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name') + '/rollout'; - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsGameServerDeploymentsConfigsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsGameServerDeploymentsConfigsResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a new game server config in a given project, location, and game - /// server deployment. - /// - /// Game server configs are immutable, and are not applied until referenced in - /// the game server deployment rollout resource. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [configId] - Required. The ID of the game server config resource to be - /// created. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - GameServerConfig request, - core.String parent, { - core.String configId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (configId != null) { - _queryParams['configId'] = [configId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/configs'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single game server config. - /// - /// The deletion will fail if the game server config is referenced in a game - /// server deployment rollout. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server config to delete. Uses the - /// form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single game server config. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server config to retrieve. Uses - /// the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GameServerConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GameServerConfig> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GameServerConfig.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists game server configs in a given project, location, and game server - /// deployment. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs - /// / * `. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/gameServerDeployments/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to apply to list results. - /// - /// [orderBy] - Optional. Specifies the ordering of results following syntax - /// at https://cloud.google.com/apis/design/design_patterns#sorting_order. - /// - /// [pageSize] - Optional. The maximum number of items to return. If - /// unspecified, server will pick an appropriate default. Server may return - /// fewer items than requested. A caller should only rely on response's - /// next_page_token to determine if there are more GameServerConfigs left to - /// be queried. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// list request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListGameServerConfigsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListGameServerConfigsResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/configs'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListGameServerConfigsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> cancel( - CancelOperationRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a long-running operation. - /// - /// This method indicates that the client is no longer interested in the - /// operation result. It does not cancel the operation. If the server doesn't - /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be deleted. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRealmsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRealmsGameServerClustersResource get gameServerClusters => - ProjectsLocationsRealmsGameServerClustersResource(_requester); - - ProjectsLocationsRealmsResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new realm in a given project and location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [realmId] - Required. The ID of the realm resource to be created. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Realm request, - core.String parent, { - core.String realmId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (realmId != null) { - _queryParams['realmId'] = [realmId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/realms'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single realm. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the realm to delete. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single realm. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the realm to retrieve. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Realm]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Realm> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Realm.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists realms in a given project and location. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}`. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to apply to list results. - /// - /// [orderBy] - Optional. Specifies the ordering of results following syntax - /// at https://cloud.google.com/apis/design/design_patterns#sorting_order. - /// - /// [pageSize] - Optional. The maximum number of items to return. If - /// unspecified, server will pick an appropriate default. Server may return - /// fewer items than requested. A caller should only rely on response's - /// next_page_token to determine if there are more realms left to be queried. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListRealmsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListRealmsResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/realms'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListRealmsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Patches a single realm. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the realm. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}`. For example, - /// `projects/my-project/locations/{location}/realms/my-realm`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [updateMask] - Required. The update mask applies to the resource. For the - /// `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Realm request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Previews patches to a single realm. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name of the realm. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}`. For example, - /// `projects/my-project/locations/{location}/realms/my-realm`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [previewTime] - Optional. The target timestamp to compute the preview. - /// - /// [updateMask] - Required. The update mask applies to the resource. For the - /// `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PreviewRealmUpdateResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PreviewRealmUpdateResponse> previewUpdate( - Realm request, - core.String name, { - core.String previewTime, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (previewTime != null) { - _queryParams['previewTime'] = [previewTime]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':previewUpdate'; - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PreviewRealmUpdateResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsRealmsGameServerClustersResource { - final commons.ApiRequester _requester; - - ProjectsLocationsRealmsGameServerClustersResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a new game server cluster in a given project and location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm-id}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [gameServerClusterId] - Required. The ID of the game server cluster - /// resource to be created. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - GameServerCluster request, - core.String parent, { - core.String gameServerClusterId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (gameServerClusterId != null) { - _queryParams['gameServerClusterId'] = [gameServerClusterId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/gameServerClusters'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single game server cluster. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server cluster to delete. Uses the - /// form: - /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+/gameServerClusters/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single game server cluster. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server cluster to retrieve. Uses - /// the form: - /// `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+/gameServerClusters/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [GameServerCluster]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<GameServerCluster> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => GameServerCluster.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists game server clusters in a given project and location. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// "projects/{project}/locations/{location}/realms/{realm}". - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to apply to list results. - /// - /// [orderBy] - Optional. Specifies the ordering of results following syntax - /// at https://cloud.google.com/apis/design/design_patterns#sorting_order. - /// - /// [pageSize] - Optional. The maximum number of items to return. If - /// unspecified, the server will pick an appropriate default. The server may - /// return fewer items than requested. A caller should only rely on response's - /// next_page_token to determine if there are more GameServerClusters left to - /// be queried. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListGameServerClustersResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListGameServerClustersResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/gameServerClusters'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListGameServerClustersResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Patches a single game server cluster. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The resource name of the game server cluster. Uses the - /// form: - /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. - /// For example, - /// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+/gameServerClusters/\[^/\]+$`. - /// - /// [updateMask] - Required. Mask of fields to update. At least one path must - /// be supplied in this field. For the `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - GameServerCluster request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Previews creation of a new game server cluster in a given project and - /// location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The parent resource name. Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+$`. - /// - /// [gameServerClusterId] - Required. The ID of the game server cluster - /// resource to be created. - /// - /// [previewTime] - Optional. The target timestamp to compute the preview. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PreviewCreateGameServerClusterResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PreviewCreateGameServerClusterResponse> previewCreate( - GameServerCluster request, - core.String parent, { - core.String gameServerClusterId, - core.String previewTime, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (gameServerClusterId != null) { - _queryParams['gameServerClusterId'] = [gameServerClusterId]; - } - if (previewTime != null) { - _queryParams['previewTime'] = [previewTime]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/gameServerClusters:previewCreate'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PreviewCreateGameServerClusterResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Previews deletion of a single game server cluster. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the game server cluster to delete. Uses the - /// form: - /// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+/gameServerClusters/\[^/\]+$`. - /// - /// [previewTime] - Optional. The target timestamp to compute the preview. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PreviewDeleteGameServerClusterResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PreviewDeleteGameServerClusterResponse> previewDelete( - core.String name, { - core.String previewTime, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (previewTime != null) { - _queryParams['previewTime'] = [previewTime]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':previewDelete'; - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PreviewDeleteGameServerClusterResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Previews updating a GameServerCluster. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The resource name of the game server cluster. Uses the - /// form: - /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. - /// For example, - /// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/realms/\[^/\]+/gameServerClusters/\[^/\]+$`. - /// - /// [previewTime] - Optional. The target timestamp to compute the preview. - /// - /// [updateMask] - Required. Mask of fields to update. At least one path must - /// be supplied in this field. For the `FieldMask` definition, see https: - /// //developers.google.com/protocol-buffers // - /// /docs/reference/google.protobuf#fieldmask - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PreviewUpdateGameServerClusterResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PreviewUpdateGameServerClusterResponse> previewUpdate( - GameServerCluster request, - core.String name, { - core.String previewTime, - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (previewTime != null) { - _queryParams['previewTime'] = [previewTime]; - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':previewUpdate'; - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => PreviewUpdateGameServerClusterResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Specifies the audit configuration for a service. -/// -/// The configuration determines which permission types are logged, and what -/// identities, if any, are exempted from logging. An AuditConfig must have one -/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` -/// and a specific service, the union of the two AuditConfigs is used for that -/// service: the log_types specified in each AuditConfig are enabled, and the -/// exempted_members in each AuditLogConfig are exempted. Example Policy with -/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", -/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ -/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": -/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", -/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": -/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } -/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts jose@example.com from DATA_READ logging, and -/// aliya@example.com from DATA_WRITE logging. -class AuditConfig { - /// The configuration for logging of each type of permission. - core.List<AuditLogConfig> auditLogConfigs; - core.List<core.String> exemptedMembers; - - /// Specifies a service that will be enabled for audit logging. - /// - /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - /// `allServices` is a special value that covers all services. - core.String service; - - AuditConfig(); - - AuditConfig.fromJson(core.Map _json) { - if (_json.containsKey('auditLogConfigs')) { - auditLogConfigs = (_json['auditLogConfigs'] as core.List) - .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('exemptedMembers')) { - exemptedMembers = (_json['exemptedMembers'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('service')) { - service = _json['service'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditLogConfigs != null) { - _json['auditLogConfigs'] = - auditLogConfigs.map((value) => value.toJson()).toList(); - } - if (exemptedMembers != null) { - _json['exemptedMembers'] = exemptedMembers; - } - if (service != null) { - _json['service'] = service; - } - return _json; - } -} - -/// Provides the configuration for logging a type of permissions. -/// -/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", -/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": -/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while -/// exempting jose@example.com from DATA_READ logging. -class AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// - /// Follows the same format of Binding.members. - core.List<core.String> exemptedMembers; - core.bool ignoreChildExemptions; - - /// The log type that this config enables. - /// Possible string values are: - /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. - /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy - /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create - /// - "DATA_READ" : Data reads. Example: CloudSQL Users list - core.String logType; - - AuditLogConfig(); - - AuditLogConfig.fromJson(core.Map _json) { - if (_json.containsKey('exemptedMembers')) { - exemptedMembers = (_json['exemptedMembers'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('ignoreChildExemptions')) { - ignoreChildExemptions = _json['ignoreChildExemptions'] as core.bool; - } - if (_json.containsKey('logType')) { - logType = _json['logType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exemptedMembers != null) { - _json['exemptedMembers'] = exemptedMembers; - } - if (ignoreChildExemptions != null) { - _json['ignoreChildExemptions'] = ignoreChildExemptions; - } - if (logType != null) { - _json['logType'] = logType; - } - return _json; - } -} - -/// Authorization-related information used by Cloud Audit Logging. -class AuthorizationLoggingOptions { - /// The type of the permission that was checked. - /// Possible string values are: - /// - "PERMISSION_TYPE_UNSPECIFIED" : Default. Should not be used. - /// - "ADMIN_READ" : A read of admin (meta) data. - /// - "ADMIN_WRITE" : A write of admin (meta) data. - /// - "DATA_READ" : A read of standard data. - /// - "DATA_WRITE" : A write of standard data. - core.String permissionType; - - AuthorizationLoggingOptions(); - - AuthorizationLoggingOptions.fromJson(core.Map _json) { - if (_json.containsKey('permissionType')) { - permissionType = _json['permissionType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissionType != null) { - _json['permissionType'] = permissionType; - } - return _json; - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// The request message for Operations.CancelOperation. -class CancelOperationRequest { - CancelOperationRequest(); - - CancelOperationRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Write a Cloud Audit log -class CloudAuditOptions { - /// Information used by the Cloud Audit Logging pipeline. - AuthorizationLoggingOptions authorizationLoggingOptions; - - /// The log_name to populate in the Cloud Audit Record. - /// Possible string values are: - /// - "UNSPECIFIED_LOG_NAME" : Default. Should not be used. - /// - "ADMIN_ACTIVITY" : Corresponds to "cloudaudit.googleapis.com/activity" - /// - "DATA_ACCESS" : Corresponds to "cloudaudit.googleapis.com/data_access" - core.String logName; - - CloudAuditOptions(); - - CloudAuditOptions.fromJson(core.Map _json) { - if (_json.containsKey('authorizationLoggingOptions')) { - authorizationLoggingOptions = AuthorizationLoggingOptions.fromJson( - _json['authorizationLoggingOptions'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('logName')) { - logName = _json['logName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (authorizationLoggingOptions != null) { - _json['authorizationLoggingOptions'] = - authorizationLoggingOptions.toJson(); - } - if (logName != null) { - _json['logName'] = logName; - } - return _json; - } -} - -/// A condition to be met. -class Condition { - /// Trusted attributes supplied by the IAM system. - /// Possible string values are: - /// - "NO_ATTR" : Default non-attribute. - /// - "AUTHORITY" : Either principal or (if present) authority selector. - /// - "ATTRIBUTION" : The principal (even if an authority selector is - /// present), which must only be used for attribution, not authorization. - /// - "SECURITY_REALM" : Any of the security realms in the IAMContext - /// (go/security-realms). When used with IN, the condition indicates "any of - /// the request's realms match one of the given values; with NOT_IN, "none of - /// the realms match any of the given values". Note that a value can be: - - /// 'self' (i.e., allow connections from clients that are in the same security - /// realm) - 'self:metro' (i.e., clients that are in the same metro) - - /// 'self:cloud-region' (i.e., allow connections from clients that are in the - /// same cloud region) - 'guardians' (i.e., allow connections from its - /// guardian realms. See go/security-realms-glossary#guardian for more - /// information.) - a realm (e.g., 'campus-abc') - a realm group (e.g., - /// 'realms-for-borg-cell-xx', see: go/realm-groups) A match is determined by - /// a realm group membership check performed by a RealmAclRep object - /// (go/realm-acl-howto). It is not permitted to grant access based on the - /// *absence* of a realm, so realm conditions can only be used in a "positive" - /// context (e.g., ALLOW/IN or DENY/NOT_IN). - /// - "APPROVER" : An approver (distinct from the requester) that has - /// authorized this request. When used with IN, the condition indicates that - /// one of the approvers associated with the request matches the specified - /// principal, or is a member of the specified group. Approvers can only grant - /// additional access, and are thus only used in a strictly positive context - /// (e.g. ALLOW/IN or DENY/NOT_IN). - /// - "JUSTIFICATION_TYPE" : What types of justifications have been supplied - /// with this request. String values should match enum names from - /// security.credentials.JustificationType, e.g. "MANUAL_STRING". It is not - /// permitted to grant access based on the *absence* of a justification, so - /// justification conditions can only be used in a "positive" context (e.g., - /// ALLOW/IN or DENY/NOT_IN). Multiple justifications, e.g., a Buganizer ID - /// and a manually-entered reason, are normal and supported. - /// - "CREDENTIALS_TYPE" : What type of credentials have been supplied with - /// this request. String values should match enum names from - /// security_loas_l2.CredentialsType - currently, only CREDS_TYPE_EMERGENCY is - /// supported. It is not permitted to grant access based on the *absence* of a - /// credentials type, so the conditions can only be used in a "positive" - /// context (e.g., ALLOW/IN or DENY/NOT_IN). - /// - "CREDS_ASSERTION" : EXPERIMENTAL -- DO NOT USE. - core.String iam; - - /// An operator to apply the subject with. - /// Possible string values are: - /// - "NO_OP" : Default no-op. - /// - "EQUALS" : DEPRECATED. Use IN instead. - /// - "NOT_EQUALS" : DEPRECATED. Use NOT_IN instead. - /// - "IN" : The condition is true if the subject (or any element of it if it - /// is a set) matches any of the supplied values. - /// - "NOT_IN" : The condition is true if the subject (or every element of it - /// if it is a set) matches none of the supplied values. - /// - "DISCHARGED" : Subject is discharged - core.String op; - - /// Trusted attributes discharged by the service. - core.String svc; - - /// Trusted attributes supplied by any service that owns resources and uses - /// the IAM system for access control. - /// Possible string values are: - /// - "NO_ATTR" : Default non-attribute type - /// - "REGION" : Region of the resource - /// - "SERVICE" : Service name - /// - "NAME" : Resource name - /// - "IP" : IP address of the caller - core.String sys; - - /// The objects of the condition. - core.List<core.String> values; - - Condition(); - - Condition.fromJson(core.Map _json) { - if (_json.containsKey('iam')) { - iam = _json['iam'] as core.String; - } - if (_json.containsKey('op')) { - op = _json['op'] as core.String; - } - if (_json.containsKey('svc')) { - svc = _json['svc'] as core.String; - } - if (_json.containsKey('sys')) { - sys = _json['sys'] as core.String; - } - if (_json.containsKey('values')) { - values = (_json['values'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (iam != null) { - _json['iam'] = iam; - } - if (op != null) { - _json['op'] = op; - } - if (svc != null) { - _json['svc'] = svc; - } - if (sys != null) { - _json['sys'] = sys; - } - if (values != null) { - _json['values'] = values; - } - return _json; - } -} - -/// Increment a streamz counter with the specified metric and field names. -/// -/// Metric names should start with a '/', generally be lowercase-only, and end -/// in "_count". Field names should not contain an initial slash. The actual -/// exported metric names will have "/iam/policy" prepended. Field names -/// correspond to IAM request parameters and field values are their respective -/// values. Supported field names: - "authority", which is "\[token\]" if -/// IAMContext.token is present, otherwise the value of -/// IAMContext.authority_selector if present, and otherwise a representation of -/// IAMContext.principal; or - "iam_principal", a representation of -/// IAMContext.principal even if a token or authority selector is present; or - -/// "" (empty string), resulting in a counter with no fields. Examples: counter -/// { metric: "/debug_access_count" field: "iam_principal" } ==> increment -/// counter /iam/policy/debug_access_count {iam_principal=\[value of -/// IAMContext.principal\]} -class CounterOptions { - /// Custom fields. - core.List<CustomField> customFields; - - /// The field value to attribute. - core.String field; - - /// The metric to update. - core.String metric; - - CounterOptions(); - - CounterOptions.fromJson(core.Map _json) { - if (_json.containsKey('customFields')) { - customFields = (_json['customFields'] as core.List) - .map<CustomField>((value) => CustomField.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('field')) { - field = _json['field'] as core.String; - } - if (_json.containsKey('metric')) { - metric = _json['metric'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (customFields != null) { - _json['customFields'] = - customFields.map((value) => value.toJson()).toList(); - } - if (field != null) { - _json['field'] = field; - } - if (metric != null) { - _json['metric'] = metric; - } - return _json; - } -} - -/// Custom fields. -/// -/// These can be used to create a counter with arbitrary field/value pairs. See: -/// go/rpcsp-custom-fields. -class CustomField { - /// Name is the field name. - core.String name; - - /// Value is the field value. - /// - /// It is important that in contrast to the CounterOptions.field, the value - /// here is a constant that is not derived from the IAMContext. - core.String value; - - CustomField(); - - CustomField.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// Write a Data Access (Gin) log -class DataAccessOptions { - /// - /// Possible string values are: - /// - "LOG_MODE_UNSPECIFIED" : Client is not required to write a partial Gin - /// log immediately after the authorization check. If client chooses to write - /// one and it fails, client may either fail open (allow the operation to - /// continue) or fail closed (handle as a DENY outcome). - /// - "LOG_FAIL_CLOSED" : The application's operation in the context of which - /// this authorization check is being made may only be performed if it is - /// successfully logged to Gin. For instance, the authorization library may - /// satisfy this obligation by emitting a partial log entry at authorization - /// check time and only returning ALLOW to the application if it succeeds. If - /// a matching Rule has this directive, but the client has not indicated that - /// it will honor such requirements, then the IAM check will result in - /// authorization failure by setting CheckPolicyResponse.success=false. - core.String logMode; - - DataAccessOptions(); - - DataAccessOptions.fromJson(core.Map _json) { - if (_json.containsKey('logMode')) { - logMode = _json['logMode'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (logMode != null) { - _json['logMode'] = logMode; - } - return _json; - } -} - -/// The game server cluster changes made by the game server deployment. -class DeployedClusterState { - /// The name of the cluster. - core.String cluster; - - /// The details about the Agones fleets and autoscalers created in the game - /// server cluster. - core.List<DeployedFleetDetails> fleetDetails; - - DeployedClusterState(); - - DeployedClusterState.fromJson(core.Map _json) { - if (_json.containsKey('cluster')) { - cluster = _json['cluster'] as core.String; - } - if (_json.containsKey('fleetDetails')) { - fleetDetails = (_json['fleetDetails'] as core.List) - .map<DeployedFleetDetails>((value) => DeployedFleetDetails.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cluster != null) { - _json['cluster'] = cluster; - } - if (fleetDetails != null) { - _json['fleetDetails'] = - fleetDetails.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Agones fleet specification and details. -class DeployedFleet { - /// The name of the Agones fleet. - core.String fleet; - - /// The fleet spec retrieved from the Agones fleet. - core.String fleetSpec; - - /// The source spec that is used to create the Agones fleet. - /// - /// The GameServerConfig resource may no longer exist in the system. - SpecSource specSource; - - /// The current status of the Agones fleet. - /// - /// Includes count of game servers in various states. - DeployedFleetStatus status; - - DeployedFleet(); - - DeployedFleet.fromJson(core.Map _json) { - if (_json.containsKey('fleet')) { - fleet = _json['fleet'] as core.String; - } - if (_json.containsKey('fleetSpec')) { - fleetSpec = _json['fleetSpec'] as core.String; - } - if (_json.containsKey('specSource')) { - specSource = SpecSource.fromJson( - _json['specSource'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('status')) { - status = DeployedFleetStatus.fromJson( - _json['status'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fleet != null) { - _json['fleet'] = fleet; - } - if (fleetSpec != null) { - _json['fleetSpec'] = fleetSpec; - } - if (specSource != null) { - _json['specSource'] = specSource.toJson(); - } - if (status != null) { - _json['status'] = status.toJson(); - } - return _json; - } -} - -/// Details about the Agones autoscaler. -class DeployedFleetAutoscaler { - /// The name of the Agones autoscaler. - core.String autoscaler; - - /// The autoscaler spec retrieved from Agones. - core.String fleetAutoscalerSpec; - - /// The source spec that is used to create the autoscaler. - /// - /// The GameServerConfig resource may no longer exist in the system. - SpecSource specSource; - - DeployedFleetAutoscaler(); - - DeployedFleetAutoscaler.fromJson(core.Map _json) { - if (_json.containsKey('autoscaler')) { - autoscaler = _json['autoscaler'] as core.String; - } - if (_json.containsKey('fleetAutoscalerSpec')) { - fleetAutoscalerSpec = _json['fleetAutoscalerSpec'] as core.String; - } - if (_json.containsKey('specSource')) { - specSource = SpecSource.fromJson( - _json['specSource'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (autoscaler != null) { - _json['autoscaler'] = autoscaler; - } - if (fleetAutoscalerSpec != null) { - _json['fleetAutoscalerSpec'] = fleetAutoscalerSpec; - } - if (specSource != null) { - _json['specSource'] = specSource.toJson(); - } - return _json; - } -} - -/// Details of the deployed Agones fleet. -class DeployedFleetDetails { - /// Information about the Agones autoscaler for that fleet. - DeployedFleetAutoscaler deployedAutoscaler; - - /// Information about the Agones fleet. - DeployedFleet deployedFleet; - - DeployedFleetDetails(); - - DeployedFleetDetails.fromJson(core.Map _json) { - if (_json.containsKey('deployedAutoscaler')) { - deployedAutoscaler = DeployedFleetAutoscaler.fromJson( - _json['deployedAutoscaler'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('deployedFleet')) { - deployedFleet = DeployedFleet.fromJson( - _json['deployedFleet'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (deployedAutoscaler != null) { - _json['deployedAutoscaler'] = deployedAutoscaler.toJson(); - } - if (deployedFleet != null) { - _json['deployedFleet'] = deployedFleet.toJson(); - } - return _json; - } -} - -/// DeployedFleetStatus has details about the Agones fleets such as how many are -/// running, how many allocated, and so on. -class DeployedFleetStatus { - /// The number of GameServer replicas in the ALLOCATED state in this fleet. - core.String allocatedReplicas; - - /// The number of GameServer replicas in the READY state in this fleet. - core.String readyReplicas; - - /// The total number of current GameServer replicas in this fleet. - core.String replicas; - - /// The number of GameServer replicas in the RESERVED state in this fleet. - /// - /// Reserved instances won't be deleted on scale down, but won't cause an - /// autoscaler to scale up. - core.String reservedReplicas; - - DeployedFleetStatus(); - - DeployedFleetStatus.fromJson(core.Map _json) { - if (_json.containsKey('allocatedReplicas')) { - allocatedReplicas = _json['allocatedReplicas'] as core.String; - } - if (_json.containsKey('readyReplicas')) { - readyReplicas = _json['readyReplicas'] as core.String; - } - if (_json.containsKey('replicas')) { - replicas = _json['replicas'] as core.String; - } - if (_json.containsKey('reservedReplicas')) { - reservedReplicas = _json['reservedReplicas'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (allocatedReplicas != null) { - _json['allocatedReplicas'] = allocatedReplicas; - } - if (readyReplicas != null) { - _json['readyReplicas'] = readyReplicas; - } - if (replicas != null) { - _json['replicas'] = replicas; - } - if (reservedReplicas != null) { - _json['reservedReplicas'] = reservedReplicas; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Request message for GameServerDeploymentsService.FetchDeploymentState. -class FetchDeploymentStateRequest { - FetchDeploymentStateRequest(); - - FetchDeploymentStateRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Response message for GameServerDeploymentsService.FetchDeploymentState. -class FetchDeploymentStateResponse { - /// The state of the game server deployment in each game server cluster. - core.List<DeployedClusterState> clusterState; - - /// List of locations that could not be reached. - core.List<core.String> unavailable; - - FetchDeploymentStateResponse(); - - FetchDeploymentStateResponse.fromJson(core.Map _json) { - if (_json.containsKey('clusterState')) { - clusterState = (_json['clusterState'] as core.List) - .map<DeployedClusterState>((value) => DeployedClusterState.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('unavailable')) { - unavailable = (_json['unavailable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (clusterState != null) { - _json['clusterState'] = - clusterState.map((value) => value.toJson()).toList(); - } - if (unavailable != null) { - _json['unavailable'] = unavailable; - } - return _json; - } -} - -/// Fleet configs for Agones. -class FleetConfig { - /// Agones fleet spec. - /// - /// Example spec: `https://agones.dev/site/docs/reference/fleet/`. - core.String fleetSpec; - - /// The name of the FleetConfig. - core.String name; - - FleetConfig(); - - FleetConfig.fromJson(core.Map _json) { - if (_json.containsKey('fleetSpec')) { - fleetSpec = _json['fleetSpec'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fleetSpec != null) { - _json['fleetSpec'] = fleetSpec; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// A game server cluster resource. -class GameServerCluster { - /// The game server cluster connection information. - /// - /// This information is used to manage game server clusters. - GameServerClusterConnectionInfo connectionInfo; - - /// The creation time. - /// - /// Output only. - core.String createTime; - - /// Human readable description of the cluster. - core.String description; - - /// ETag of the resource. - core.String etag; - - /// The labels associated with this game server cluster. - /// - /// Each label is a key-value pair. - core.Map<core.String, core.String> labels; - - /// The resource name of the game server cluster. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. - /// For example, - /// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. - /// - /// Required. - core.String name; - - /// The last-modified time. - /// - /// Output only. - core.String updateTime; - - GameServerCluster(); - - GameServerCluster.fromJson(core.Map _json) { - if (_json.containsKey('connectionInfo')) { - connectionInfo = GameServerClusterConnectionInfo.fromJson( - _json['connectionInfo'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (connectionInfo != null) { - _json['connectionInfo'] = connectionInfo.toJson(); - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (etag != null) { - _json['etag'] = etag; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// The game server cluster connection information. -class GameServerClusterConnectionInfo { - /// Reference to the GKE cluster where the game servers are installed. - GkeClusterReference gkeClusterReference; - - /// Namespace designated on the game server cluster where the Agones game - /// server instances will be created. - /// - /// Existence of the namespace will be validated during creation. - core.String namespace; - - GameServerClusterConnectionInfo(); - - GameServerClusterConnectionInfo.fromJson(core.Map _json) { - if (_json.containsKey('gkeClusterReference')) { - gkeClusterReference = GkeClusterReference.fromJson( - _json['gkeClusterReference'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('namespace')) { - namespace = _json['namespace'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gkeClusterReference != null) { - _json['gkeClusterReference'] = gkeClusterReference.toJson(); - } - if (namespace != null) { - _json['namespace'] = namespace; - } - return _json; - } -} - -/// A game server config resource. -class GameServerConfig { - /// The creation time. - /// - /// Output only. - core.String createTime; - - /// The description of the game server config. - core.String description; - - /// FleetConfig contains a list of Agones fleet specs. - /// - /// Only one FleetConfig is allowed. - core.List<FleetConfig> fleetConfigs; - - /// The labels associated with this game server config. - /// - /// Each label is a key-value pair. - core.Map<core.String, core.String> labels; - - /// The resource name of the game server config. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. - core.String name; - - /// The autoscaling settings. - core.List<ScalingConfig> scalingConfigs; - - /// The last-modified time. - /// - /// Output only. - core.String updateTime; - - GameServerConfig(); - - GameServerConfig.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('fleetConfigs')) { - fleetConfigs = (_json['fleetConfigs'] as core.List) - .map<FleetConfig>((value) => FleetConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('scalingConfigs')) { - scalingConfigs = (_json['scalingConfigs'] as core.List) - .map<ScalingConfig>((value) => ScalingConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (fleetConfigs != null) { - _json['fleetConfigs'] = - fleetConfigs.map((value) => value.toJson()).toList(); - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (scalingConfigs != null) { - _json['scalingConfigs'] = - scalingConfigs.map((value) => value.toJson()).toList(); - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// A game server config override. -class GameServerConfigOverride { - /// The game server config for this override. - core.String configVersion; - - /// Selector for choosing applicable realms. - RealmSelector realmsSelector; - - GameServerConfigOverride(); - - GameServerConfigOverride.fromJson(core.Map _json) { - if (_json.containsKey('configVersion')) { - configVersion = _json['configVersion'] as core.String; - } - if (_json.containsKey('realmsSelector')) { - realmsSelector = RealmSelector.fromJson( - _json['realmsSelector'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (configVersion != null) { - _json['configVersion'] = configVersion; - } - if (realmsSelector != null) { - _json['realmsSelector'] = realmsSelector.toJson(); - } - return _json; - } -} - -/// A game server deployment resource. -class GameServerDeployment { - /// The creation time. - /// - /// Output only. - core.String createTime; - - /// Human readable description of the game server delpoyment. - core.String description; - - /// ETag of the resource. - core.String etag; - - /// The labels associated with this game server deployment. - /// - /// Each label is a key-value pair. - core.Map<core.String, core.String> labels; - - /// The resource name of the game server deployment. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-deployment`. - core.String name; - - /// The last-modified time. - /// - /// Output only. - core.String updateTime; - - GameServerDeployment(); - - GameServerDeployment.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (etag != null) { - _json['etag'] = etag; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// The game server deployment rollout which represents the desired rollout -/// state. -class GameServerDeploymentRollout { - /// The creation time. - /// - /// Output only. - core.String createTime; - - /// The default game server config is applied to all realms unless overridden - /// in the rollout. - /// - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. - core.String defaultGameServerConfig; - - /// ETag of the resource. - core.String etag; - - /// Contains the game server config rollout overrides. - /// - /// Overrides are processed in the order they are listed. Once a match is - /// found for a realm, the rest of the list is not processed. - core.List<GameServerConfigOverride> gameServerConfigOverrides; - - /// The resource name of the game server deployment rollout. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. - /// For example, - /// `projects/my-project/locations/global/gameServerDeployments/my-deployment/rollout`. - core.String name; - - /// The last-modified time. - /// - /// Output only. - core.String updateTime; - - GameServerDeploymentRollout(); - - GameServerDeploymentRollout.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('defaultGameServerConfig')) { - defaultGameServerConfig = _json['defaultGameServerConfig'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('gameServerConfigOverrides')) { - gameServerConfigOverrides = - (_json['gameServerConfigOverrides'] as core.List) - .map<GameServerConfigOverride>((value) => - GameServerConfigOverride.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (defaultGameServerConfig != null) { - _json['defaultGameServerConfig'] = defaultGameServerConfig; - } - if (etag != null) { - _json['etag'] = etag; - } - if (gameServerConfigOverrides != null) { - _json['gameServerConfigOverrides'] = - gameServerConfigOverrides.map((value) => value.toJson()).toList(); - } - if (name != null) { - _json['name'] = name; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// A reference to a GKE cluster. -class GkeClusterReference { - /// The full or partial name of a GKE cluster, using one of the following - /// forms: * `projects/{project}/locations/{location}/clusters/{cluster}` * - /// `locations/{location}/clusters/{cluster}` * `{cluster}` If project and - /// location are not specified, the project and location of the - /// GameServerCluster resource are used to generate the full name of the GKE - /// cluster. - core.String cluster; - - GkeClusterReference(); - - GkeClusterReference.fromJson(core.Map _json) { - if (_json.containsKey('cluster')) { - cluster = _json['cluster'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cluster != null) { - _json['cluster'] = cluster; - } - return _json; - } -} - -/// The label selector, used to group labels on the resources. -class LabelSelector { - /// Resource labels for this selector. - core.Map<core.String, core.String> labels; - - LabelSelector(); - - LabelSelector.fromJson(core.Map _json) { - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (labels != null) { - _json['labels'] = labels; - } - return _json; - } -} - -/// Response message for GameServerClustersService.ListGameServerClusters. -class ListGameServerClustersResponse { - /// The list of game server clusters. - core.List<GameServerCluster> gameServerClusters; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// List of locations that could not be reached. - core.List<core.String> unreachable; - - ListGameServerClustersResponse(); - - ListGameServerClustersResponse.fromJson(core.Map _json) { - if (_json.containsKey('gameServerClusters')) { - gameServerClusters = (_json['gameServerClusters'] as core.List) - .map<GameServerCluster>((value) => GameServerCluster.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gameServerClusters != null) { - _json['gameServerClusters'] = - gameServerClusters.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// Response message for GameServerConfigsService.ListGameServerConfigs. -class ListGameServerConfigsResponse { - /// The list of game server configs. - core.List<GameServerConfig> gameServerConfigs; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// List of locations that could not be reached. - core.List<core.String> unreachable; - - ListGameServerConfigsResponse(); - - ListGameServerConfigsResponse.fromJson(core.Map _json) { - if (_json.containsKey('gameServerConfigs')) { - gameServerConfigs = (_json['gameServerConfigs'] as core.List) - .map<GameServerConfig>((value) => GameServerConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gameServerConfigs != null) { - _json['gameServerConfigs'] = - gameServerConfigs.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// Response message for GameServerDeploymentsService.ListGameServerDeployments. -class ListGameServerDeploymentsResponse { - /// The list of game server deployments. - core.List<GameServerDeployment> gameServerDeployments; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// List of locations that could not be reached. - core.List<core.String> unreachable; - - ListGameServerDeploymentsResponse(); - - ListGameServerDeploymentsResponse.fromJson(core.Map _json) { - if (_json.containsKey('gameServerDeployments')) { - gameServerDeployments = (_json['gameServerDeployments'] as core.List) - .map<GameServerDeployment>((value) => GameServerDeployment.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gameServerDeployments != null) { - _json['gameServerDeployments'] = - gameServerDeployments.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response message for RealmsService.ListRealms. -class ListRealmsResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// The list of realms. - core.List<Realm> realms; - - /// List of locations that could not be reached. - core.List<core.String> unreachable; - - ListRealmsResponse(); - - ListRealmsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('realms')) { - realms = (_json['realms'] as core.List) - .map<Realm>((value) => - Realm.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (realms != null) { - _json['realms'] = realms.map((value) => value.toJson()).toList(); - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Specifies what kind of log the caller must write -class LogConfig { - /// Cloud audit options. - CloudAuditOptions cloudAudit; - - /// Counter options. - CounterOptions counter; - - /// Data access options. - DataAccessOptions dataAccess; - - LogConfig(); - - LogConfig.fromJson(core.Map _json) { - if (_json.containsKey('cloudAudit')) { - cloudAudit = CloudAuditOptions.fromJson( - _json['cloudAudit'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('counter')) { - counter = CounterOptions.fromJson( - _json['counter'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('dataAccess')) { - dataAccess = DataAccessOptions.fromJson( - _json['dataAccess'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cloudAudit != null) { - _json['cloudAudit'] = cloudAudit.toJson(); - } - if (counter != null) { - _json['counter'] = counter.toJson(); - } - if (dataAccess != null) { - _json['dataAccess'] = dataAccess.toJson(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Represents the metadata of the long-running operation. -class OperationMetadata { - /// API version used to start the operation. - /// - /// Output only. - core.String apiVersion; - - /// The time the operation was created. - /// - /// Output only. - core.String createTime; - - /// The time the operation finished running. - /// - /// Output only. - core.String endTime; - - /// Operation status for Game Services API operations. - /// - /// Operation status is in the form of key-value pairs where keys are resource - /// IDs and the values show the status of the operation. In case of failures, - /// the value includes an error code and error message. - /// - /// Output only. - core.Map<core.String, OperationStatus> operationStatus; - - /// Identifies whether the user has requested cancellation of the operation. - /// - /// Operations that have successfully been cancelled have Operation.error - /// value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Output only. - core.bool requestedCancellation; - - /// Human-readable status of the operation, if any. - /// - /// Output only. - core.String statusMessage; - - /// Server-defined resource path for the target of the operation. - /// - /// Output only. - core.String target; - - /// List of Locations that could not be reached. - /// - /// Output only. - core.List<core.String> unreachable; - - /// Name of the verb executed by the operation. - /// - /// Output only. - core.String verb; - - OperationMetadata(); - - OperationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('apiVersion')) { - apiVersion = _json['apiVersion'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('operationStatus')) { - operationStatus = (_json['operationStatus'] as core.Map) - .cast<core.String, core.Map>() - .map( - (key, item) => core.MapEntry( - key, - OperationStatus.fromJson( - item as core.Map<core.String, core.dynamic>), - ), - ); - } - if (_json.containsKey('requestedCancellation')) { - requestedCancellation = _json['requestedCancellation'] as core.bool; - } - if (_json.containsKey('statusMessage')) { - statusMessage = _json['statusMessage'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('verb')) { - verb = _json['verb'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiVersion != null) { - _json['apiVersion'] = apiVersion; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (operationStatus != null) { - _json['operationStatus'] = - operationStatus.map((key, item) => core.MapEntry(key, item.toJson())); - } - if (requestedCancellation != null) { - _json['requestedCancellation'] = requestedCancellation; - } - if (statusMessage != null) { - _json['statusMessage'] = statusMessage; - } - if (target != null) { - _json['target'] = target; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - if (verb != null) { - _json['verb'] = verb; - } - return _json; - } -} - -class OperationStatus { - /// Whether the operation is done or still in progress. - /// - /// Output only. - core.bool done; - - /// The error code in case of failures. - /// Possible string values are: - /// - "ERROR_CODE_UNSPECIFIED" - /// - "INTERNAL_ERROR" - /// - "PERMISSION_DENIED" - /// - "CLUSTER_CONNECTION" - core.String errorCode; - - /// The human-readable error message. - core.String errorMessage; - - OperationStatus(); - - OperationStatus.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('errorCode')) { - errorCode = _json['errorCode'] as core.String; - } - if (_json.containsKey('errorMessage')) { - errorMessage = _json['errorMessage'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (errorCode != null) { - _json['errorCode'] = errorCode; - } - if (errorMessage != null) { - _json['errorMessage'] = errorMessage; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Specifies cloud audit logging configuration for this policy. - core.List<AuditConfig> auditConfigs; - - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - core.bool iamOwned; - - /// If more than one rule is specified, the rules are applied in the following - /// manner: - All matching LOG rules are always applied. - /// - /// - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging - /// will be applied if one or more matching rule requires logging. - - /// Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is - /// granted. Logging will be applied if one or more matching rule requires - /// logging. - Otherwise, if no rule applies, permission is denied. - core.List<Rule> rules; - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('auditConfigs')) { - auditConfigs = (_json['auditConfigs'] as core.List) - .map<AuditConfig>((value) => AuditConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('iamOwned')) { - iamOwned = _json['iamOwned'] as core.bool; - } - if (_json.containsKey('rules')) { - rules = (_json['rules'] as core.List) - .map<Rule>((value) => - Rule.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (auditConfigs != null) { - _json['auditConfigs'] = - auditConfigs.map((value) => value.toJson()).toList(); - } - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (iamOwned != null) { - _json['iamOwned'] = iamOwned; - } - if (rules != null) { - _json['rules'] = rules.map((value) => value.toJson()).toList(); - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Response message for -/// GameServerClustersService.PreviewCreateGameServerCluster. -class PreviewCreateGameServerClusterResponse { - /// The ETag of the game server cluster. - core.String etag; - - /// The target state. - TargetState targetState; - - PreviewCreateGameServerClusterResponse(); - - PreviewCreateGameServerClusterResponse.fromJson(core.Map _json) { - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('targetState')) { - targetState = TargetState.fromJson( - _json['targetState'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (etag != null) { - _json['etag'] = etag; - } - if (targetState != null) { - _json['targetState'] = targetState.toJson(); - } - return _json; - } -} - -/// Response message for -/// GameServerClustersService.PreviewDeleteGameServerCluster. -class PreviewDeleteGameServerClusterResponse { - /// The ETag of the game server cluster. - core.String etag; - - /// The target state. - TargetState targetState; - - PreviewDeleteGameServerClusterResponse(); - - PreviewDeleteGameServerClusterResponse.fromJson(core.Map _json) { - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('targetState')) { - targetState = TargetState.fromJson( - _json['targetState'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (etag != null) { - _json['etag'] = etag; - } - if (targetState != null) { - _json['targetState'] = targetState.toJson(); - } - return _json; - } -} - -/// Response message for PreviewGameServerDeploymentRollout. -/// -/// This has details about the Agones fleet and autoscaler to be actuated. -class PreviewGameServerDeploymentRolloutResponse { - /// ETag of the game server deployment. - core.String etag; - - /// The target state. - TargetState targetState; - - /// Locations that could not be reached on this request. - core.List<core.String> unavailable; - - PreviewGameServerDeploymentRolloutResponse(); - - PreviewGameServerDeploymentRolloutResponse.fromJson(core.Map _json) { - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('targetState')) { - targetState = TargetState.fromJson( - _json['targetState'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('unavailable')) { - unavailable = (_json['unavailable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (etag != null) { - _json['etag'] = etag; - } - if (targetState != null) { - _json['targetState'] = targetState.toJson(); - } - if (unavailable != null) { - _json['unavailable'] = unavailable; - } - return _json; - } -} - -/// Response message for RealmsService.PreviewRealmUpdate. -class PreviewRealmUpdateResponse { - /// ETag of the realm. - core.String etag; - - /// The target state. - TargetState targetState; - - PreviewRealmUpdateResponse(); - - PreviewRealmUpdateResponse.fromJson(core.Map _json) { - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('targetState')) { - targetState = TargetState.fromJson( - _json['targetState'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (etag != null) { - _json['etag'] = etag; - } - if (targetState != null) { - _json['targetState'] = targetState.toJson(); - } - return _json; - } -} - -/// Response message for -/// GameServerClustersService.PreviewUpdateGameServerCluster -class PreviewUpdateGameServerClusterResponse { - /// The ETag of the game server cluster. - core.String etag; - - /// The target state. - TargetState targetState; - - PreviewUpdateGameServerClusterResponse(); - - PreviewUpdateGameServerClusterResponse.fromJson(core.Map _json) { - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('targetState')) { - targetState = TargetState.fromJson( - _json['targetState'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (etag != null) { - _json['etag'] = etag; - } - if (targetState != null) { - _json['targetState'] = targetState.toJson(); - } - return _json; - } -} - -/// A realm resource. -class Realm { - /// The creation time. - /// - /// Output only. - core.String createTime; - - /// Human readable description of the realm. - core.String description; - - /// ETag of the resource. - core.String etag; - - /// The labels associated with this realm. - /// - /// Each label is a key-value pair. - core.Map<core.String, core.String> labels; - - /// The resource name of the realm. - /// - /// Uses the form: `projects/{project}/locations/{location}/realms/{realm}`. - /// For example, `projects/my-project/locations/{location}/realms/my-realm`. - core.String name; - - /// Time zone where all policies targeting this realm are evaluated. - /// - /// The value of this field must be from the IANA time zone database: - /// https://www.iana.org/time-zones. - /// - /// Required. - core.String timeZone; - - /// The last-modified time. - /// - /// Output only. - core.String updateTime; - - Realm(); - - Realm.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('timeZone')) { - timeZone = _json['timeZone'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (etag != null) { - _json['etag'] = etag; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (timeZone != null) { - _json['timeZone'] = timeZone; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// The realm selector, used to match realm resources. -class RealmSelector { - /// List of realms to match. - core.List<core.String> realms; - - RealmSelector(); - - RealmSelector.fromJson(core.Map _json) { - if (_json.containsKey('realms')) { - realms = (_json['realms'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (realms != null) { - _json['realms'] = realms; - } - return _json; - } -} - -/// A rule to be applied in a Policy. -class Rule { - /// Required - /// Possible string values are: - /// - "NO_ACTION" : Default no action. - /// - "ALLOW" : Matching 'Entries' grant access. - /// - "ALLOW_WITH_LOG" : Matching 'Entries' grant access and the caller - /// promises to log the request per the returned log_configs. - /// - "DENY" : Matching 'Entries' deny access. - /// - "DENY_WITH_LOG" : Matching 'Entries' deny access and the caller promises - /// to log the request per the returned log_configs. - /// - "LOG" : Matching 'Entries' tell IAM.Check callers to generate logs. - core.String action; - - /// Additional restrictions that must be met. - /// - /// All conditions must pass for the rule to match. - core.List<Condition> conditions; - - /// Human-readable description of the rule. - core.String description; - - /// If one or more 'in' clauses are specified, the rule matches if the - /// PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - core.List<core.String> in_; - - /// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - /// that match the LOG action. - core.List<LogConfig> logConfig; - - /// If one or more 'not_in' clauses are specified, the rule matches if the - /// PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - /// - /// The format for in and not_in entries can be found at in the Local IAM - /// documentation (see go/local-iam#features). - core.List<core.String> notIn; - - /// A permission is a string of form '..' (e.g., 'storage.buckets.list'). - /// - /// A value of '*' matches all permissions, and a verb part of '*' (e.g., - /// 'storage.buckets.*') matches all verbs. - core.List<core.String> permissions; - - Rule(); - - Rule.fromJson(core.Map _json) { - if (_json.containsKey('action')) { - action = _json['action'] as core.String; - } - if (_json.containsKey('conditions')) { - conditions = (_json['conditions'] as core.List) - .map<Condition>((value) => - Condition.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('in')) { - in_ = (_json['in'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('logConfig')) { - logConfig = (_json['logConfig'] as core.List) - .map<LogConfig>((value) => - LogConfig.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('notIn')) { - notIn = (_json['notIn'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (action != null) { - _json['action'] = action; - } - if (conditions != null) { - _json['conditions'] = conditions.map((value) => value.toJson()).toList(); - } - if (description != null) { - _json['description'] = description; - } - if (in_ != null) { - _json['in'] = in_; - } - if (logConfig != null) { - _json['logConfig'] = logConfig.map((value) => value.toJson()).toList(); - } - if (notIn != null) { - _json['notIn'] = notIn; - } - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Autoscaling config for an Agones fleet. -class ScalingConfig { - /// Agones fleet autoscaler spec. - /// - /// Example spec: https://agones.dev/site/docs/reference/fleetautoscaler/ - /// - /// Required. - core.String fleetAutoscalerSpec; - - /// The name of the Scaling Config - /// - /// Required. - core.String name; - - /// The schedules to which this Scaling Config applies. - core.List<Schedule> schedules; - - /// Labels used to identify the game server clusters to which this Agones - /// scaling config applies. - /// - /// A game server cluster is subject to this Agones scaling config if its - /// labels match any of the selector entries. - core.List<LabelSelector> selectors; - - ScalingConfig(); - - ScalingConfig.fromJson(core.Map _json) { - if (_json.containsKey('fleetAutoscalerSpec')) { - fleetAutoscalerSpec = _json['fleetAutoscalerSpec'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('schedules')) { - schedules = (_json['schedules'] as core.List) - .map<Schedule>((value) => - Schedule.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('selectors')) { - selectors = (_json['selectors'] as core.List) - .map<LabelSelector>((value) => LabelSelector.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fleetAutoscalerSpec != null) { - _json['fleetAutoscalerSpec'] = fleetAutoscalerSpec; - } - if (name != null) { - _json['name'] = name; - } - if (schedules != null) { - _json['schedules'] = schedules.map((value) => value.toJson()).toList(); - } - if (selectors != null) { - _json['selectors'] = selectors.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The schedule of a recurring or one time event. -/// -/// The event's time span is specified by start_time and end_time. If the -/// scheduled event's timespan is larger than the cron_spec + cron_job_duration, -/// the event will be recurring. If only cron_spec + cron_job_duration are -/// specified, the event is effective starting at the local time specified by -/// cron_spec, and is recurring. start_time|-------\[cron job\]-------\[cron -/// job\]-------\[cron job\]---|end_time cron job: cron spec start time + -/// duration -class Schedule { - /// The duration for the cron job event. - /// - /// The duration of the event is effective after the cron job's start time. - core.String cronJobDuration; - - /// The cron definition of the scheduled event. - /// - /// See https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time - /// as defined by the realm. - core.String cronSpec; - - /// The end time of the event. - core.String endTime; - - /// The start time of the event. - core.String startTime; - - Schedule(); - - Schedule.fromJson(core.Map _json) { - if (_json.containsKey('cronJobDuration')) { - cronJobDuration = _json['cronJobDuration'] as core.String; - } - if (_json.containsKey('cronSpec')) { - cronSpec = _json['cronSpec'] as core.String; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('startTime')) { - startTime = _json['startTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cronJobDuration != null) { - _json['cronJobDuration'] = cronJobDuration; - } - if (cronSpec != null) { - _json['cronSpec'] = cronSpec; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (startTime != null) { - _json['startTime'] = startTime; - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. - /// - /// Only the fields in the mask will be modified. If no mask is provided, the - /// following default mask is used: `paths: "bindings, etag"` - core.String updateMask; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -/// Encapsulates Agones fleet spec and Agones autoscaler spec sources. -class SpecSource { - /// The game server config resource. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`. - core.String gameServerConfigName; - - /// The name of the Agones leet config or Agones scaling config used to derive - /// the Agones fleet or Agones autoscaler spec. - core.String name; - - SpecSource(); - - SpecSource.fromJson(core.Map _json) { - if (_json.containsKey('gameServerConfigName')) { - gameServerConfigName = _json['gameServerConfigName'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (gameServerConfigName != null) { - _json['gameServerConfigName'] = gameServerConfigName; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Details about the Agones resources. -class TargetDetails { - /// Agones fleet details for game server clusters and game server deployments. - core.List<TargetFleetDetails> fleetDetails; - - /// The game server cluster name. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. - core.String gameServerClusterName; - - /// The game server deployment name. - /// - /// Uses the form: - /// `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`. - core.String gameServerDeploymentName; - - TargetDetails(); - - TargetDetails.fromJson(core.Map _json) { - if (_json.containsKey('fleetDetails')) { - fleetDetails = (_json['fleetDetails'] as core.List) - .map<TargetFleetDetails>((value) => TargetFleetDetails.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('gameServerClusterName')) { - gameServerClusterName = _json['gameServerClusterName'] as core.String; - } - if (_json.containsKey('gameServerDeploymentName')) { - gameServerDeploymentName = - _json['gameServerDeploymentName'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (fleetDetails != null) { - _json['fleetDetails'] = - fleetDetails.map((value) => value.toJson()).toList(); - } - if (gameServerClusterName != null) { - _json['gameServerClusterName'] = gameServerClusterName; - } - if (gameServerDeploymentName != null) { - _json['gameServerDeploymentName'] = gameServerDeploymentName; - } - return _json; - } -} - -/// Target Agones fleet specification. -class TargetFleet { - /// The name of the Agones fleet. - core.String name; - - /// Encapsulates the source of the Agones fleet spec. - /// - /// The Agones fleet spec source. - SpecSource specSource; - - TargetFleet(); - - TargetFleet.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('specSource')) { - specSource = SpecSource.fromJson( - _json['specSource'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (specSource != null) { - _json['specSource'] = specSource.toJson(); - } - return _json; - } -} - -/// Target Agones autoscaler policy reference. -class TargetFleetAutoscaler { - /// The name of the Agones autoscaler. - core.String name; - - /// Encapsulates the source of the Agones fleet spec. - /// - /// Details about the Agones autoscaler spec. - SpecSource specSource; - - TargetFleetAutoscaler(); - - TargetFleetAutoscaler.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('specSource')) { - specSource = SpecSource.fromJson( - _json['specSource'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (specSource != null) { - _json['specSource'] = specSource.toJson(); - } - return _json; - } -} - -/// Details of the target Agones fleet. -class TargetFleetDetails { - /// Reference to target Agones fleet autoscaling policy. - TargetFleetAutoscaler autoscaler; - - /// Reference to target Agones fleet. - TargetFleet fleet; - - TargetFleetDetails(); - - TargetFleetDetails.fromJson(core.Map _json) { - if (_json.containsKey('autoscaler')) { - autoscaler = TargetFleetAutoscaler.fromJson( - _json['autoscaler'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('fleet')) { - fleet = TargetFleet.fromJson( - _json['fleet'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (autoscaler != null) { - _json['autoscaler'] = autoscaler.toJson(); - } - if (fleet != null) { - _json['fleet'] = fleet.toJson(); - } - return _json; - } -} - -/// Encapsulates the Target state. -class TargetState { - /// Details about Agones fleets. - core.List<TargetDetails> details; - - TargetState(); - - TargetState.fromJson(core.Map _json) { - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<TargetDetails>((value) => TargetDetails.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (details != null) { - _json['details'] = details.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/language/v1beta1.dart b/generated/googleapis_beta/lib/language/v1beta1.dart deleted file mode 100644 index 162d7b5..0000000 --- a/generated/googleapis_beta/lib/language/v1beta1.dart +++ /dev/null
@@ -1,1498 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Natural Language API - v1beta1 -/// -/// Provides natural language understanding technologies, such as sentiment -/// analysis, entity recognition, entity sentiment analysis, and other text -/// annotations, to developers. -/// -/// For more information, see <https://cloud.google.com/natural-language/> -/// -/// Create an instance of [CloudNaturalLanguageApi] to access these resources: -/// -/// - [DocumentsResource] -library language.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Provides natural language understanding technologies, such as sentiment -/// analysis, entity recognition, entity sentiment analysis, and other text -/// annotations, to developers. -class CloudNaturalLanguageApi { - /// Apply machine learning models to reveal the structure and meaning of text - static const cloudLanguageScope = - 'https://www.googleapis.com/auth/cloud-language'; - - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - DocumentsResource get documents => DocumentsResource(_requester); - - CloudNaturalLanguageApi(http.Client client, - {core.String rootUrl = 'https://language.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class DocumentsResource { - final commons.ApiRequester _requester; - - DocumentsResource(commons.ApiRequester client) : _requester = client; - - /// Finds named entities (currently proper names and common nouns) in the text - /// along with entity types, salience, mentions for each entity, and other - /// properties. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeEntitiesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeEntitiesResponse> analyzeEntities( - AnalyzeEntitiesRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/documents:analyzeEntities'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeEntitiesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Analyzes the sentiment of the provided text. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeSentimentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeSentimentResponse> analyzeSentiment( - AnalyzeSentimentRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/documents:analyzeSentiment'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeSentimentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Analyzes the syntax of the text and provides sentence boundaries and - /// tokenization along with part of speech tags, dependency trees, and other - /// properties. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeSyntaxResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeSyntaxResponse> analyzeSyntax( - AnalyzeSyntaxRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/documents:analyzeSyntax'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeSyntaxResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// A convenience method that provides all the features that analyzeSentiment, - /// analyzeEntities, and analyzeSyntax provide in one call. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnnotateTextResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnnotateTextResponse> annotateText( - AnnotateTextRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/documents:annotateText'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnnotateTextResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// The entity analysis request message. -class AnalyzeEntitiesRequest { - /// Input document. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and Javascript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeEntitiesRequest(); - - AnalyzeEntitiesRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The entity analysis response message. -class AnalyzeEntitiesResponse { - /// The recognized entities in the input document. - core.List<Entity> entities; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - AnalyzeEntitiesResponse(); - - AnalyzeEntitiesResponse.fromJson(core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<Entity>((value) => - Entity.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (language != null) { - _json['language'] = language; - } - return _json; - } -} - -/// The sentiment analysis request message. -class AnalyzeSentimentRequest { - /// Input document. - Document document; - - /// The encoding type used by the API to calculate sentence offsets for the - /// sentence sentiment. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and Javascript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeSentimentRequest(); - - AnalyzeSentimentRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The sentiment analysis response message. -class AnalyzeSentimentResponse { - /// The overall sentiment of the input document. - Sentiment documentSentiment; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// The sentiment for all the sentences in the document. - core.List<Sentence> sentences; - - AnalyzeSentimentResponse(); - - AnalyzeSentimentResponse.fromJson(core.Map _json) { - if (_json.containsKey('documentSentiment')) { - documentSentiment = Sentiment.fromJson( - _json['documentSentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (documentSentiment != null) { - _json['documentSentiment'] = documentSentiment.toJson(); - } - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The syntax analysis request message. -class AnalyzeSyntaxRequest { - /// Input document. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and Javascript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeSyntaxRequest(); - - AnalyzeSyntaxRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The syntax analysis response message. -class AnalyzeSyntaxResponse { - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// Sentences in the input document. - core.List<Sentence> sentences; - - /// Tokens, along with their syntactic information, in the input document. - core.List<Token> tokens; - - AnalyzeSyntaxResponse(); - - AnalyzeSyntaxResponse.fromJson(core.Map _json) { - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tokens')) { - tokens = (_json['tokens'] as core.List) - .map<Token>((value) => - Token.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - if (tokens != null) { - _json['tokens'] = tokens.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The request message for the text annotation API, which can perform multiple -/// analysis types (sentiment, entities, and syntax) in one call. -class AnnotateTextRequest { - /// Input document. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and Javascript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - /// The enabled features. - Features features; - - AnnotateTextRequest(); - - AnnotateTextRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - if (_json.containsKey('features')) { - features = Features.fromJson( - _json['features'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - if (features != null) { - _json['features'] = features.toJson(); - } - return _json; - } -} - -/// The text annotations response message. -class AnnotateTextResponse { - /// The overall sentiment for the document. - /// - /// Populated if the user enables - /// AnnotateTextRequest.Features.extract_document_sentiment. - Sentiment documentSentiment; - - /// Entities, along with their semantic information, in the input document. - /// - /// Populated if the user enables - /// AnnotateTextRequest.Features.extract_entities. - core.List<Entity> entities; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// Sentences in the input document. - /// - /// Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - core.List<Sentence> sentences; - - /// Tokens, along with their syntactic information, in the input document. - /// - /// Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - core.List<Token> tokens; - - AnnotateTextResponse(); - - AnnotateTextResponse.fromJson(core.Map _json) { - if (_json.containsKey('documentSentiment')) { - documentSentiment = Sentiment.fromJson( - _json['documentSentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<Entity>((value) => - Entity.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tokens')) { - tokens = (_json['tokens'] as core.List) - .map<Token>((value) => - Token.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (documentSentiment != null) { - _json['documentSentiment'] = documentSentiment.toJson(); - } - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - if (tokens != null) { - _json['tokens'] = tokens.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents dependency parse tree information for a token. -class DependencyEdge { - /// Represents the head of this token in the dependency tree. - /// - /// This is the index of the token which has an arc going to this token. The - /// index is the position of the token in the array of tokens returned by the - /// API method. If this token is a root token, then the `head_token_index` is - /// its own index. - core.int headTokenIndex; - - /// The parse label for the token. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "ABBREV" : Abbreviation modifier - /// - "ACOMP" : Adjectival complement - /// - "ADVCL" : Adverbial clause modifier - /// - "ADVMOD" : Adverbial modifier - /// - "AMOD" : Adjectival modifier of an NP - /// - "APPOS" : Appositional modifier of an NP - /// - "ATTR" : Attribute dependent of a copular verb - /// - "AUX" : Auxiliary (non-main) verb - /// - "AUXPASS" : Passive auxiliary - /// - "CC" : Coordinating conjunction - /// - "CCOMP" : Clausal complement of a verb or adjective - /// - "CONJ" : Conjunct - /// - "CSUBJ" : Clausal subject - /// - "CSUBJPASS" : Clausal passive subject - /// - "DEP" : Dependency (unable to determine) - /// - "DET" : Determiner - /// - "DISCOURSE" : Discourse - /// - "DOBJ" : Direct object - /// - "EXPL" : Expletive - /// - "GOESWITH" : Goes with (part of a word in a text not well edited) - /// - "IOBJ" : Indirect object - /// - "MARK" : Marker (word introducing a subordinate clause) - /// - "MWE" : Multi-word expression - /// - "MWV" : Multi-word verbal expression - /// - "NEG" : Negation modifier - /// - "NN" : Noun compound modifier - /// - "NPADVMOD" : Noun phrase used as an adverbial modifier - /// - "NSUBJ" : Nominal subject - /// - "NSUBJPASS" : Passive nominal subject - /// - "NUM" : Numeric modifier of a noun - /// - "NUMBER" : Element of compound number - /// - "P" : Punctuation mark - /// - "PARATAXIS" : Parataxis relation - /// - "PARTMOD" : Participial modifier - /// - "PCOMP" : The complement of a preposition is a clause - /// - "POBJ" : Object of a preposition - /// - "POSS" : Possession modifier - /// - "POSTNEG" : Postverbal negative particle - /// - "PRECOMP" : Predicate complement - /// - "PRECONJ" : Preconjunt - /// - "PREDET" : Predeterminer - /// - "PREF" : Prefix - /// - "PREP" : Prepositional modifier - /// - "PRONL" : The relationship between a verb and verbal morpheme - /// - "PRT" : Particle - /// - "PS" : Associative or possessive marker - /// - "QUANTMOD" : Quantifier phrase modifier - /// - "RCMOD" : Relative clause modifier - /// - "RCMODREL" : Complementizer in relative clause - /// - "RDROP" : Ellipsis without a preceding predicate - /// - "REF" : Referent - /// - "REMNANT" : Remnant - /// - "REPARANDUM" : Reparandum - /// - "ROOT" : Root - /// - "SNUM" : Suffix specifying a unit of number - /// - "SUFF" : Suffix - /// - "TMOD" : Temporal modifier - /// - "TOPIC" : Topic marker - /// - "VMOD" : Clause headed by an infinite form of the verb that modifies a - /// noun - /// - "VOCATIVE" : Vocative - /// - "XCOMP" : Open clausal complement - /// - "SUFFIX" : Name suffix - /// - "TITLE" : Name title - /// - "ADVPHMOD" : Adverbial phrase modifier - /// - "AUXCAUS" : Causative auxiliary - /// - "AUXVV" : Helper auxiliary - /// - "DTMOD" : Rentaishi (Prenominal modifier) - /// - "FOREIGN" : Foreign words - /// - "KW" : Keyword - /// - "LIST" : List for chains of comparable items - /// - "NOMC" : Nominalized clause - /// - "NOMCSUBJ" : Nominalized clausal subject - /// - "NOMCSUBJPASS" : Nominalized clausal passive - /// - "NUMC" : Compound of numeric modifier - /// - "COP" : Copula - /// - "DISLOCATED" : Dislocated relation (for fronted/topicalized elements) - /// - "ASP" : Aspect marker - /// - "GMOD" : Genitive modifier - /// - "GOBJ" : Genitive object - /// - "INFMOD" : Infinitival modifier - /// - "MES" : Measure - /// - "NCOMP" : Nominal complement of a noun - core.String label; - - DependencyEdge(); - - DependencyEdge.fromJson(core.Map _json) { - if (_json.containsKey('headTokenIndex')) { - headTokenIndex = _json['headTokenIndex'] as core.int; - } - if (_json.containsKey('label')) { - label = _json['label'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (headTokenIndex != null) { - _json['headTokenIndex'] = headTokenIndex; - } - if (label != null) { - _json['label'] = label; - } - return _json; - } -} - -/// ################################################################ # -/// Represents the input to API methods. -class Document { - /// The content of the input in string format. - /// - /// Cloud audit logging exempt since it is based on user data. - core.String content; - - /// The Google Cloud Storage URI where the file content is located. - /// - /// This URI must be of the form: gs://bucket_name/object_name. For more - /// details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: - /// Cloud Storage object versioning is not supported. - core.String gcsContentUri; - - /// The language of the document (if not specified, the language is - /// automatically detected). - /// - /// Both ISO and BCP-47 language codes are accepted. - /// [Language Support](https://cloud.google.com/natural-language/docs/languages) - /// lists currently supported languages for each API method. If the language - /// (either specified by the caller or automatically detected) is not - /// supported by the called API method, an `INVALID_ARGUMENT` error is - /// returned. - core.String language; - - /// If the type is not set or is `TYPE_UNSPECIFIED`, returns an - /// `INVALID_ARGUMENT` error. - /// - /// Required. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : The content type is not specified. - /// - "PLAIN_TEXT" : Plain text - /// - "HTML" : HTML - core.String type; - - Document(); - - Document.fromJson(core.Map _json) { - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - if (_json.containsKey('gcsContentUri')) { - gcsContentUri = _json['gcsContentUri'] as core.String; - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (content != null) { - _json['content'] = content; - } - if (gcsContentUri != null) { - _json['gcsContentUri'] = gcsContentUri; - } - if (language != null) { - _json['language'] = language; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a phrase in the text that is a known entity, such as a person, an -/// organization, or location. -/// -/// The API associates information, such as salience and mentions, with -/// entities. -class Entity { - /// The mentions of this entity in the input document. - /// - /// The API currently supports proper noun mentions. - core.List<EntityMention> mentions; - - /// Metadata associated with the entity. - /// - /// Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if - /// available. The associated keys are "wikipedia_url" and "mid", - /// respectively. - core.Map<core.String, core.String> metadata; - - /// The representative name for the entity. - core.String name; - - /// The salience score associated with the entity in the \[0, 1.0\] range. - /// - /// The salience score for an entity provides information about the importance - /// or centrality of that entity to the entire document text. Scores closer to - /// 0 are less salient, while scores closer to 1.0 are highly salient. - core.double salience; - - /// The entity type. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "PERSON" : Person - /// - "LOCATION" : Location - /// - "ORGANIZATION" : Organization - /// - "EVENT" : Event - /// - "WORK_OF_ART" : Work of art - /// - "CONSUMER_GOOD" : Consumer goods - /// - "OTHER" : Other types - core.String type; - - Entity(); - - Entity.fromJson(core.Map _json) { - if (_json.containsKey('mentions')) { - mentions = (_json['mentions'] as core.List) - .map<EntityMention>((value) => EntityMention.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('salience')) { - salience = (_json['salience'] as core.num).toDouble(); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mentions != null) { - _json['mentions'] = mentions.map((value) => value.toJson()).toList(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (salience != null) { - _json['salience'] = salience; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a mention for an entity in the text. -/// -/// Currently, proper noun mentions are supported. -class EntityMention { - /// The mention text. - TextSpan text; - - /// The type of the entity mention. - /// Possible string values are: - /// - "TYPE_UNKNOWN" : Unknown - /// - "PROPER" : Proper name - /// - "COMMON" : Common noun (or noun compound) - core.String type; - - EntityMention(); - - EntityMention.fromJson(core.Map _json) { - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (text != null) { - _json['text'] = text.toJson(); - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// All available features for sentiment, syntax, and semantic analysis. -/// -/// Setting each one to true will enable that specific analysis for the input. -class Features { - /// Extract document-level sentiment. - core.bool extractDocumentSentiment; - - /// Extract entities. - core.bool extractEntities; - - /// Extract syntax information. - core.bool extractSyntax; - - Features(); - - Features.fromJson(core.Map _json) { - if (_json.containsKey('extractDocumentSentiment')) { - extractDocumentSentiment = _json['extractDocumentSentiment'] as core.bool; - } - if (_json.containsKey('extractEntities')) { - extractEntities = _json['extractEntities'] as core.bool; - } - if (_json.containsKey('extractSyntax')) { - extractSyntax = _json['extractSyntax'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (extractDocumentSentiment != null) { - _json['extractDocumentSentiment'] = extractDocumentSentiment; - } - if (extractEntities != null) { - _json['extractEntities'] = extractEntities; - } - if (extractSyntax != null) { - _json['extractSyntax'] = extractSyntax; - } - return _json; - } -} - -/// Represents part of speech information for a token. -class PartOfSpeech { - /// The grammatical aspect. - /// Possible string values are: - /// - "ASPECT_UNKNOWN" : Aspect is not applicable in the analyzed language or - /// is not predicted. - /// - "PERFECTIVE" : Perfective - /// - "IMPERFECTIVE" : Imperfective - /// - "PROGRESSIVE" : Progressive - core.String aspect; - - /// The grammatical case. - /// Possible string values are: - /// - "CASE_UNKNOWN" : Case is not applicable in the analyzed language or is - /// not predicted. - /// - "ACCUSATIVE" : Accusative - /// - "ADVERBIAL" : Adverbial - /// - "COMPLEMENTIVE" : Complementive - /// - "DATIVE" : Dative - /// - "GENITIVE" : Genitive - /// - "INSTRUMENTAL" : Instrumental - /// - "LOCATIVE" : Locative - /// - "NOMINATIVE" : Nominative - /// - "OBLIQUE" : Oblique - /// - "PARTITIVE" : Partitive - /// - "PREPOSITIONAL" : Prepositional - /// - "REFLEXIVE_CASE" : Reflexive - /// - "RELATIVE_CASE" : Relative - /// - "VOCATIVE" : Vocative - core.String case_; - - /// The grammatical form. - /// Possible string values are: - /// - "FORM_UNKNOWN" : Form is not applicable in the analyzed language or is - /// not predicted. - /// - "ADNOMIAL" : Adnomial - /// - "AUXILIARY" : Auxiliary - /// - "COMPLEMENTIZER" : Complementizer - /// - "FINAL_ENDING" : Final ending - /// - "GERUND" : Gerund - /// - "REALIS" : Realis - /// - "IRREALIS" : Irrealis - /// - "SHORT" : Short form - /// - "LONG" : Long form - /// - "ORDER" : Order form - /// - "SPECIFIC" : Specific form - core.String form; - - /// The grammatical gender. - /// Possible string values are: - /// - "GENDER_UNKNOWN" : Gender is not applicable in the analyzed language or - /// is not predicted. - /// - "FEMININE" : Feminine - /// - "MASCULINE" : Masculine - /// - "NEUTER" : Neuter - core.String gender; - - /// The grammatical mood. - /// Possible string values are: - /// - "MOOD_UNKNOWN" : Mood is not applicable in the analyzed language or is - /// not predicted. - /// - "CONDITIONAL_MOOD" : Conditional - /// - "IMPERATIVE" : Imperative - /// - "INDICATIVE" : Indicative - /// - "INTERROGATIVE" : Interrogative - /// - "JUSSIVE" : Jussive - /// - "SUBJUNCTIVE" : Subjunctive - core.String mood; - - /// The grammatical number. - /// Possible string values are: - /// - "NUMBER_UNKNOWN" : Number is not applicable in the analyzed language or - /// is not predicted. - /// - "SINGULAR" : Singular - /// - "PLURAL" : Plural - /// - "DUAL" : Dual - core.String number; - - /// The grammatical person. - /// Possible string values are: - /// - "PERSON_UNKNOWN" : Person is not applicable in the analyzed language or - /// is not predicted. - /// - "FIRST" : First - /// - "SECOND" : Second - /// - "THIRD" : Third - /// - "REFLEXIVE_PERSON" : Reflexive - core.String person; - - /// The grammatical properness. - /// Possible string values are: - /// - "PROPER_UNKNOWN" : Proper is not applicable in the analyzed language or - /// is not predicted. - /// - "PROPER" : Proper - /// - "NOT_PROPER" : Not proper - core.String proper; - - /// The grammatical reciprocity. - /// Possible string values are: - /// - "RECIPROCITY_UNKNOWN" : Reciprocity is not applicable in the analyzed - /// language or is not predicted. - /// - "RECIPROCAL" : Reciprocal - /// - "NON_RECIPROCAL" : Non-reciprocal - core.String reciprocity; - - /// The part of speech tag. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "ADJ" : Adjective - /// - "ADP" : Adposition (preposition and postposition) - /// - "ADV" : Adverb - /// - "CONJ" : Conjunction - /// - "DET" : Determiner - /// - "NOUN" : Noun (common and proper) - /// - "NUM" : Cardinal number - /// - "PRON" : Pronoun - /// - "PRT" : Particle or other function word - /// - "PUNCT" : Punctuation - /// - "VERB" : Verb (all tenses and modes) - /// - "X" : Other: foreign words, typos, abbreviations - /// - "AFFIX" : Affix - core.String tag; - - /// The grammatical tense. - /// Possible string values are: - /// - "TENSE_UNKNOWN" : Tense is not applicable in the analyzed language or is - /// not predicted. - /// - "CONDITIONAL_TENSE" : Conditional - /// - "FUTURE" : Future - /// - "PAST" : Past - /// - "PRESENT" : Present - /// - "IMPERFECT" : Imperfect - /// - "PLUPERFECT" : Pluperfect - core.String tense; - - /// The grammatical voice. - /// Possible string values are: - /// - "VOICE_UNKNOWN" : Voice is not applicable in the analyzed language or is - /// not predicted. - /// - "ACTIVE" : Active - /// - "CAUSATIVE" : Causative - /// - "PASSIVE" : Passive - core.String voice; - - PartOfSpeech(); - - PartOfSpeech.fromJson(core.Map _json) { - if (_json.containsKey('aspect')) { - aspect = _json['aspect'] as core.String; - } - if (_json.containsKey('case')) { - case_ = _json['case'] as core.String; - } - if (_json.containsKey('form')) { - form = _json['form'] as core.String; - } - if (_json.containsKey('gender')) { - gender = _json['gender'] as core.String; - } - if (_json.containsKey('mood')) { - mood = _json['mood'] as core.String; - } - if (_json.containsKey('number')) { - number = _json['number'] as core.String; - } - if (_json.containsKey('person')) { - person = _json['person'] as core.String; - } - if (_json.containsKey('proper')) { - proper = _json['proper'] as core.String; - } - if (_json.containsKey('reciprocity')) { - reciprocity = _json['reciprocity'] as core.String; - } - if (_json.containsKey('tag')) { - tag = _json['tag'] as core.String; - } - if (_json.containsKey('tense')) { - tense = _json['tense'] as core.String; - } - if (_json.containsKey('voice')) { - voice = _json['voice'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (aspect != null) { - _json['aspect'] = aspect; - } - if (case_ != null) { - _json['case'] = case_; - } - if (form != null) { - _json['form'] = form; - } - if (gender != null) { - _json['gender'] = gender; - } - if (mood != null) { - _json['mood'] = mood; - } - if (number != null) { - _json['number'] = number; - } - if (person != null) { - _json['person'] = person; - } - if (proper != null) { - _json['proper'] = proper; - } - if (reciprocity != null) { - _json['reciprocity'] = reciprocity; - } - if (tag != null) { - _json['tag'] = tag; - } - if (tense != null) { - _json['tense'] = tense; - } - if (voice != null) { - _json['voice'] = voice; - } - return _json; - } -} - -/// Represents a sentence in the input document. -class Sentence { - /// For calls to AnalyzeSentiment or if - /// AnnotateTextRequest.Features.extract_document_sentiment is set to true, - /// this field will contain the sentiment for the sentence. - Sentiment sentiment; - - /// The sentence text. - TextSpan text; - - Sentence(); - - Sentence.fromJson(core.Map _json) { - if (_json.containsKey('sentiment')) { - sentiment = Sentiment.fromJson( - _json['sentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (sentiment != null) { - _json['sentiment'] = sentiment.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// Represents the feeling associated with the entire text or entities in the -/// text. -class Sentiment { - /// A non-negative number in the \[0, +inf) range, which represents the - /// absolute magnitude of sentiment regardless of score (positive or - /// negative). - core.double magnitude; - - /// DEPRECATED FIELD - This field is being deprecated in favor of score. - /// - /// Please refer to our documentation at - /// https://cloud.google.com/natural-language/docs for more information. - core.double polarity; - - /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - /// sentiment). - core.double score; - - Sentiment(); - - Sentiment.fromJson(core.Map _json) { - if (_json.containsKey('magnitude')) { - magnitude = (_json['magnitude'] as core.num).toDouble(); - } - if (_json.containsKey('polarity')) { - polarity = (_json['polarity'] as core.num).toDouble(); - } - if (_json.containsKey('score')) { - score = (_json['score'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (magnitude != null) { - _json['magnitude'] = magnitude; - } - if (polarity != null) { - _json['polarity'] = polarity; - } - if (score != null) { - _json['score'] = score; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Represents an output piece of text. -class TextSpan { - /// The API calculates the beginning offset of the content in the original - /// document according to the EncodingType specified in the API request. - core.int beginOffset; - - /// The content of the output text. - core.String content; - - TextSpan(); - - TextSpan.fromJson(core.Map _json) { - if (_json.containsKey('beginOffset')) { - beginOffset = _json['beginOffset'] as core.int; - } - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (beginOffset != null) { - _json['beginOffset'] = beginOffset; - } - if (content != null) { - _json['content'] = content; - } - return _json; - } -} - -/// Represents the smallest syntactic building block of the text. -class Token { - /// Dependency tree parse for this token. - DependencyEdge dependencyEdge; - - /// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the - /// token. - core.String lemma; - - /// Parts of speech tag for this token. - PartOfSpeech partOfSpeech; - - /// The token text. - TextSpan text; - - Token(); - - Token.fromJson(core.Map _json) { - if (_json.containsKey('dependencyEdge')) { - dependencyEdge = DependencyEdge.fromJson( - _json['dependencyEdge'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('lemma')) { - lemma = _json['lemma'] as core.String; - } - if (_json.containsKey('partOfSpeech')) { - partOfSpeech = PartOfSpeech.fromJson( - _json['partOfSpeech'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (dependencyEdge != null) { - _json['dependencyEdge'] = dependencyEdge.toJson(); - } - if (lemma != null) { - _json['lemma'] = lemma; - } - if (partOfSpeech != null) { - _json['partOfSpeech'] = partOfSpeech.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/language/v1beta2.dart b/generated/googleapis_beta/lib/language/v1beta2.dart deleted file mode 100644 index 626908f..0000000 --- a/generated/googleapis_beta/lib/language/v1beta2.dart +++ /dev/null
@@ -1,1881 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Natural Language API - v1beta2 -/// -/// Provides natural language understanding technologies, such as sentiment -/// analysis, entity recognition, entity sentiment analysis, and other text -/// annotations, to developers. -/// -/// For more information, see <https://cloud.google.com/natural-language/> -/// -/// Create an instance of [CloudNaturalLanguageApi] to access these resources: -/// -/// - [DocumentsResource] -library language.v1beta2; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Provides natural language understanding technologies, such as sentiment -/// analysis, entity recognition, entity sentiment analysis, and other text -/// annotations, to developers. -class CloudNaturalLanguageApi { - /// Apply machine learning models to reveal the structure and meaning of text - static const cloudLanguageScope = - 'https://www.googleapis.com/auth/cloud-language'; - - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - DocumentsResource get documents => DocumentsResource(_requester); - - CloudNaturalLanguageApi(http.Client client, - {core.String rootUrl = 'https://language.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class DocumentsResource { - final commons.ApiRequester _requester; - - DocumentsResource(commons.ApiRequester client) : _requester = client; - - /// Finds named entities (currently proper names and common nouns) in the text - /// along with entity types, salience, mentions for each entity, and other - /// properties. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeEntitiesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeEntitiesResponse> analyzeEntities( - AnalyzeEntitiesRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:analyzeEntities'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeEntitiesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Finds entities, similar to AnalyzeEntities in the text and analyzes - /// sentiment associated with each entity and its mentions. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeEntitySentimentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeEntitySentimentResponse> analyzeEntitySentiment( - AnalyzeEntitySentimentRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:analyzeEntitySentiment'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeEntitySentimentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Analyzes the sentiment of the provided text. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeSentimentResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeSentimentResponse> analyzeSentiment( - AnalyzeSentimentRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:analyzeSentiment'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeSentimentResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Analyzes the syntax of the text and provides sentence boundaries and - /// tokenization along with part of speech tags, dependency trees, and other - /// properties. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnalyzeSyntaxResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnalyzeSyntaxResponse> analyzeSyntax( - AnalyzeSyntaxRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:analyzeSyntax'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnalyzeSyntaxResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// A convenience method that provides all syntax, sentiment, entity, and - /// classification features in one call. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AnnotateTextResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AnnotateTextResponse> annotateText( - AnnotateTextRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:annotateText'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => AnnotateTextResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Classifies a document into categories. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ClassifyTextResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ClassifyTextResponse> classifyText( - ClassifyTextRequest request, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/documents:classifyText'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ClassifyTextResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// The entity analysis request message. -class AnalyzeEntitiesRequest { - /// Input document. - /// - /// Required. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and JavaScript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeEntitiesRequest(); - - AnalyzeEntitiesRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The entity analysis response message. -class AnalyzeEntitiesResponse { - /// The recognized entities in the input document. - core.List<Entity> entities; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - AnalyzeEntitiesResponse(); - - AnalyzeEntitiesResponse.fromJson(core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<Entity>((value) => - Entity.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (language != null) { - _json['language'] = language; - } - return _json; - } -} - -/// The entity-level sentiment analysis request message. -class AnalyzeEntitySentimentRequest { - /// Input document. - /// - /// Required. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and JavaScript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeEntitySentimentRequest(); - - AnalyzeEntitySentimentRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The entity-level sentiment analysis response message. -class AnalyzeEntitySentimentResponse { - /// The recognized entities in the input document with associated sentiments. - core.List<Entity> entities; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - AnalyzeEntitySentimentResponse(); - - AnalyzeEntitySentimentResponse.fromJson(core.Map _json) { - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<Entity>((value) => - Entity.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (language != null) { - _json['language'] = language; - } - return _json; - } -} - -/// The sentiment analysis request message. -class AnalyzeSentimentRequest { - /// Input document. - /// - /// Required. - Document document; - - /// The encoding type used by the API to calculate sentence offsets for the - /// sentence sentiment. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and JavaScript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeSentimentRequest(); - - AnalyzeSentimentRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The sentiment analysis response message. -class AnalyzeSentimentResponse { - /// The overall sentiment of the input document. - Sentiment documentSentiment; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// The sentiment for all the sentences in the document. - core.List<Sentence> sentences; - - AnalyzeSentimentResponse(); - - AnalyzeSentimentResponse.fromJson(core.Map _json) { - if (_json.containsKey('documentSentiment')) { - documentSentiment = Sentiment.fromJson( - _json['documentSentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (documentSentiment != null) { - _json['documentSentiment'] = documentSentiment.toJson(); - } - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The syntax analysis request message. -class AnalyzeSyntaxRequest { - /// Input document. - /// - /// Required. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and JavaScript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - AnalyzeSyntaxRequest(); - - AnalyzeSyntaxRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - return _json; - } -} - -/// The syntax analysis response message. -class AnalyzeSyntaxResponse { - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// Sentences in the input document. - core.List<Sentence> sentences; - - /// Tokens, along with their syntactic information, in the input document. - core.List<Token> tokens; - - AnalyzeSyntaxResponse(); - - AnalyzeSyntaxResponse.fromJson(core.Map _json) { - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tokens')) { - tokens = (_json['tokens'] as core.List) - .map<Token>((value) => - Token.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - if (tokens != null) { - _json['tokens'] = tokens.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// The request message for the text annotation API, which can perform multiple -/// analysis types (sentiment, entities, and syntax) in one call. -class AnnotateTextRequest { - /// Input document. - /// - /// Required. - Document document; - - /// The encoding type used by the API to calculate offsets. - /// Possible string values are: - /// - "NONE" : If `EncodingType` is not specified, encoding-dependent - /// information (such as `begin_offset`) will be set at `-1`. - /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-8 encoding of the input. C++ and Go are - /// examples of languages that use this encoding natively. - /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-16 encoding of the input. Java and JavaScript - /// are examples of languages that use this encoding natively. - /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is - /// calculated based on the UTF-32 encoding of the input. Python is an example - /// of a language that uses this encoding natively. - core.String encodingType; - - /// The enabled features. - /// - /// Required. - Features features; - - AnnotateTextRequest(); - - AnnotateTextRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('encodingType')) { - encodingType = _json['encodingType'] as core.String; - } - if (_json.containsKey('features')) { - features = Features.fromJson( - _json['features'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - if (encodingType != null) { - _json['encodingType'] = encodingType; - } - if (features != null) { - _json['features'] = features.toJson(); - } - return _json; - } -} - -/// The text annotations response message. -class AnnotateTextResponse { - /// Categories identified in the input document. - core.List<ClassificationCategory> categories; - - /// The overall sentiment for the document. - /// - /// Populated if the user enables - /// AnnotateTextRequest.Features.extract_document_sentiment. - Sentiment documentSentiment; - - /// Entities, along with their semantic information, in the input document. - /// - /// Populated if the user enables - /// AnnotateTextRequest.Features.extract_entities. - core.List<Entity> entities; - - /// The language of the text, which will be the same as the language specified - /// in the request or, if not specified, the automatically-detected language. - /// - /// See Document.language field for more details. - core.String language; - - /// Sentences in the input document. - /// - /// Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - core.List<Sentence> sentences; - - /// Tokens, along with their syntactic information, in the input document. - /// - /// Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - core.List<Token> tokens; - - AnnotateTextResponse(); - - AnnotateTextResponse.fromJson(core.Map _json) { - if (_json.containsKey('categories')) { - categories = (_json['categories'] as core.List) - .map<ClassificationCategory>((value) => - ClassificationCategory.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('documentSentiment')) { - documentSentiment = Sentiment.fromJson( - _json['documentSentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('entities')) { - entities = (_json['entities'] as core.List) - .map<Entity>((value) => - Entity.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('sentences')) { - sentences = (_json['sentences'] as core.List) - .map<Sentence>((value) => - Sentence.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tokens')) { - tokens = (_json['tokens'] as core.List) - .map<Token>((value) => - Token.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (categories != null) { - _json['categories'] = categories.map((value) => value.toJson()).toList(); - } - if (documentSentiment != null) { - _json['documentSentiment'] = documentSentiment.toJson(); - } - if (entities != null) { - _json['entities'] = entities.map((value) => value.toJson()).toList(); - } - if (language != null) { - _json['language'] = language; - } - if (sentences != null) { - _json['sentences'] = sentences.map((value) => value.toJson()).toList(); - } - if (tokens != null) { - _json['tokens'] = tokens.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents a category returned from the text classifier. -class ClassificationCategory { - /// The classifier's confidence of the category. - /// - /// Number represents how certain the classifier is that this category - /// represents the given text. - core.double confidence; - - /// The name of the category representing the document, from the - /// [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories). - core.String name; - - ClassificationCategory(); - - ClassificationCategory.fromJson(core.Map _json) { - if (_json.containsKey('confidence')) { - confidence = (_json['confidence'] as core.num).toDouble(); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (confidence != null) { - _json['confidence'] = confidence; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// The document classification request message. -class ClassifyTextRequest { - /// Input document. - /// - /// Required. - Document document; - - ClassifyTextRequest(); - - ClassifyTextRequest.fromJson(core.Map _json) { - if (_json.containsKey('document')) { - document = Document.fromJson( - _json['document'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (document != null) { - _json['document'] = document.toJson(); - } - return _json; - } -} - -/// The document classification response message. -class ClassifyTextResponse { - /// Categories representing the input document. - core.List<ClassificationCategory> categories; - - ClassifyTextResponse(); - - ClassifyTextResponse.fromJson(core.Map _json) { - if (_json.containsKey('categories')) { - categories = (_json['categories'] as core.List) - .map<ClassificationCategory>((value) => - ClassificationCategory.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (categories != null) { - _json['categories'] = categories.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Represents dependency parse tree information for a token. -class DependencyEdge { - /// Represents the head of this token in the dependency tree. - /// - /// This is the index of the token which has an arc going to this token. The - /// index is the position of the token in the array of tokens returned by the - /// API method. If this token is a root token, then the `head_token_index` is - /// its own index. - core.int headTokenIndex; - - /// The parse label for the token. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "ABBREV" : Abbreviation modifier - /// - "ACOMP" : Adjectival complement - /// - "ADVCL" : Adverbial clause modifier - /// - "ADVMOD" : Adverbial modifier - /// - "AMOD" : Adjectival modifier of an NP - /// - "APPOS" : Appositional modifier of an NP - /// - "ATTR" : Attribute dependent of a copular verb - /// - "AUX" : Auxiliary (non-main) verb - /// - "AUXPASS" : Passive auxiliary - /// - "CC" : Coordinating conjunction - /// - "CCOMP" : Clausal complement of a verb or adjective - /// - "CONJ" : Conjunct - /// - "CSUBJ" : Clausal subject - /// - "CSUBJPASS" : Clausal passive subject - /// - "DEP" : Dependency (unable to determine) - /// - "DET" : Determiner - /// - "DISCOURSE" : Discourse - /// - "DOBJ" : Direct object - /// - "EXPL" : Expletive - /// - "GOESWITH" : Goes with (part of a word in a text not well edited) - /// - "IOBJ" : Indirect object - /// - "MARK" : Marker (word introducing a subordinate clause) - /// - "MWE" : Multi-word expression - /// - "MWV" : Multi-word verbal expression - /// - "NEG" : Negation modifier - /// - "NN" : Noun compound modifier - /// - "NPADVMOD" : Noun phrase used as an adverbial modifier - /// - "NSUBJ" : Nominal subject - /// - "NSUBJPASS" : Passive nominal subject - /// - "NUM" : Numeric modifier of a noun - /// - "NUMBER" : Element of compound number - /// - "P" : Punctuation mark - /// - "PARATAXIS" : Parataxis relation - /// - "PARTMOD" : Participial modifier - /// - "PCOMP" : The complement of a preposition is a clause - /// - "POBJ" : Object of a preposition - /// - "POSS" : Possession modifier - /// - "POSTNEG" : Postverbal negative particle - /// - "PRECOMP" : Predicate complement - /// - "PRECONJ" : Preconjunt - /// - "PREDET" : Predeterminer - /// - "PREF" : Prefix - /// - "PREP" : Prepositional modifier - /// - "PRONL" : The relationship between a verb and verbal morpheme - /// - "PRT" : Particle - /// - "PS" : Associative or possessive marker - /// - "QUANTMOD" : Quantifier phrase modifier - /// - "RCMOD" : Relative clause modifier - /// - "RCMODREL" : Complementizer in relative clause - /// - "RDROP" : Ellipsis without a preceding predicate - /// - "REF" : Referent - /// - "REMNANT" : Remnant - /// - "REPARANDUM" : Reparandum - /// - "ROOT" : Root - /// - "SNUM" : Suffix specifying a unit of number - /// - "SUFF" : Suffix - /// - "TMOD" : Temporal modifier - /// - "TOPIC" : Topic marker - /// - "VMOD" : Clause headed by an infinite form of the verb that modifies a - /// noun - /// - "VOCATIVE" : Vocative - /// - "XCOMP" : Open clausal complement - /// - "SUFFIX" : Name suffix - /// - "TITLE" : Name title - /// - "ADVPHMOD" : Adverbial phrase modifier - /// - "AUXCAUS" : Causative auxiliary - /// - "AUXVV" : Helper auxiliary - /// - "DTMOD" : Rentaishi (Prenominal modifier) - /// - "FOREIGN" : Foreign words - /// - "KW" : Keyword - /// - "LIST" : List for chains of comparable items - /// - "NOMC" : Nominalized clause - /// - "NOMCSUBJ" : Nominalized clausal subject - /// - "NOMCSUBJPASS" : Nominalized clausal passive - /// - "NUMC" : Compound of numeric modifier - /// - "COP" : Copula - /// - "DISLOCATED" : Dislocated relation (for fronted/topicalized elements) - /// - "ASP" : Aspect marker - /// - "GMOD" : Genitive modifier - /// - "GOBJ" : Genitive object - /// - "INFMOD" : Infinitival modifier - /// - "MES" : Measure - /// - "NCOMP" : Nominal complement of a noun - core.String label; - - DependencyEdge(); - - DependencyEdge.fromJson(core.Map _json) { - if (_json.containsKey('headTokenIndex')) { - headTokenIndex = _json['headTokenIndex'] as core.int; - } - if (_json.containsKey('label')) { - label = _json['label'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (headTokenIndex != null) { - _json['headTokenIndex'] = headTokenIndex; - } - if (label != null) { - _json['label'] = label; - } - return _json; - } -} - -/// ################################################################ # -/// Represents the input to API methods. -class Document { - /// Indicates how detected boilerplate(e.g. advertisements, copyright - /// declarations, banners) should be handled for this document. - /// - /// If not specified, boilerplate will be treated the same as content. - /// Possible string values are: - /// - "BOILERPLATE_HANDLING_UNSPECIFIED" : The boilerplate handling is not - /// specified. - /// - "SKIP_BOILERPLATE" : Do not analyze detected boilerplate. Reference web - /// URI is required for detecting boilerplate. - /// - "KEEP_BOILERPLATE" : Treat boilerplate the same as content. - core.String boilerplateHandling; - - /// The content of the input in string format. - /// - /// Cloud audit logging exempt since it is based on user data. - core.String content; - - /// The Google Cloud Storage URI where the file content is located. - /// - /// This URI must be of the form: gs://bucket_name/object_name. For more - /// details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: - /// Cloud Storage object versioning is not supported. - core.String gcsContentUri; - - /// The language of the document (if not specified, the language is - /// automatically detected). - /// - /// Both ISO and BCP-47 language codes are accepted. - /// [Language Support](https://cloud.google.com/natural-language/docs/languages) - /// lists currently supported languages for each API method. If the language - /// (either specified by the caller or automatically detected) is not - /// supported by the called API method, an `INVALID_ARGUMENT` error is - /// returned. - core.String language; - - /// The web URI where the document comes from. - /// - /// This URI is not used for fetching the content, but as a hint for analyzing - /// the document. - core.String referenceWebUri; - - /// If the type is not set or is `TYPE_UNSPECIFIED`, returns an - /// `INVALID_ARGUMENT` error. - /// - /// Required. - /// Possible string values are: - /// - "TYPE_UNSPECIFIED" : The content type is not specified. - /// - "PLAIN_TEXT" : Plain text - /// - "HTML" : HTML - core.String type; - - Document(); - - Document.fromJson(core.Map _json) { - if (_json.containsKey('boilerplateHandling')) { - boilerplateHandling = _json['boilerplateHandling'] as core.String; - } - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - if (_json.containsKey('gcsContentUri')) { - gcsContentUri = _json['gcsContentUri'] as core.String; - } - if (_json.containsKey('language')) { - language = _json['language'] as core.String; - } - if (_json.containsKey('referenceWebUri')) { - referenceWebUri = _json['referenceWebUri'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (boilerplateHandling != null) { - _json['boilerplateHandling'] = boilerplateHandling; - } - if (content != null) { - _json['content'] = content; - } - if (gcsContentUri != null) { - _json['gcsContentUri'] = gcsContentUri; - } - if (language != null) { - _json['language'] = language; - } - if (referenceWebUri != null) { - _json['referenceWebUri'] = referenceWebUri; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a phrase in the text that is a known entity, such as a person, an -/// organization, or location. -/// -/// The API associates information, such as salience and mentions, with -/// entities. -class Entity { - /// The mentions of this entity in the input document. - /// - /// The API currently supports proper noun mentions. - core.List<EntityMention> mentions; - - /// Metadata associated with the entity. - /// - /// For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) - /// and Knowledge Graph MID (`mid`), if they are available. For the metadata - /// associated with other entity types, see the Type table below. - core.Map<core.String, core.String> metadata; - - /// The representative name for the entity. - core.String name; - - /// The salience score associated with the entity in the \[0, 1.0\] range. - /// - /// The salience score for an entity provides information about the importance - /// or centrality of that entity to the entire document text. Scores closer to - /// 0 are less salient, while scores closer to 1.0 are highly salient. - core.double salience; - - /// For calls to AnalyzeEntitySentiment or if - /// AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - /// field will contain the aggregate sentiment expressed for this entity in - /// the provided document. - Sentiment sentiment; - - /// The entity type. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "PERSON" : Person - /// - "LOCATION" : Location - /// - "ORGANIZATION" : Organization - /// - "EVENT" : Event - /// - "WORK_OF_ART" : Artwork - /// - "CONSUMER_GOOD" : Consumer product - /// - "OTHER" : Other types of entities - /// - "PHONE_NUMBER" : Phone number The metadata lists the phone number, - /// formatted according to local convention, plus whichever additional - /// elements appear in the text: * `number` - the actual number, broken down - /// into sections as per local convention * `national_prefix` - country code, - /// if detected * `area_code` - region or area code, if detected * `extension` - /// - phone extension (to be dialed after connection), if detected - /// - "ADDRESS" : Address The metadata identifies the street number and - /// locality plus whichever additional elements appear in the text: * - /// `street_number` - street number * `locality` - city or town * - /// `street_name` - street/route name, if detected * `postal_code` - postal - /// code, if detected * `country` - country, if detected< * `broad_region` - - /// administrative area, such as the state, if detected * `narrow_region` - - /// smaller administrative area, such as county, if detected * `sublocality` - - /// used in Asian addresses to demark a district within a city, if detected - /// - "DATE" : Date The metadata identifies the components of the date: * - /// `year` - four digit year, if detected * `month` - two digit month number, - /// if detected * `day` - two digit day number, if detected - /// - "NUMBER" : Number The metadata is the number itself. - /// - "PRICE" : Price The metadata identifies the `value` and `currency`. - core.String type; - - Entity(); - - Entity.fromJson(core.Map _json) { - if (_json.containsKey('mentions')) { - mentions = (_json['mentions'] as core.List) - .map<EntityMention>((value) => EntityMention.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('salience')) { - salience = (_json['salience'] as core.num).toDouble(); - } - if (_json.containsKey('sentiment')) { - sentiment = Sentiment.fromJson( - _json['sentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (mentions != null) { - _json['mentions'] = mentions.map((value) => value.toJson()).toList(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (salience != null) { - _json['salience'] = salience; - } - if (sentiment != null) { - _json['sentiment'] = sentiment.toJson(); - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// Represents a mention for an entity in the text. -/// -/// Currently, proper noun mentions are supported. -class EntityMention { - /// For calls to AnalyzeEntitySentiment or if - /// AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - /// field will contain the sentiment expressed for this mention of the entity - /// in the provided document. - Sentiment sentiment; - - /// The mention text. - TextSpan text; - - /// The type of the entity mention. - /// Possible string values are: - /// - "TYPE_UNKNOWN" : Unknown - /// - "PROPER" : Proper name - /// - "COMMON" : Common noun (or noun compound) - core.String type; - - EntityMention(); - - EntityMention.fromJson(core.Map _json) { - if (_json.containsKey('sentiment')) { - sentiment = Sentiment.fromJson( - _json['sentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (sentiment != null) { - _json['sentiment'] = sentiment.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// All available features for sentiment, syntax, and semantic analysis. -/// -/// Setting each one to true will enable that specific analysis for the input. -/// Next ID: 10 -class Features { - /// Classify the full document into categories. - /// - /// If this is true, the API will use the default model which classifies into - /// a - /// [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories). - core.bool classifyText; - - /// Extract document-level sentiment. - core.bool extractDocumentSentiment; - - /// Extract entities. - core.bool extractEntities; - - /// Extract entities and their associated sentiment. - core.bool extractEntitySentiment; - - /// Extract syntax information. - core.bool extractSyntax; - - Features(); - - Features.fromJson(core.Map _json) { - if (_json.containsKey('classifyText')) { - classifyText = _json['classifyText'] as core.bool; - } - if (_json.containsKey('extractDocumentSentiment')) { - extractDocumentSentiment = _json['extractDocumentSentiment'] as core.bool; - } - if (_json.containsKey('extractEntities')) { - extractEntities = _json['extractEntities'] as core.bool; - } - if (_json.containsKey('extractEntitySentiment')) { - extractEntitySentiment = _json['extractEntitySentiment'] as core.bool; - } - if (_json.containsKey('extractSyntax')) { - extractSyntax = _json['extractSyntax'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (classifyText != null) { - _json['classifyText'] = classifyText; - } - if (extractDocumentSentiment != null) { - _json['extractDocumentSentiment'] = extractDocumentSentiment; - } - if (extractEntities != null) { - _json['extractEntities'] = extractEntities; - } - if (extractEntitySentiment != null) { - _json['extractEntitySentiment'] = extractEntitySentiment; - } - if (extractSyntax != null) { - _json['extractSyntax'] = extractSyntax; - } - return _json; - } -} - -/// Represents part of speech information for a token. -class PartOfSpeech { - /// The grammatical aspect. - /// Possible string values are: - /// - "ASPECT_UNKNOWN" : Aspect is not applicable in the analyzed language or - /// is not predicted. - /// - "PERFECTIVE" : Perfective - /// - "IMPERFECTIVE" : Imperfective - /// - "PROGRESSIVE" : Progressive - core.String aspect; - - /// The grammatical case. - /// Possible string values are: - /// - "CASE_UNKNOWN" : Case is not applicable in the analyzed language or is - /// not predicted. - /// - "ACCUSATIVE" : Accusative - /// - "ADVERBIAL" : Adverbial - /// - "COMPLEMENTIVE" : Complementive - /// - "DATIVE" : Dative - /// - "GENITIVE" : Genitive - /// - "INSTRUMENTAL" : Instrumental - /// - "LOCATIVE" : Locative - /// - "NOMINATIVE" : Nominative - /// - "OBLIQUE" : Oblique - /// - "PARTITIVE" : Partitive - /// - "PREPOSITIONAL" : Prepositional - /// - "REFLEXIVE_CASE" : Reflexive - /// - "RELATIVE_CASE" : Relative - /// - "VOCATIVE" : Vocative - core.String case_; - - /// The grammatical form. - /// Possible string values are: - /// - "FORM_UNKNOWN" : Form is not applicable in the analyzed language or is - /// not predicted. - /// - "ADNOMIAL" : Adnomial - /// - "AUXILIARY" : Auxiliary - /// - "COMPLEMENTIZER" : Complementizer - /// - "FINAL_ENDING" : Final ending - /// - "GERUND" : Gerund - /// - "REALIS" : Realis - /// - "IRREALIS" : Irrealis - /// - "SHORT" : Short form - /// - "LONG" : Long form - /// - "ORDER" : Order form - /// - "SPECIFIC" : Specific form - core.String form; - - /// The grammatical gender. - /// Possible string values are: - /// - "GENDER_UNKNOWN" : Gender is not applicable in the analyzed language or - /// is not predicted. - /// - "FEMININE" : Feminine - /// - "MASCULINE" : Masculine - /// - "NEUTER" : Neuter - core.String gender; - - /// The grammatical mood. - /// Possible string values are: - /// - "MOOD_UNKNOWN" : Mood is not applicable in the analyzed language or is - /// not predicted. - /// - "CONDITIONAL_MOOD" : Conditional - /// - "IMPERATIVE" : Imperative - /// - "INDICATIVE" : Indicative - /// - "INTERROGATIVE" : Interrogative - /// - "JUSSIVE" : Jussive - /// - "SUBJUNCTIVE" : Subjunctive - core.String mood; - - /// The grammatical number. - /// Possible string values are: - /// - "NUMBER_UNKNOWN" : Number is not applicable in the analyzed language or - /// is not predicted. - /// - "SINGULAR" : Singular - /// - "PLURAL" : Plural - /// - "DUAL" : Dual - core.String number; - - /// The grammatical person. - /// Possible string values are: - /// - "PERSON_UNKNOWN" : Person is not applicable in the analyzed language or - /// is not predicted. - /// - "FIRST" : First - /// - "SECOND" : Second - /// - "THIRD" : Third - /// - "REFLEXIVE_PERSON" : Reflexive - core.String person; - - /// The grammatical properness. - /// Possible string values are: - /// - "PROPER_UNKNOWN" : Proper is not applicable in the analyzed language or - /// is not predicted. - /// - "PROPER" : Proper - /// - "NOT_PROPER" : Not proper - core.String proper; - - /// The grammatical reciprocity. - /// Possible string values are: - /// - "RECIPROCITY_UNKNOWN" : Reciprocity is not applicable in the analyzed - /// language or is not predicted. - /// - "RECIPROCAL" : Reciprocal - /// - "NON_RECIPROCAL" : Non-reciprocal - core.String reciprocity; - - /// The part of speech tag. - /// Possible string values are: - /// - "UNKNOWN" : Unknown - /// - "ADJ" : Adjective - /// - "ADP" : Adposition (preposition and postposition) - /// - "ADV" : Adverb - /// - "CONJ" : Conjunction - /// - "DET" : Determiner - /// - "NOUN" : Noun (common and proper) - /// - "NUM" : Cardinal number - /// - "PRON" : Pronoun - /// - "PRT" : Particle or other function word - /// - "PUNCT" : Punctuation - /// - "VERB" : Verb (all tenses and modes) - /// - "X" : Other: foreign words, typos, abbreviations - /// - "AFFIX" : Affix - core.String tag; - - /// The grammatical tense. - /// Possible string values are: - /// - "TENSE_UNKNOWN" : Tense is not applicable in the analyzed language or is - /// not predicted. - /// - "CONDITIONAL_TENSE" : Conditional - /// - "FUTURE" : Future - /// - "PAST" : Past - /// - "PRESENT" : Present - /// - "IMPERFECT" : Imperfect - /// - "PLUPERFECT" : Pluperfect - core.String tense; - - /// The grammatical voice. - /// Possible string values are: - /// - "VOICE_UNKNOWN" : Voice is not applicable in the analyzed language or is - /// not predicted. - /// - "ACTIVE" : Active - /// - "CAUSATIVE" : Causative - /// - "PASSIVE" : Passive - core.String voice; - - PartOfSpeech(); - - PartOfSpeech.fromJson(core.Map _json) { - if (_json.containsKey('aspect')) { - aspect = _json['aspect'] as core.String; - } - if (_json.containsKey('case')) { - case_ = _json['case'] as core.String; - } - if (_json.containsKey('form')) { - form = _json['form'] as core.String; - } - if (_json.containsKey('gender')) { - gender = _json['gender'] as core.String; - } - if (_json.containsKey('mood')) { - mood = _json['mood'] as core.String; - } - if (_json.containsKey('number')) { - number = _json['number'] as core.String; - } - if (_json.containsKey('person')) { - person = _json['person'] as core.String; - } - if (_json.containsKey('proper')) { - proper = _json['proper'] as core.String; - } - if (_json.containsKey('reciprocity')) { - reciprocity = _json['reciprocity'] as core.String; - } - if (_json.containsKey('tag')) { - tag = _json['tag'] as core.String; - } - if (_json.containsKey('tense')) { - tense = _json['tense'] as core.String; - } - if (_json.containsKey('voice')) { - voice = _json['voice'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (aspect != null) { - _json['aspect'] = aspect; - } - if (case_ != null) { - _json['case'] = case_; - } - if (form != null) { - _json['form'] = form; - } - if (gender != null) { - _json['gender'] = gender; - } - if (mood != null) { - _json['mood'] = mood; - } - if (number != null) { - _json['number'] = number; - } - if (person != null) { - _json['person'] = person; - } - if (proper != null) { - _json['proper'] = proper; - } - if (reciprocity != null) { - _json['reciprocity'] = reciprocity; - } - if (tag != null) { - _json['tag'] = tag; - } - if (tense != null) { - _json['tense'] = tense; - } - if (voice != null) { - _json['voice'] = voice; - } - return _json; - } -} - -/// Represents a sentence in the input document. -class Sentence { - /// For calls to AnalyzeSentiment or if - /// AnnotateTextRequest.Features.extract_document_sentiment is set to true, - /// this field will contain the sentiment for the sentence. - Sentiment sentiment; - - /// The sentence text. - TextSpan text; - - Sentence(); - - Sentence.fromJson(core.Map _json) { - if (_json.containsKey('sentiment')) { - sentiment = Sentiment.fromJson( - _json['sentiment'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (sentiment != null) { - _json['sentiment'] = sentiment.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -} - -/// Represents the feeling associated with the entire text or entities in the -/// text. -/// -/// Next ID: 6 -class Sentiment { - /// A non-negative number in the \[0, +inf) range, which represents the - /// absolute magnitude of sentiment regardless of score (positive or - /// negative). - core.double magnitude; - - /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - /// sentiment). - core.double score; - - Sentiment(); - - Sentiment.fromJson(core.Map _json) { - if (_json.containsKey('magnitude')) { - magnitude = (_json['magnitude'] as core.num).toDouble(); - } - if (_json.containsKey('score')) { - score = (_json['score'] as core.num).toDouble(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (magnitude != null) { - _json['magnitude'] = magnitude; - } - if (score != null) { - _json['score'] = score; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Represents an output piece of text. -class TextSpan { - /// The API calculates the beginning offset of the content in the original - /// document according to the EncodingType specified in the API request. - core.int beginOffset; - - /// The content of the output text. - core.String content; - - TextSpan(); - - TextSpan.fromJson(core.Map _json) { - if (_json.containsKey('beginOffset')) { - beginOffset = _json['beginOffset'] as core.int; - } - if (_json.containsKey('content')) { - content = _json['content'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (beginOffset != null) { - _json['beginOffset'] = beginOffset; - } - if (content != null) { - _json['content'] = content; - } - return _json; - } -} - -/// Represents the smallest syntactic building block of the text. -class Token { - /// Dependency tree parse for this token. - DependencyEdge dependencyEdge; - - /// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the - /// token. - core.String lemma; - - /// Parts of speech tag for this token. - PartOfSpeech partOfSpeech; - - /// The token text. - TextSpan text; - - Token(); - - Token.fromJson(core.Map _json) { - if (_json.containsKey('dependencyEdge')) { - dependencyEdge = DependencyEdge.fromJson( - _json['dependencyEdge'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('lemma')) { - lemma = _json['lemma'] as core.String; - } - if (_json.containsKey('partOfSpeech')) { - partOfSpeech = PartOfSpeech.fromJson( - _json['partOfSpeech'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('text')) { - text = TextSpan.fromJson( - _json['text'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (dependencyEdge != null) { - _json['dependencyEdge'] = dependencyEdge.toJson(); - } - if (lemma != null) { - _json['lemma'] = lemma; - } - if (partOfSpeech != null) { - _json['partOfSpeech'] = partOfSpeech.toJson(); - } - if (text != null) { - _json['text'] = text.toJson(); - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/lifesciences/v2beta.dart b/generated/googleapis_beta/lib/lifesciences/v2beta.dart index 31a8945..f5f330d 100644 --- a/generated/googleapis_beta/lib/lifesciences/v2beta.dart +++ b/generated/googleapis_beta/lib/lifesciences/v2beta.dart
@@ -546,6 +546,9 @@ /// prefetching fails. core.bool alwaysRun; + /// Prevents the container from accessing the external network. + core.bool blockExternalNetwork; + /// If specified, overrides the `CMD` specified in the container. /// /// If the container also has an `ENTRYPOINT` the values are used as @@ -695,6 +698,9 @@ if (_json.containsKey('alwaysRun')) { alwaysRun = _json['alwaysRun'] as core.bool; } + if (_json.containsKey('blockExternalNetwork')) { + blockExternalNetwork = _json['blockExternalNetwork'] as core.bool; + } if (_json.containsKey('commands')) { commands = (_json['commands'] as core.List) .map<core.String>((value) => value as core.String) @@ -779,6 +785,9 @@ if (alwaysRun != null) { _json['alwaysRun'] = alwaysRun; } + if (blockExternalNetwork != null) { + _json['blockExternalNetwork'] = blockExternalNetwork; + } if (commands != null) { _json['commands'] = commands; } @@ -1018,7 +1027,8 @@ /// Carries information about a disk that can be attached to a VM. /// /// See https://cloud.google.com/compute/docs/disks/performance for more -/// information about disk type, size, and performance considerations. +/// information about disk type, size, and performance considerations. Specify +/// either `Volume` or `Disk`, but not both. class Disk { /// A user-supplied name for the disk. /// @@ -1233,6 +1243,37 @@ } } +/// Configuration for an existing disk to be attached to the VM. +class ExistingDisk { + /// If `disk` contains slashes, the Cloud Life Sciences API assumes that it is + /// a complete URL for the disk. + /// + /// If `disk` does not contain slashes, the Cloud Life Sciences API assumes + /// that the disk is a zonal disk and a URL will be generated of the form + /// `zones//disks/`, where `` is the zone in which the instance is allocated. + /// The disk must be ext4 formatted. If all `Mount` references to this disk + /// have the `read_only` flag set to true, the disk will be attached in + /// `read-only` mode and can be shared with other instances. Otherwise, the + /// disk will be available for writing but cannot be shared. + core.String disk; + + ExistingDisk(); + + ExistingDisk.fromJson(core.Map _json) { + if (_json.containsKey('disk')) { + disk = _json['disk'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (disk != null) { + _json['disk'] = disk; + } + return _json; + } +} + /// An event generated when the execution of a pipeline has failed. /// /// Note that other events can continue to occur after this event. @@ -1616,6 +1657,30 @@ } } +/// Configuration for an `NFSMount` to be attached to the VM. +class NFSMount { + /// A target NFS mount. + /// + /// The target must be specified as \`address:/mount". + core.String target; + + NFSMount(); + + NFSMount.fromJson(core.Map _json) { + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (target != null) { + _json['target'] = target; + } + return _json; + } +} + /// VM networking options. class Network { /// The network name to attach the VM's network interface to. @@ -1757,6 +1822,57 @@ } } +/// Configuration for a persistent disk to be attached to the VM. +/// +/// See https://cloud.google.com/compute/docs/disks/performance for more +/// information about disk type, size, and performance considerations. +class PersistentDisk { + /// The size, in GB, of the disk to attach. + /// + /// If the size is not specified, a default is chosen to ensure reasonable I/O + /// performance. If the disk type is specified as `local-ssd`, multiple local + /// drives are automatically combined to provide the requested size. Note, + /// however, that each physical SSD is 375GB in size, and no more than 8 + /// drives can be attached to a single instance. + core.int sizeGb; + + /// An image to put on the disk before attaching it to the VM. + core.String sourceImage; + + /// The Compute Engine disk type. + /// + /// If unspecified, `pd-standard` is used. + core.String type; + + PersistentDisk(); + + PersistentDisk.fromJson(core.Map _json) { + if (_json.containsKey('sizeGb')) { + sizeGb = _json['sizeGb'] as core.int; + } + if (_json.containsKey('sourceImage')) { + sourceImage = _json['sourceImage'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (sizeGb != null) { + _json['sizeGb'] = sizeGb; + } + if (sourceImage != null) { + _json['sourceImage'] = sourceImage; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + /// Specifies a series of actions to execute, expressed as Docker containers. class Pipeline { /// The list of actions to execute, in the order they are specified. @@ -2192,6 +2308,8 @@ core.String cpuPlatform; /// The list of disks to create and attach to the VM. + /// + /// Specify either the `volumes[]` field or the `disks[]` field, but not both. core.List<Disk> disks; /// The Compute Engine Disk Images to use as a Docker cache. @@ -2201,8 +2319,9 @@ /// images must match those of the tags used or the latest version will still /// be pulled. The root directory of the ext4 image must contain `image` and /// `overlay2` directories copied from the Docker directory of a VM where the - /// desired Docker images have already been pulled. Only a single image is - /// supported. + /// desired Docker images have already been pulled. Any images pulled that are + /// not cached will be stored on the first cache disk instead of the boot + /// disk. Only a single image is supported. core.List<core.String> dockerCacheImages; /// Whether Stackdriver monitoring should be enabled on the VM. @@ -2249,6 +2368,11 @@ /// the pipeline. ServiceAccount serviceAccount; + /// The list of disks and other storage to create or attach to the VM. + /// + /// Specify either the `volumes[]` field or the `disks[]` field, but not both. + core.List<Volume> volumes; + VirtualMachine(); VirtualMachine.fromJson(core.Map _json) { @@ -2308,6 +2432,12 @@ serviceAccount = ServiceAccount.fromJson( _json['serviceAccount'] as core.Map<core.String, core.dynamic>); } + if (_json.containsKey('volumes')) { + volumes = (_json['volumes'] as core.List) + .map<Volume>((value) => + Volume.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } } core.Map<core.String, core.Object> toJson() { @@ -2352,6 +2482,67 @@ if (serviceAccount != null) { _json['serviceAccount'] = serviceAccount.toJson(); } + if (volumes != null) { + _json['volumes'] = volumes.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Carries information about storage that can be attached to a VM. +/// +/// Specify either `Volume` or `Disk`, but not both. +class Volume { + /// Configuration for a existing disk. + ExistingDisk existingDisk; + + /// Configuration for an NFS mount. + NFSMount nfsMount; + + /// Configuration for a persistent disk. + PersistentDisk persistentDisk; + + /// A user-supplied name for the volume. + /// + /// Used when mounting the volume into `Actions`. The name must contain only + /// upper and lowercase alphanumeric characters and hyphens and cannot start + /// with a hyphen. + core.String volume; + + Volume(); + + Volume.fromJson(core.Map _json) { + if (_json.containsKey('existingDisk')) { + existingDisk = ExistingDisk.fromJson( + _json['existingDisk'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('nfsMount')) { + nfsMount = NFSMount.fromJson( + _json['nfsMount'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('persistentDisk')) { + persistentDisk = PersistentDisk.fromJson( + _json['persistentDisk'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('volume')) { + volume = _json['volume'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (existingDisk != null) { + _json['existingDisk'] = existingDisk.toJson(); + } + if (nfsMount != null) { + _json['nfsMount'] = nfsMount.toJson(); + } + if (persistentDisk != null) { + _json['persistentDisk'] = persistentDisk.toJson(); + } + if (volume != null) { + _json['volume'] = volume; + } return _json; } }
diff --git a/generated/googleapis_beta/lib/memcache/v1beta2.dart b/generated/googleapis_beta/lib/memcache/v1beta2.dart deleted file mode 100644 index 0dd92c5..0000000 --- a/generated/googleapis_beta/lib/memcache/v1beta2.dart +++ /dev/null
@@ -1,2624 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Memorystore for Memcached API - v1beta2 -/// -/// Google Cloud Memorystore for Memcached API is used for creating and managing -/// Memcached instances in GCP. -/// -/// For more information, see <https://cloud.google.com/memorystore/> -/// -/// Create an instance of [CloudMemorystoreForMemcachedApi] to access these -/// resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsInstancesResource] -/// - [ProjectsLocationsOperationsResource] -library memcache.v1beta2; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Google Cloud Memorystore for Memcached API is used for creating and managing -/// Memcached instances in GCP. -class CloudMemorystoreForMemcachedApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - CloudMemorystoreForMemcachedApi(http.Client client, - {core.String rootUrl = 'https://memcache.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsInstancesResource get instances => - ProjectsLocationsInstancesResource(_requester); - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsInstancesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsInstancesResource(commons.ApiRequester client) - : _requester = client; - - /// ApplyParameters will restart the set of specified nodes in order to update - /// them to the current set of parameters for the Memcached Instance. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. Resource name of the Memcached instance for which - /// parameter group updates should be applied. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> applyParameters( - ApplyParametersRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':applyParameters'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a new Instance in a given location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the instance location using the - /// form: `projects/{project_id}/locations/{location_id}` where `location_id` - /// refers to a GCP region - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [instanceId] - Required. The logical name of the Memcached instance in the - /// user project with the following restrictions: * Must contain only - /// lowercase letters, numbers, and hyphens. * Must start with a letter. * - /// Must be between 1-40 characters. * Must end with a number or a letter. * - /// Must be unique within the user project / location If any of the above are - /// not met, will raise an invalid argument error. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Instance request, - core.String parent, { - core.String instanceId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (instanceId != null) { - _queryParams['instanceId'] = [instanceId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/instances'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a single Instance. - /// - /// Request parameters: - /// - /// [name] - Required. Memcached instance resource name in the format: - /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - /// where `location_id` refers to a GCP region - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets details of a single Instance. - /// - /// Request parameters: - /// - /// [name] - Required. Memcached instance resource name in the format: - /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - /// where `location_id` refers to a GCP region - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Instance]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Instance> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Instance.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists Instances in a given location. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the instance location using the - /// form: `projects/{project_id}/locations/{location_id}` where `location_id` - /// refers to a GCP region - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - List filter. For example, exclude all Memcached instances with - /// name as my-instance by specifying "name != my-instance". - /// - /// [orderBy] - Sort results. Supported values are "name", "name desc" or "" - /// (unsorted). - /// - /// [pageSize] - The maximum number of items to return. If not specified, a - /// default value of 1000 will be used by the service. Regardless of the - /// page_size value, the response may include a partial list and a caller - /// should only rely on response's next_page_token to determine if there are - /// more instances left to be queried. - /// - /// [pageToken] - The next_page_token value returned from a previous List - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListInstancesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListInstancesResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/instances'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListInstancesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates an existing Instance in a given project and location. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. Unique name of the resource in this scope including - /// project and location using the form: - /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - /// Note: Memcached instances are managed and addressed at regional level so - /// location_id here refers to a GCP region; however, users may choose which - /// zones Memcached nodes within an instances should be provisioned in. Refer - /// to \[zones\] field for more details. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [updateMask] - Required. Mask of fields to update. * `displayName` - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> patch( - Instance request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates the defined Memcached Parameters for an existing Instance. - /// - /// This method only stages the parameters, it must be followed by - /// ApplyParameters to apply the parameters to nodes of the Memcached - /// Instance. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. Resource name of the Memcached instance for which the - /// parameters should be updated. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> updateParameters( - UpdateParametersRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':updateParameters'; - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> cancel( - CancelOperationRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a long-running operation. - /// - /// This method indicates that the client is no longer interested in the - /// operation result. It does not cancel the operation. If the server doesn't - /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be deleted. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Request for ApplyParameters. -class ApplyParametersRequest { - /// Whether to apply instance-level parameter group to all nodes. - /// - /// If set to true, will explicitly restrict users from specifying any nodes, - /// and apply parameter group updates to all nodes within the instance. - core.bool applyAll; - - /// Nodes to which we should apply the instance-level parameter group. - core.List<core.String> nodeIds; - - ApplyParametersRequest(); - - ApplyParametersRequest.fromJson(core.Map _json) { - if (_json.containsKey('applyAll')) { - applyAll = _json['applyAll'] as core.bool; - } - if (_json.containsKey('nodeIds')) { - nodeIds = (_json['nodeIds'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (applyAll != null) { - _json['applyAll'] = applyAll; - } - if (nodeIds != null) { - _json['nodeIds'] = nodeIds; - } - return _json; - } -} - -/// The request message for Operations.CancelOperation. -class CancelOperationRequest { - CancelOperationRequest(); - - CancelOperationRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Metadata for the given google.cloud.location.Location. -class GoogleCloudMemcacheV1beta2LocationMetadata { - /// The set of available zones in the location. - /// - /// The map is keyed by the lowercase ID of each zone, as defined by GCE. - /// These keys can be specified in the `zones` field when creating a Memcached - /// instance. - /// - /// Output only. - core.Map<core.String, ZoneMetadata> availableZones; - - GoogleCloudMemcacheV1beta2LocationMetadata(); - - GoogleCloudMemcacheV1beta2LocationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('availableZones')) { - availableZones = (_json['availableZones'] as core.Map) - .cast<core.String, core.Map>() - .map( - (key, item) => core.MapEntry( - key, - ZoneMetadata.fromJson( - item as core.Map<core.String, core.dynamic>), - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (availableZones != null) { - _json['availableZones'] = - availableZones.map((key, item) => core.MapEntry(key, item.toJson())); - } - return _json; - } -} - -/// Represents the metadata of a long-running operation. -class GoogleCloudMemcacheV1beta2OperationMetadata { - /// API version used to start the operation. - /// - /// Output only. - core.String apiVersion; - - /// Identifies whether the user has requested cancellation of the operation. - /// - /// Operations that have successfully been cancelled have Operation.error - /// value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Output only. - core.bool cancelRequested; - - /// Time when the operation was created. - /// - /// Output only. - core.String createTime; - - /// Time when the operation finished running. - /// - /// Output only. - core.String endTime; - - /// Human-readable status of the operation, if any. - /// - /// Output only. - core.String statusDetail; - - /// Server-defined resource path for the target of the operation. - /// - /// Output only. - core.String target; - - /// Name of the verb executed by the operation. - /// - /// Output only. - core.String verb; - - GoogleCloudMemcacheV1beta2OperationMetadata(); - - GoogleCloudMemcacheV1beta2OperationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('apiVersion')) { - apiVersion = _json['apiVersion'] as core.String; - } - if (_json.containsKey('cancelRequested')) { - cancelRequested = _json['cancelRequested'] as core.bool; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('statusDetail')) { - statusDetail = _json['statusDetail'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('verb')) { - verb = _json['verb'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiVersion != null) { - _json['apiVersion'] = apiVersion; - } - if (cancelRequested != null) { - _json['cancelRequested'] = cancelRequested; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (statusDetail != null) { - _json['statusDetail'] = statusDetail; - } - if (target != null) { - _json['target'] = target; - } - if (verb != null) { - _json['verb'] = verb; - } - return _json; - } -} - -class GoogleCloudSaasacceleratorManagementProvidersV1Instance { - /// consumer_defined_name is the name that is set by the consumer. - /// - /// On the other hand Name field represents system-assigned id of an instance - /// so consumers are not necessarily aware of it. consumer_defined_name is - /// used for notification/UI purposes for consumer to recognize their - /// instances. - core.String consumerDefinedName; - - /// Timestamp when the resource was created. - /// - /// Output only. - core.String createTime; - - /// Resource labels to represent user provided metadata. - /// - /// Each label is a key-value pair, where both the key and the value are - /// arbitrary strings provided by the user. - /// - /// Optional. - core.Map<core.String, core.String> labels; - - /// The MaintenancePolicies that have been attached to the instance. - /// - /// The key must be of the type name of the oneof policy name defined in - /// MaintenancePolicy, and the referenced policy must define the same policy - /// type. For complete details of MaintenancePolicy, please refer to - /// go/cloud-saas-mw-ug. - core.Map<core.String, core.String> maintenancePolicyNames; - - /// The MaintenanceSchedule contains the scheduling information of published - /// maintenance schedule. - core.Map<core.String, - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule> - maintenanceSchedules; - - /// The MaintenanceSettings associated with instance. - /// - /// Optional. - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings - maintenanceSettings; - - /// Unique name of the resource. - /// - /// It uses the form: - /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - core.String name; - - /// Custom string attributes used primarily to expose producer-specific - /// information in monitoring dashboards. - /// - /// See go/get-instance-metadata. - /// - /// Output only. - core.Map<core.String, core.String> producerMetadata; - - /// The list of data plane resources provisioned for this instance, e.g. - /// compute VMs. - /// - /// See go/get-instance-metadata. - /// - /// Output only. - core.List<GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource> - provisionedResources; - - /// Link to the SLM instance template. - /// - /// Only populated when updating SLM instances via SSA's Actuation service - /// adaptor. Service producers with custom control plane (e.g. Cloud SQL) - /// doesn't need to populate this field. Instead they should use - /// software_versions. - core.String slmInstanceTemplate; - - /// SLO metadata for instance classification in the Standardized dataplane SLO - /// platform. - /// - /// See go/cloud-ssa-standard-slo for feature description. - /// - /// Output only. - GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata sloMetadata; - - /// Software versions that are used to deploy this instance. - /// - /// This can be mutated by rollout services. - core.Map<core.String, core.String> softwareVersions; - - /// Current lifecycle state of the resource (e.g. if it's being created or - /// ready to use). - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Unspecified state. - /// - "CREATING" : Instance is being created. - /// - "READY" : Instance has been created and is ready to use. - /// - "UPDATING" : Instance is being updated. - /// - "REPAIRING" : Instance is unheathy and under repair. - /// - "DELETING" : Instance is being deleted. - /// - "ERROR" : Instance encountered an error and is in indeterministic state. - core.String state; - - /// ID of the associated GCP tenant project. - /// - /// See go/get-instance-metadata. - /// - /// Output only. - core.String tenantProjectId; - - /// Timestamp when the resource was last modified. - /// - /// Output only. - core.String updateTime; - - GoogleCloudSaasacceleratorManagementProvidersV1Instance(); - - GoogleCloudSaasacceleratorManagementProvidersV1Instance.fromJson( - core.Map _json) { - if (_json.containsKey('consumerDefinedName')) { - consumerDefinedName = _json['consumerDefinedName'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('maintenancePolicyNames')) { - maintenancePolicyNames = (_json['maintenancePolicyNames'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('maintenanceSchedules')) { - maintenanceSchedules = (_json['maintenanceSchedules'] as core.Map) - .cast<core.String, core.Map>() - .map( - (key, item) => core.MapEntry( - key, - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule - .fromJson(item as core.Map<core.String, core.dynamic>), - ), - ); - } - if (_json.containsKey('maintenanceSettings')) { - maintenanceSettings = - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings - .fromJson(_json['maintenanceSettings'] - as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('producerMetadata')) { - producerMetadata = (_json['producerMetadata'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('provisionedResources')) { - provisionedResources = (_json['provisionedResources'] as core.List) - .map<GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource>( - (value) => - GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('slmInstanceTemplate')) { - slmInstanceTemplate = _json['slmInstanceTemplate'] as core.String; - } - if (_json.containsKey('sloMetadata')) { - sloMetadata = - GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata.fromJson( - _json['sloMetadata'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('softwareVersions')) { - softwareVersions = (_json['softwareVersions'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('tenantProjectId')) { - tenantProjectId = _json['tenantProjectId'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (consumerDefinedName != null) { - _json['consumerDefinedName'] = consumerDefinedName; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (labels != null) { - _json['labels'] = labels; - } - if (maintenancePolicyNames != null) { - _json['maintenancePolicyNames'] = maintenancePolicyNames; - } - if (maintenanceSchedules != null) { - _json['maintenanceSchedules'] = maintenanceSchedules - .map((key, item) => core.MapEntry(key, item.toJson())); - } - if (maintenanceSettings != null) { - _json['maintenanceSettings'] = maintenanceSettings.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (producerMetadata != null) { - _json['producerMetadata'] = producerMetadata; - } - if (provisionedResources != null) { - _json['provisionedResources'] = - provisionedResources.map((value) => value.toJson()).toList(); - } - if (slmInstanceTemplate != null) { - _json['slmInstanceTemplate'] = slmInstanceTemplate; - } - if (sloMetadata != null) { - _json['sloMetadata'] = sloMetadata.toJson(); - } - if (softwareVersions != null) { - _json['softwareVersions'] = softwareVersions; - } - if (state != null) { - _json['state'] = state; - } - if (tenantProjectId != null) { - _json['tenantProjectId'] = tenantProjectId; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - return _json; - } -} - -/// Maintenance schedule which is exposed to customer and potentially end user, -/// indicating published upcoming future maintenance schedule -class GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule { - /// Can this scheduled update be rescheduled? By default, it's true and API - /// needs to do explicitly check whether it's set, if it's set as false - /// explicitly, it's false - core.bool canReschedule; - - /// The scheduled end time for the maintenance. - core.String endTime; - - /// The rollout management policy this maintenance schedule is associated - /// with. - /// - /// When doing reschedule update request, the reschedule should be against - /// this given policy. - core.String rolloutManagementPolicy; - - /// The scheduled start time for the maintenance. - core.String startTime; - - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); - - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule.fromJson( - core.Map _json) { - if (_json.containsKey('canReschedule')) { - canReschedule = _json['canReschedule'] as core.bool; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('rolloutManagementPolicy')) { - rolloutManagementPolicy = _json['rolloutManagementPolicy'] as core.String; - } - if (_json.containsKey('startTime')) { - startTime = _json['startTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (canReschedule != null) { - _json['canReschedule'] = canReschedule; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (rolloutManagementPolicy != null) { - _json['rolloutManagementPolicy'] = rolloutManagementPolicy; - } - if (startTime != null) { - _json['startTime'] = startTime; - } - return _json; - } -} - -/// Maintenance settings associated with instance. -/// -/// Allows service producers and end users to assign settings that controls -/// maintenance on this instance. -class GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings { - /// Exclude instance from maintenance. - /// - /// When true, rollout service will not attempt maintenance on the instance. - /// Rollout service will include the instance in reported rollout progress as - /// not attempted. - /// - /// Optional. - core.bool exclude; - - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); - - GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings.fromJson( - core.Map _json) { - if (_json.containsKey('exclude')) { - exclude = _json['exclude'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exclude != null) { - _json['exclude'] = exclude; - } - return _json; - } -} - -/// Node information for custom per-node SLO implementations. -/// -/// SSA does not support per-node SLO, but producers can populate per-node -/// information in SloMetadata for custom precomputations. SSA Eligibility -/// Exporter will emit per-node metric based on this information. -class GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata { - /// By default node is eligible if instance is eligible. - /// - /// But individual node might be excluded from SLO by adding entry here. For - /// semantic see SloMetadata.exclusions. If both instance and node level - /// exclusions are present for time period, the node level's reason will be - /// reported by Eligibility Exporter. - core.List<GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> - exclusions; - - /// The location of the node, if different from instance location. - core.String location; - - /// The id of the node. - /// - /// This should be equal to SaasInstanceNode.node_id. - core.String nodeId; - - GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); - - GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata.fromJson( - core.Map _json) { - if (_json.containsKey('exclusions')) { - exclusions = (_json['exclusions'] as core.List) - .map<GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>( - (value) => - GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('nodeId')) { - nodeId = _json['nodeId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (exclusions != null) { - _json['exclusions'] = exclusions.map((value) => value.toJson()).toList(); - } - if (location != null) { - _json['location'] = location; - } - if (nodeId != null) { - _json['nodeId'] = nodeId; - } - return _json; - } -} - -/// Describes provisioned dataplane resources. -class GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource { - /// Type of the resource. - /// - /// This can be either a GCP resource or a custom one (e.g. another cloud - /// provider's VM). For GCP compute resources use singular form of the names - /// listed in GCP compute API documentation - /// (https://cloud.google.com/compute/docs/reference/rest/v1/), prefixed with - /// 'compute-', for example: 'compute-instance', 'compute-disk', - /// 'compute-autoscaler'. - core.String resourceType; - - /// URL identifying the resource, e.g. - /// "https://www.googleapis.com/compute/v1/projects/...)". - core.String resourceUrl; - - GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); - - GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource.fromJson( - core.Map _json) { - if (_json.containsKey('resourceType')) { - resourceType = _json['resourceType'] as core.String; - } - if (_json.containsKey('resourceUrl')) { - resourceUrl = _json['resourceUrl'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (resourceType != null) { - _json['resourceType'] = resourceType; - } - if (resourceUrl != null) { - _json['resourceUrl'] = resourceUrl; - } - return _json; - } -} - -/// SloEligibility is a tuple containing eligibility value: true if an instance -/// is eligible for SLO calculation or false if it should be excluded from all -/// SLO-related calculations along with a user-defined reason. -class GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility { - /// Whether an instance is eligible or ineligible. - core.bool eligible; - - /// User-defined reason for the current value of instance eligibility. - /// - /// Usually, this can be directly mapped to the internal state. An empty - /// reason is allowed. - core.String reason; - - GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); - - GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility.fromJson( - core.Map _json) { - if (_json.containsKey('eligible')) { - eligible = _json['eligible'] as core.bool; - } - if (_json.containsKey('reason')) { - reason = _json['reason'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (eligible != null) { - _json['eligible'] = eligible; - } - if (reason != null) { - _json['reason'] = reason; - } - return _json; - } -} - -/// SloExclusion represents an exclusion in SLI calculation applies to all SLOs. -class GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion { - /// Exclusion duration. - /// - /// No restrictions on the possible values. When an ongoing operation is - /// taking longer than initially expected, an existing entry in the exclusion - /// list can be updated by extending the duration. This is supported by the - /// subsystem exporting eligibility data as long as such extension is - /// committed at least 10 minutes before the original exclusion expiration - - /// otherwise it is possible that there will be "gaps" in the exclusion - /// application in the exported timeseries. - core.String duration; - - /// Human-readable reason for the exclusion. - /// - /// This should be a static string (e.g. "Disruptive update in progress") and - /// should not contain dynamically generated data (e.g. instance name). Can be - /// left empty. - core.String reason; - - /// Name of an SLI that this exclusion applies to. - /// - /// Can be left empty, signaling that the instance should be excluded from all - /// SLIs defined in the service SLO configuration. - core.String sliName; - - /// Start time of the exclusion. - /// - /// No alignment (e.g. to a full minute) needed. - core.String startTime; - - GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); - - GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion.fromJson( - core.Map _json) { - if (_json.containsKey('duration')) { - duration = _json['duration'] as core.String; - } - if (_json.containsKey('reason')) { - reason = _json['reason'] as core.String; - } - if (_json.containsKey('sliName')) { - sliName = _json['sliName'] as core.String; - } - if (_json.containsKey('startTime')) { - startTime = _json['startTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (duration != null) { - _json['duration'] = duration; - } - if (reason != null) { - _json['reason'] = reason; - } - if (sliName != null) { - _json['sliName'] = sliName; - } - if (startTime != null) { - _json['startTime'] = startTime; - } - return _json; - } -} - -/// SloMetadata contains resources required for proper SLO classification of the -/// instance. -class GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata { - /// User-defined instance eligibility. - /// - /// Optional. - GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility eligibility; - - /// List of SLO exclusion windows. - /// - /// When multiple entries in the list match (matching the exclusion - /// time-window against current time point) the exclusion reason used in the - /// first matching entry will be published. It is not needed to include - /// expired exclusion in this list, as only the currently applicable - /// exclusions are taken into account by the eligibility exporting subsystem - /// (the historical state of exclusions will be reflected in the historically - /// produced timeseries regardless of the current state). This field can be - /// used to mark the instance as temporary ineligible for the purpose of SLO - /// calculation. For permanent instance SLO exclusion, use of custom instance - /// eligibility is recommended. See 'eligibility' field below. - core.List<GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> - exclusions; - - /// List of nodes. - /// - /// Some producers need to use per-node metadata to calculate SLO. This field - /// allows such producers to publish per-node SLO meta data, which will be - /// consumed by SSA Eligibility Exporter and published in the form of per node - /// metric to Monarch. - /// - /// Optional. - core.List<GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> - nodes; - - /// Name of the SLO tier the Instance belongs to. - /// - /// This name will be expected to match the tiers specified in the service SLO - /// configuration. Field is mandatory and must not be empty. - core.String tier; - - GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); - - GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata.fromJson( - core.Map _json) { - if (_json.containsKey('eligibility')) { - eligibility = - GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility - .fromJson( - _json['eligibility'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('exclusions')) { - exclusions = (_json['exclusions'] as core.List) - .map<GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>( - (value) => - GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nodes')) { - nodes = (_json['nodes'] as core.List) - .map<GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata>( - (value) => - GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata - .fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tier')) { - tier = _json['tier'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (eligibility != null) { - _json['eligibility'] = eligibility.toJson(); - } - if (exclusions != null) { - _json['exclusions'] = exclusions.map((value) => value.toJson()).toList(); - } - if (nodes != null) { - _json['nodes'] = nodes.map((value) => value.toJson()).toList(); - } - if (tier != null) { - _json['tier'] = tier; - } - return _json; - } -} - -class Instance { - /// The full name of the Google Compute Engine - /// [network](https://cloud.google.com/vpc/docs/vpc) to which the instance is - /// connected. - /// - /// If left unspecified, the `default` network will be used. - core.String authorizedNetwork; - - /// The time the instance was created. - /// - /// Output only. - core.String createTime; - - /// Endpoint for Discovery API - /// - /// Output only. - core.String discoveryEndpoint; - - /// User provided name for the instance only used for display purposes. - /// - /// Cannot be more than 80 characters. - core.String displayName; - - /// List of messages that describe current statuses of memcached instance. - core.List<InstanceMessage> instanceMessages; - - /// Resource labels to represent user-provided metadata. - /// - /// Refer to cloud documentation on labels for more details. - /// https://cloud.google.com/compute/docs/labeling-resources - core.Map<core.String, core.String> labels; - - /// The full version of memcached server running on this instance. - /// - /// System automatically determines the full memcached version for an instance - /// based on the input MemcacheVersion. The full version format will be - /// "memcached-1.5.16". - /// - /// Output only. - core.String memcacheFullVersion; - - /// List of Memcached nodes. - /// - /// Refer to \[Node\] message for more details. - /// - /// Output only. - core.List<Node> memcacheNodes; - - /// The major version of Memcached software. - /// - /// If not provided, latest supported version will be used. Currently the - /// latest supported major version is MEMCACHE_1_5. The minor version will be - /// automatically determined by our system based on the latest supported minor - /// version. - /// Possible string values are: - /// - "MEMCACHE_VERSION_UNSPECIFIED" - /// - "MEMCACHE_1_5" : Memcached 1.5 version. - core.String memcacheVersion; - - /// Unique name of the resource in this scope including project and location - /// using the form: - /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - /// Note: Memcached instances are managed and addressed at regional level so - /// location_id here refers to a GCP region; however, users may choose which - /// zones Memcached nodes within an instances should be provisioned in. - /// - /// Refer to \[zones\] field for more details. - /// - /// Required. - core.String name; - - /// Configuration for Memcached nodes. - /// - /// Required. - NodeConfig nodeConfig; - - /// Number of nodes in the Memcached instance. - /// - /// Required. - core.int nodeCount; - - /// Optional: User defined parameters to apply to the memcached process on - /// each node. - MemcacheParameters parameters; - - /// The state of this Memcached instance. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : State not set. - /// - "CREATING" : Memcached instance is being created. - /// - "READY" : Memcached instance has been created and ready to be used. - /// - "DELETING" : Memcached instance is being deleted. - /// - "PERFORMING_MAINTENANCE" : Memcached instance is going through - /// maintenance, e.g. data plane rollout. - core.String state; - - /// The time the instance was updated. - /// - /// Output only. - core.String updateTime; - - /// Zones where Memcached nodes should be provisioned in. - /// - /// Memcached nodes will be equally distributed across these zones. If not - /// provided, the service will by default create nodes in all zones in the - /// region for the instance. - core.List<core.String> zones; - - Instance(); - - Instance.fromJson(core.Map _json) { - if (_json.containsKey('authorizedNetwork')) { - authorizedNetwork = _json['authorizedNetwork'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('discoveryEndpoint')) { - discoveryEndpoint = _json['discoveryEndpoint'] as core.String; - } - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('instanceMessages')) { - instanceMessages = (_json['instanceMessages'] as core.List) - .map<InstanceMessage>((value) => InstanceMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('memcacheFullVersion')) { - memcacheFullVersion = _json['memcacheFullVersion'] as core.String; - } - if (_json.containsKey('memcacheNodes')) { - memcacheNodes = (_json['memcacheNodes'] as core.List) - .map<Node>((value) => - Node.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('memcacheVersion')) { - memcacheVersion = _json['memcacheVersion'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('nodeConfig')) { - nodeConfig = NodeConfig.fromJson( - _json['nodeConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('nodeCount')) { - nodeCount = _json['nodeCount'] as core.int; - } - if (_json.containsKey('parameters')) { - parameters = MemcacheParameters.fromJson( - _json['parameters'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - if (_json.containsKey('zones')) { - zones = (_json['zones'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (authorizedNetwork != null) { - _json['authorizedNetwork'] = authorizedNetwork; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (discoveryEndpoint != null) { - _json['discoveryEndpoint'] = discoveryEndpoint; - } - if (displayName != null) { - _json['displayName'] = displayName; - } - if (instanceMessages != null) { - _json['instanceMessages'] = - instanceMessages.map((value) => value.toJson()).toList(); - } - if (labels != null) { - _json['labels'] = labels; - } - if (memcacheFullVersion != null) { - _json['memcacheFullVersion'] = memcacheFullVersion; - } - if (memcacheNodes != null) { - _json['memcacheNodes'] = - memcacheNodes.map((value) => value.toJson()).toList(); - } - if (memcacheVersion != null) { - _json['memcacheVersion'] = memcacheVersion; - } - if (name != null) { - _json['name'] = name; - } - if (nodeConfig != null) { - _json['nodeConfig'] = nodeConfig.toJson(); - } - if (nodeCount != null) { - _json['nodeCount'] = nodeCount; - } - if (parameters != null) { - _json['parameters'] = parameters.toJson(); - } - if (state != null) { - _json['state'] = state; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - if (zones != null) { - _json['zones'] = zones; - } - return _json; - } -} - -class InstanceMessage { - /// A code that correspond to one type of user-facing message. - /// Possible string values are: - /// - "CODE_UNSPECIFIED" : Message Code not set. - /// - "ZONE_DISTRIBUTION_UNBALANCED" : Memcached nodes are distributed - /// unevenly. - core.String code; - - /// Message on memcached instance which will be exposed to users. - core.String message; - - InstanceMessage(); - - InstanceMessage.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.String; - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Response for ListInstances. -class ListInstancesResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// A list of Memcached instances in the project in the specified location, or - /// across all locations. - /// - /// If the `location_id` in the parent field of the request is "-", all - /// regions available to the project are queried, and the results aggregated. - core.List<Instance> resources; - - /// Locations that could not be reached. - core.List<core.String> unreachable; - - ListInstancesResponse(); - - ListInstancesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('resources')) { - resources = (_json['resources'] as core.List) - .map<Instance>((value) => - Instance.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (resources != null) { - _json['resources'] = resources.map((value) => value.toJson()).toList(); - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -class MemcacheParameters { - /// The unique ID associated with this set of parameters. - /// - /// Users can use this id to determine if the parameters associated with the - /// instance differ from the parameters associated with the nodes and any - /// action needs to be taken to apply parameters on nodes. - /// - /// Output only. - core.String id; - - /// User defined set of parameters to use in the memcached process. - core.Map<core.String, core.String> params; - - MemcacheParameters(); - - MemcacheParameters.fromJson(core.Map _json) { - if (_json.containsKey('id')) { - id = _json['id'] as core.String; - } - if (_json.containsKey('params')) { - params = - (_json['params'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (id != null) { - _json['id'] = id; - } - if (params != null) { - _json['params'] = params; - } - return _json; - } -} - -class Node { - /// Hostname or IP address of the Memcached node used by the clients to - /// connect to the Memcached server on this node. - /// - /// Output only. - core.String host; - - /// Identifier of the Memcached node. - /// - /// The node id does not include project or location like the Memcached - /// instance name. - /// - /// Output only. - core.String nodeId; - - /// User defined parameters currently applied to the node. - MemcacheParameters parameters; - - /// The port number of the Memcached server on this node. - /// - /// Output only. - core.int port; - - /// Current state of the Memcached node. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : Node state is not set. - /// - "CREATING" : Node is being created. - /// - "READY" : Node has been created and ready to be used. - /// - "DELETING" : Node is being deleted. - /// - "UPDATING" : Node is being updated. - core.String state; - - /// Location (GCP Zone) for the Memcached node. - /// - /// Output only. - core.String zone; - - Node(); - - Node.fromJson(core.Map _json) { - if (_json.containsKey('host')) { - host = _json['host'] as core.String; - } - if (_json.containsKey('nodeId')) { - nodeId = _json['nodeId'] as core.String; - } - if (_json.containsKey('parameters')) { - parameters = MemcacheParameters.fromJson( - _json['parameters'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('port')) { - port = _json['port'] as core.int; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('zone')) { - zone = _json['zone'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (host != null) { - _json['host'] = host; - } - if (nodeId != null) { - _json['nodeId'] = nodeId; - } - if (parameters != null) { - _json['parameters'] = parameters.toJson(); - } - if (port != null) { - _json['port'] = port; - } - if (state != null) { - _json['state'] = state; - } - if (zone != null) { - _json['zone'] = zone; - } - return _json; - } -} - -/// Configuration for a Memcached Node. -class NodeConfig { - /// Number of cpus per Memcached node. - /// - /// Required. - core.int cpuCount; - - /// Memory size in MiB for each Memcached node. - /// - /// Required. - core.int memorySizeMb; - - NodeConfig(); - - NodeConfig.fromJson(core.Map _json) { - if (_json.containsKey('cpuCount')) { - cpuCount = _json['cpuCount'] as core.int; - } - if (_json.containsKey('memorySizeMb')) { - memorySizeMb = _json['memorySizeMb'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cpuCount != null) { - _json['cpuCount'] = cpuCount; - } - if (memorySizeMb != null) { - _json['memorySizeMb'] = memorySizeMb; - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Request for UpdateParameters. -class UpdateParametersRequest { - /// The parameters to apply to the instance. - MemcacheParameters parameters; - - /// Mask of fields to update. - /// - /// Required. - core.String updateMask; - - UpdateParametersRequest(); - - UpdateParametersRequest.fromJson(core.Map _json) { - if (_json.containsKey('parameters')) { - parameters = MemcacheParameters.fromJson( - _json['parameters'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('updateMask')) { - updateMask = _json['updateMask'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (parameters != null) { - _json['parameters'] = parameters.toJson(); - } - if (updateMask != null) { - _json['updateMask'] = updateMask; - } - return _json; - } -} - -class ZoneMetadata { - ZoneMetadata(); - - ZoneMetadata.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/metastore/v1beta.dart b/generated/googleapis_beta/lib/metastore/v1beta.dart new file mode 100644 index 0000000..6cb96ae --- /dev/null +++ b/generated/googleapis_beta/lib/metastore/v1beta.dart
@@ -0,0 +1,3035 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Dataproc Metastore API - v1beta +/// +/// The Dataproc Metastore API is used to manage the lifecycle and configuration +/// of metastore services. +/// +/// For more information, see <https://cloud.google.com/dataproc-metastore/docs> +/// +/// Create an instance of [DataprocMetastoreApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsOperationsResource] +/// - [ProjectsLocationsServicesResource] +/// - [ProjectsLocationsServicesMetadataImportsResource] +library metastore.v1beta; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// The Dataproc Metastore API is used to manage the lifecycle and configuration +/// of metastore services. +class DataprocMetastoreApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + DataprocMetastoreApi(http.Client client, + {core.String rootUrl = 'https://metastore.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsServicesResource get services => + ProjectsLocationsServicesResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns google.rpc.Code.UNIMPLEMENTED. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + /// the name binding allows API services to override the binding to use + /// different resource name schemes, such as users / * /operations. To + /// override the binding, API services can add a binding such as + /// "/v1/{name=users / * }/operations" to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsServicesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsServicesMetadataImportsResource get metadataImports => + ProjectsLocationsServicesMetadataImportsResource(_requester); + + ProjectsLocationsServicesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a metastore service in a project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The relative resource name of the location in which + /// to create a metastore service, in the following + /// form:"projects/{project_number}/locations/{location_id}". + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [requestId] - Optional. A request ID. Specify a unique request ID to allow + /// the server to ignore the request if it has completed. The server will + /// ignore subsequent requests that provide a duplicate request ID for at + /// least 60 minutes after the first request.For example, if an initial + /// request times out, followed by another request with the same request ID, + /// the server ignores the second request to prevent the creation of duplicate + /// commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// [serviceId] - Required. The ID of the metastore service, which is used as + /// the final component of the metastore service's name.This value must be + /// between 2 and 63 characters long inclusive, begin with a letter, end with + /// a letter or number, and consist of alpha-numeric ASCII characters or + /// hyphens. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + Service request, + core.String parent, { + core.String requestId, + core.String serviceId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (serviceId != null) { + _queryParams['serviceId'] = [serviceId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/services'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a single service. + /// + /// Request parameters: + /// + /// [name] - Required. The relative resource name of the metastore service to + /// delete, in the following + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [requestId] - Optional. A request ID. Specify a unique request ID to allow + /// the server to ignore the request if it has completed. The server will + /// ignore subsequent requests that provide a duplicate request ID for at + /// least 60 minutes after the first request.For example, if an initial + /// request times out, followed by another request with the same request ID, + /// the server ignores the second request to prevent the creation of duplicate + /// commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> delete( + core.String name, { + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Exports metadata from a service. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [service] - Required. The relative resource name of the metastore service + /// to run export, in the following + /// form:"projects/{project_id}/locations/{location_id}/services/{service_id} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> exportMetadata( + ExportMetadataRequest request, + core.String service, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (service == null) { + throw core.ArgumentError('Parameter service is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$service') + + ':exportMetadata'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the details of a single service. + /// + /// Request parameters: + /// + /// [name] - Required. The relative resource name of the metastore service to + /// retrieve, in the following + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Service]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Service> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Service.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned.Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected.Requests for policies with any conditional bindings + /// must specify version 3. Policies without any conditional bindings may + /// specify any valid value or leave the field unset.To learn which resources + /// support conditions in their IAM policies, see the IAM documentation + /// (https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists services in a project and location. + /// + /// Request parameters: + /// + /// [parent] - Required. The relative resource name of the location of + /// metastore services to list, in the following + /// form:"projects/{project_number}/locations/{location_id}". + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - Optional. The filter to apply to list results. + /// + /// [orderBy] - Optional. Specify the ordering of results as described in + /// Sorting Order. If not specified, the results will be sorted in the default + /// order. + /// + /// [pageSize] - Optional. The maximum number of services to return. The + /// response may contain less than the maximum number. If unspecified, no more + /// than 500 services are returned. The maximum value is 1000; values above + /// 1000 are changed to 1000. + /// + /// [pageToken] - Optional. A page token, received from a previous + /// DataprocMetastore.ListServices call. Provide this token to retrieve the + /// subsequent page.To retrieve the first page, supply an empty page + /// token.When paginating, other parameters provided to + /// DataprocMetastore.ListServices must match the call that provided the page + /// token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListServicesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListServicesResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/services'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListServicesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the parameters of a single service. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Immutable. The relative resource name of the metastore service, + /// of the + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [requestId] - Optional. A request ID. Specify a unique request ID to allow + /// the server to ignore the request if it has completed. The server will + /// ignore subsequent requests that provide a duplicate request ID for at + /// least 60 minutes after the first request.For example, if an initial + /// request times out, followed by another request with the same request ID, + /// the server ignores the second request to prevent the creation of duplicate + /// commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// [updateMask] - Required. A field mask used to specify the fields to be + /// overwritten in the metastore service resource by the update. Fields + /// specified in the update_mask are relative to the resource (not to the full + /// request). A field is overwritten if it is in the mask. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + Service request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and + /// PERMISSION_DENIED errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error.Note: This operation is designed to be + /// used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsServicesMetadataImportsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsServicesMetadataImportsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new MetadataImport in a given project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The relative resource name of the service in which to + /// create a metastore import, in the following + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}" + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [metadataImportId] - Required. The ID of the metadata import, which is + /// used as the final component of the metadata import's name.This value must + /// be between 1 and 64 characters long, begin with a letter, end with a + /// letter or number, and consist of alpha-numeric ASCII characters or + /// hyphens. + /// + /// [requestId] - Optional. A request ID. Specify a unique request ID to allow + /// the server to ignore the request if it has completed. The server will + /// ignore subsequent requests that provide a duplicate request ID for at + /// least 60 minutes after the first request.For example, if an initial + /// request times out, followed by another request with the same request ID, + /// the server ignores the second request to prevent the creation of duplicate + /// commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + MetadataImport request, + core.String parent, { + core.String metadataImportId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (metadataImportId != null) { + _queryParams['metadataImportId'] = [metadataImportId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/metadataImports'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single import. + /// + /// Request parameters: + /// + /// [name] - Required. The relative resource name of the metadata import to + /// retrieve, in the following + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+/metadataImports/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [MetadataImport]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<MetadataImport> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + MetadataImport.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists imports in a service. + /// + /// Request parameters: + /// + /// [parent] - Required. The relative resource name of the service whose + /// metadata imports to list, in the following + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+$`. + /// + /// [filter] - Optional. The filter to apply to list results. + /// + /// [orderBy] - Optional. Specify the ordering of results as described in + /// Sorting Order. If not specified, the results will be sorted in the default + /// order. + /// + /// [pageSize] - Optional. The maximum number of imports to return. The + /// response may contain less than the maximum number. If unspecified, no more + /// than 500 imports are returned. The maximum value is 1000; values above + /// 1000 are changed to 1000. + /// + /// [pageToken] - Optional. A page token, received from a previous + /// DataprocMetastore.ListServices call. Provide this token to retrieve the + /// subsequent page.To retrieve the first page, supply an empty page + /// token.When paginating, other parameters provided to + /// DataprocMetastore.ListServices must match the call that provided the page + /// token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListMetadataImportsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListMetadataImportsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/metadataImports'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListMetadataImportsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a single import. + /// + /// Only the description field of MetadataImport is supported to be updated. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Immutable. The relative resource name of the metadata import, of + /// the + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/services/\[^/\]+/metadataImports/\[^/\]+$`. + /// + /// [requestId] - Optional. A request ID. Specify a unique request ID to allow + /// the server to ignore the request if it has completed. The server will + /// ignore subsequent requests that provide a duplicate request ID for at + /// least 60 minutes after the first request.For example, if an initial + /// request times out, followed by another request with the same request ID, + /// the server ignores the second request to prevent the creation of duplicate + /// commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// [updateMask] - Required. A field mask used to specify the fields to be + /// overwritten in the metadata import resource by the update. Fields + /// specified in the update_mask are relative to the resource (not to the full + /// request). A field is overwritten if it is in the mask. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + MetadataImport request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Specifies the audit configuration for a service. +/// +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. An AuditConfig must have one +/// or more AuditLogConfigs.If there are AuditConfigs for both allServices and a +/// specific service, the union of the two AuditConfigs is used for that +/// service: the log_types specified in each AuditConfig are enabled, and the +/// exempted_members in each AuditLogConfig are exempted.Example Policy with +/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", +/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ +/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": +/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", +/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": +/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +class AuditConfig { + /// The configuration for logging of each type of permission. + core.List<AuditLogConfig> auditLogConfigs; + + /// Specifies a service that will be enabled for audit logging. + /// + /// For example, storage.googleapis.com, cloudsql.googleapis.com. allServices + /// is a special value that covers all services. + core.String service; + + AuditConfig(); + + AuditConfig.fromJson(core.Map _json) { + if (_json.containsKey('auditLogConfigs')) { + auditLogConfigs = (_json['auditLogConfigs'] as core.List) + .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('service')) { + service = _json['service'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditLogConfigs != null) { + _json['auditLogConfigs'] = + auditLogConfigs.map((value) => value.toJson()).toList(); + } + if (service != null) { + _json['service'] = service; + } + return _json; + } +} + +/// Provides the configuration for logging a type of permissions. +/// +/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", +/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": +/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while +/// exempting jose@example.com from DATA_READ logging. +class AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// + /// Follows the same format of Binding.members. + core.List<core.String> exemptedMembers; + + /// The log type that this config enables. + /// Possible string values are: + /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. + /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy + /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create + /// - "DATA_READ" : Data reads. Example: CloudSQL Users list + core.String logType; + + AuditLogConfig(); + + AuditLogConfig.fromJson(core.Map _json) { + if (_json.containsKey('exemptedMembers')) { + exemptedMembers = (_json['exemptedMembers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('logType')) { + logType = _json['logType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exemptedMembers != null) { + _json['exemptedMembers'] = exemptedMembers; + } + if (logType != null) { + _json['logType'] = logType; + } + return _json; + } +} + +/// Associates members with a role. +class Binding { + /// The condition that is associated with this binding.If the condition + /// evaluates to true, then this binding applies to the current request.If the + /// condition evaluates to false, then this binding does not apply to the + /// current request. + /// + /// However, a different role binding might grant the same role to one or more + /// of the members in this binding.To learn which resources support conditions + /// in their IAM policies, see the IAM documentation + /// (https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition; + + /// Specifies the identities requesting access for a Cloud Platform resource. + /// + /// members can have the following values: allUsers: A special identifier that + /// represents anyone who is on the internet; with or without a Google + /// account. allAuthenticatedUsers: A special identifier that represents + /// anyone who is authenticated with a Google account or a service account. + /// user:{emailid}: An email address that represents a specific Google + /// account. For example, alice@example.com . serviceAccount:{emailid}: An + /// email address that represents a service account. For example, + /// my-other-app@appspot.gserviceaccount.com. group:{emailid}: An email + /// address that represents a Google group. For example, admins@example.com. + /// deleted:user:{emailid}?uid={uniqueid}: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, alice@example.com?uid=123456789012345678901. If the user is + /// recovered, this value reverts to user:{emailid} and the recovered user + /// retains the role in the binding. + /// deleted:serviceAccount:{emailid}?uid={uniqueid}: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. If the + /// service account is undeleted, this value reverts to + /// serviceAccount:{emailid} and the undeleted service account retains the + /// role in the binding. deleted:group:{emailid}?uid={uniqueid}: An email + /// address (plus unique identifier) representing a Google group that has been + /// recently deleted. For example, + /// admins@example.com?uid=123456789012345678901. If the group is recovered, + /// this value reverts to group:{emailid} and the recovered group retains the + /// role in the binding. domain:{domain}: The G Suite domain (primary) that + /// represents all the users of that domain. For example, google.com or + /// example.com. + core.List<core.String> members; + + /// Role that is assigned to members. + /// + /// For example, roles/viewer, roles/editor, or roles/owner. + core.String role; + + Binding(); + + Binding.fromJson(core.Map _json) { + if (_json.containsKey('condition')) { + condition = Expr.fromJson( + _json['condition'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('members')) { + members = (_json['members'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('role')) { + role = _json['role'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (condition != null) { + _json['condition'] = condition.toJson(); + } + if (members != null) { + _json['members'] = members; + } + if (role != null) { + _json['role'] = role; + } + return _json; + } +} + +/// A specification of the location of and metadata about a database dump from a +/// relational database management system. +class DatabaseDump { + /// The type of the database. + /// Possible string values are: + /// - "DATABASE_TYPE_UNSPECIFIED" : The type of the source database is + /// unknown. + /// - "MYSQL" : The type of the source database is MySQL. + core.String databaseType; + + /// A Cloud Storage object URI that specifies the source from which to import + /// metadata. + /// + /// It must begin with gs://. + core.String gcsUri; + + /// The name of the source database. + core.String sourceDatabase; + + DatabaseDump(); + + DatabaseDump.fromJson(core.Map _json) { + if (_json.containsKey('databaseType')) { + databaseType = _json['databaseType'] as core.String; + } + if (_json.containsKey('gcsUri')) { + gcsUri = _json['gcsUri'] as core.String; + } + if (_json.containsKey('sourceDatabase')) { + sourceDatabase = _json['sourceDatabase'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (databaseType != null) { + _json['databaseType'] = databaseType; + } + if (gcsUri != null) { + _json['gcsUri'] = gcsUri; + } + if (sourceDatabase != null) { + _json['sourceDatabase'] = sourceDatabase; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for Empty is empty JSON +/// object {}. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for DataprocMetastore.ExportMetadata. +class ExportMetadataRequest { + /// A Cloud Storage URI of a folder that metadata are exported to, in the + /// format gs:///. + /// + /// A sub-folder containing exported files will be created below it. + /// + /// Required. + core.String destinationGcsFolder; + + /// A request ID. + /// + /// Specify a unique request ID to allow the server to ignore the request if + /// it has completed. The server will ignore subsequent requests that provide + /// a duplicate request ID for at least 60 minutes after the first request.For + /// example, if an initial request times out, followed by another request with + /// the same request ID, the server ignores the second request to prevent the + /// creation of duplicate commitments.The request ID must be a valid UUID + /// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). A + /// zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + /// + /// Optional. + core.String requestId; + + ExportMetadataRequest(); + + ExportMetadataRequest.fromJson(core.Map _json) { + if (_json.containsKey('destinationGcsFolder')) { + destinationGcsFolder = _json['destinationGcsFolder'] as core.String; + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (destinationGcsFolder != null) { + _json['destinationGcsFolder'] = destinationGcsFolder; + } + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. +/// +/// CEL is a C-like expression language. The syntax and semantics of CEL are +/// documented at https://github.com/google/cel-spec.Example (Comparison): +/// title: "Summary size limit" description: "Determines if a summary is less +/// than 100 chars" expression: "document.summary.size() < 100" Example +/// (Equality): title: "Requestor is owner" description: "Determines if +/// requestor is the document owner" expression: "document.owner == +/// request.auth.claims.email" Example (Logic): title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): title: "Notification string" description: +/// "Create a notification string with a timestamp." expression: "'New message +/// received at ' + string(document.create_time)" The exact variables and +/// functions that may be referenced within an expression are determined by the +/// service that evaluates it. See the service documentation for additional +/// information. +class Expr { + /// Description of the expression. + /// + /// This is a longer text which describes the expression, e.g. when hovered + /// over it in a UI. + /// + /// Optional. + core.String description; + + /// Textual representation of an expression in Common Expression Language + /// syntax. + core.String expression; + + /// String indicating the location of the expression for error reporting, e.g. + /// a file name and a position in the file. + /// + /// Optional. + core.String location; + + /// Title for the expression, i.e. a short string describing its purpose. + /// + /// This can be used e.g. in UIs which allow to enter the expression. + /// + /// Optional. + core.String title; + + Expr(); + + Expr.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('location')) { + location = _json['location'] as core.String; + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (location != null) { + _json['location'] = location; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// Specifies configuration information specific to running Hive metastore +/// software as the metastore service. +class HiveMetastoreConfig { + /// A mapping of Hive metastore configuration key-value pairs to apply to the + /// Hive metastore (configured in hive-site.xml). + /// + /// The mappings override system defaults (some keys cannot be overridden). + core.Map<core.String, core.String> configOverrides; + + /// Information used to configure the Hive metastore service as a service + /// principal in a Kerberos realm. + /// + /// To disable Kerberos, use the UpdateService method and specify this field's + /// path ("hive_metastore_config.kerberos_config") in the request's + /// update_mask while omitting this field from the request's service. + KerberosConfig kerberosConfig; + + /// The Hive metastore schema version. + /// + /// Immutable. + core.String version; + + HiveMetastoreConfig(); + + HiveMetastoreConfig.fromJson(core.Map _json) { + if (_json.containsKey('configOverrides')) { + configOverrides = (_json['configOverrides'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('kerberosConfig')) { + kerberosConfig = KerberosConfig.fromJson( + _json['kerberosConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('version')) { + version = _json['version'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (configOverrides != null) { + _json['configOverrides'] = configOverrides; + } + if (kerberosConfig != null) { + _json['kerberosConfig'] = kerberosConfig.toJson(); + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// A specification of a supported version of the Hive Metastore software. +class HiveMetastoreVersion { + /// Whether version will be chosen by the server if a metastore service is + /// created with a HiveMetastoreConfig that omits the version. + core.bool isDefault; + + /// The semantic version of the Hive Metastore software. + core.String version; + + HiveMetastoreVersion(); + + HiveMetastoreVersion.fromJson(core.Map _json) { + if (_json.containsKey('isDefault')) { + isDefault = _json['isDefault'] as core.bool; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (isDefault != null) { + _json['isDefault'] = isDefault; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// Configuration information for a Kerberos principal. +class KerberosConfig { + /// A Kerberos keytab file that can be used to authenticate a service + /// principal with a Kerberos Key Distribution Center (KDC). + Secret keytab; + + /// A Cloud Storage URI that specifies the path to a krb5.conf file. + /// + /// It is of the form gs://{bucket_name}/path/to/krb5.conf, although the file + /// does not need to be named krb5.conf explicitly. + core.String krb5ConfigGcsUri; + + /// A Kerberos principal that exists in the both the keytab the KDC to + /// authenticate as. + /// + /// A typical principal is of the form "primary/instance@REALM", but there is + /// no exact format. + core.String principal; + + KerberosConfig(); + + KerberosConfig.fromJson(core.Map _json) { + if (_json.containsKey('keytab')) { + keytab = Secret.fromJson( + _json['keytab'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('krb5ConfigGcsUri')) { + krb5ConfigGcsUri = _json['krb5ConfigGcsUri'] as core.String; + } + if (_json.containsKey('principal')) { + principal = _json['principal'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (keytab != null) { + _json['keytab'] = keytab.toJson(); + } + if (krb5ConfigGcsUri != null) { + _json['krb5ConfigGcsUri'] = krb5ConfigGcsUri; + } + if (principal != null) { + _json['principal'] = principal; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for DataprocMetastore.ListMetadataImports. +class ListMetadataImportsResponse { + /// The imports in the specified service. + core.List<MetadataImport> metadataImports; + + /// A token that can be sent as page_token to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListMetadataImportsResponse(); + + ListMetadataImportsResponse.fromJson(core.Map _json) { + if (_json.containsKey('metadataImports')) { + metadataImports = (_json['metadataImports'] as core.List) + .map<MetadataImport>((value) => MetadataImport.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metadataImports != null) { + _json['metadataImports'] = + metadataImports.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class ListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<Operation> operations; + + ListOperationsResponse(); + + ListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for DataprocMetastore.ListServices. +class ListServicesResponse { + /// A token that can be sent as page_token to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// The services in the specified location. + core.List<Service> services; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListServicesResponse(); + + ListServicesResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('services')) { + services = (_json['services'] as core.List) + .map<Service>((value) => + Service.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (services != null) { + _json['services'] = services.map((value) => value.toJson()).toList(); + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: "us-east1". + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: "projects/example-project/locations/us-east1" + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Metadata about the service in a location. +class LocationMetadata { + /// The versions of Hive Metastore that can be used when creating a new + /// metastore service in this location. + /// + /// The server guarantees that exactly one HiveMetastoreVersion in the list + /// will set is_default. + core.List<HiveMetastoreVersion> supportedHiveMetastoreVersions; + + LocationMetadata(); + + LocationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('supportedHiveMetastoreVersions')) { + supportedHiveMetastoreVersions = (_json['supportedHiveMetastoreVersions'] + as core.List) + .map<HiveMetastoreVersion>((value) => HiveMetastoreVersion.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (supportedHiveMetastoreVersions != null) { + _json['supportedHiveMetastoreVersions'] = supportedHiveMetastoreVersions + .map((value) => value.toJson()) + .toList(); + } + return _json; + } +} + +/// Maintenance window. +/// +/// This specifies when Dataproc Metastore may perform system maintenance +/// operation to the service. +class MaintenanceWindow { + /// The day of week, when the window starts. + /// Possible string values are: + /// - "DAY_OF_WEEK_UNSPECIFIED" : The day of the week is unspecified. + /// - "MONDAY" : Monday + /// - "TUESDAY" : Tuesday + /// - "WEDNESDAY" : Wednesday + /// - "THURSDAY" : Thursday + /// - "FRIDAY" : Friday + /// - "SATURDAY" : Saturday + /// - "SUNDAY" : Sunday + core.String dayOfWeek; + + /// The hour of day (0-23) when the window starts. + core.int hourOfDay; + + MaintenanceWindow(); + + MaintenanceWindow.fromJson(core.Map _json) { + if (_json.containsKey('dayOfWeek')) { + dayOfWeek = _json['dayOfWeek'] as core.String; + } + if (_json.containsKey('hourOfDay')) { + hourOfDay = _json['hourOfDay'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dayOfWeek != null) { + _json['dayOfWeek'] = dayOfWeek; + } + if (hourOfDay != null) { + _json['hourOfDay'] = hourOfDay; + } + return _json; + } +} + +/// The details of a metadata export operation. +class MetadataExport { + /// A Cloud Storage URI of a folder that metadata are exported to, in the form + /// of gs:////, where \` is automatically generated. + /// + /// Output only. + core.String destinationGcsUri; + + /// The time when the export ended. + /// + /// Output only. + core.String endTime; + + /// The time when the export started. + /// + /// Output only. + core.String startTime; + + /// The current state of the export. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state of the metadata export is unknown. + /// - "RUNNING" : The metadata export is running. + /// - "SUCCEEDED" : The metadata export completed successfully. + /// - "FAILED" : The metadata export failed. + /// - "CANCELLED" : The metadata export is cancelled. + core.String state; + + MetadataExport(); + + MetadataExport.fromJson(core.Map _json) { + if (_json.containsKey('destinationGcsUri')) { + destinationGcsUri = _json['destinationGcsUri'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (destinationGcsUri != null) { + _json['destinationGcsUri'] = destinationGcsUri; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (state != null) { + _json['state'] = state; + } + return _json; + } +} + +/// A metastore resource that imports metadata. +class MetadataImport { + /// The time when the metadata import was created. + /// + /// Output only. + core.String createTime; + + /// A database dump from a pre-existing metastore's database. + /// + /// Immutable. + DatabaseDump databaseDump; + + /// The description of the metadata import. + core.String description; + + /// The relative resource name of the metadata import, of the + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}". + /// + /// Immutable. + core.String name; + + /// The current state of the metadata import. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state of the metadata import is unknown. + /// - "RUNNING" : The metadata import is running. + /// - "SUCCEEDED" : The metadata import completed successfully. + /// - "UPDATING" : The metadata import is being updated. + /// - "FAILED" : The metadata import failed, and attempted metadata changes + /// were rolled back. + core.String state; + + /// The time when the metadata import was last updated. + /// + /// Output only. + core.String updateTime; + + MetadataImport(); + + MetadataImport.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('databaseDump')) { + databaseDump = DatabaseDump.fromJson( + _json['databaseDump'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (databaseDump != null) { + _json['databaseDump'] = databaseDump.toJson(); + } + if (description != null) { + _json['description'] = description; + } + if (name != null) { + _json['name'] = name; + } + if (state != null) { + _json['state'] = state; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Specifies how metastore metadata should be integrated with external +/// services. +class MetadataIntegration { + MetadataIntegration(); + + MetadataIntegration.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The metadata management activities of the metastore service. +class MetadataManagementActivity { + /// The latest metadata exports of the metastore service. + /// + /// Output only. + core.List<MetadataExport> metadataExports; + + MetadataManagementActivity(); + + MetadataManagementActivity.fromJson(core.Map _json) { + if (_json.containsKey('metadataExports')) { + metadataExports = (_json['metadataExports'] as core.List) + .map<MetadataExport>((value) => MetadataExport.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metadataExports != null) { + _json['metadataExports'] = + metadataExports.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class Operation { + /// If the value is false, it means the operation is still in progress. + /// + /// If true, the operation is completed, and either error or response is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + Status error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the name should be a resource name + /// ending with operations/{unique_id}. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as Delete, the + /// response is google.protobuf.Empty. If the original method is standard + /// Get/Create/Update, the response should be the resource. For other methods, + /// the response should have the type XxxResponse, where Xxx is the original + /// method name. For example, if the original method name is TakeSnapshot(), + /// the inferred response type is TakeSnapshotResponse. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources.A Policy is a collection of bindings. +/// +/// A binding binds one or more members to a single role. Members can be user +/// accounts, service accounts, Google groups, and domains (such as G Suite). A +/// role is a named list of permissions; each role can be an IAM predefined role +/// or a user-created custom role.For some types of Google Cloud resources, a +/// binding can also specify a condition, which is a logical expression that +/// allows access to a resource only if the expression evaluates to true. A +/// condition can add constraints based on attributes of the request, the +/// resource, or both. To learn which resources support conditions in their IAM +/// policies, see the IAM documentation +/// (https://cloud.google.com/iam/help/conditions/resource-policies).JSON +/// example: { "bindings": \[ { "role": +/// "roles/resourcemanager.organizationAdmin", "members": \[ +/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": +/// "roles/resourcemanager.organizationViewer", "members": \[ +/// "user:eve@example.com" \], "condition": { "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", "expression": +/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": +/// "BwWWja0YfJA=", "version": 3 } YAML example: bindings: - members: - +/// user:mike@example.com - group:admins@example.com - domain:google.com - +/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer condition: title: expirable +/// access description: Does not grant access after Sep 2020 expression: +/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - +/// version: 3 For a description of IAM and its features, see the IAM +/// documentation (https://cloud.google.com/iam/docs/). +class Policy { + /// Specifies cloud audit logging configuration for this policy. + core.List<AuditConfig> auditConfigs; + + /// Associates a list of members to a role. + /// + /// Optionally, may specify a condition that determines how and when the + /// bindings are applied. Each of the bindings must contain at least one + /// member. + core.List<Binding> bindings; + + /// etag is used for optimistic concurrency control as a way to help prevent + /// simultaneous updates of a policy from overwriting each other. + /// + /// It is strongly suggested that systems make use of the etag in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An etag is returned in the response to getIamPolicy, and + /// systems are expected to put that etag in the request to setIamPolicy to + /// ensure that their change will be applied to the same version of the + /// policy.Important: If you use IAM Conditions, you must include the etag + /// field whenever you call setIamPolicy. If you omit this field, then IAM + /// allows you to overwrite a version 3 policy with a version 1 policy, and + /// all of the conditions in the version 3 policy are lost. + core.String etag; + core.List<core.int> get etagAsBytes => convert.base64.decode(etag); + + set etagAsBytes(core.List<core.int> _bytes) { + etag = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Specifies the format of the policy.Valid values are 0, 1, and 3. + /// + /// Requests that specify an invalid value are rejected.Any operation that + /// affects conditional role bindings must specify version 3. This requirement + /// applies to the following operations: Getting a policy that includes a + /// conditional role binding Adding a conditional role binding to a policy + /// Changing a conditional role binding in a policy Removing any role binding, + /// with or without a condition, from a policy that includes + /// conditionsImportant: If you use IAM Conditions, you must include the etag + /// field whenever you call setIamPolicy. If you omit this field, then IAM + /// allows you to overwrite a version 3 policy with a version 1 policy, and + /// all of the conditions in the version 3 policy are lost.If a policy does + /// not include any conditions, operations on that policy may specify any + /// valid version or leave the field unset.To learn which resources support + /// conditions in their IAM policies, see the IAM documentation + /// (https://cloud.google.com/iam/help/conditions/resource-policies). + core.int version; + + Policy(); + + Policy.fromJson(core.Map _json) { + if (_json.containsKey('auditConfigs')) { + auditConfigs = (_json['auditConfigs'] as core.List) + .map<AuditConfig>((value) => AuditConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('bindings')) { + bindings = (_json['bindings'] as core.List) + .map<Binding>((value) => + Binding.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('etag')) { + etag = _json['etag'] as core.String; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditConfigs != null) { + _json['auditConfigs'] = + auditConfigs.map((value) => value.toJson()).toList(); + } + if (bindings != null) { + _json['bindings'] = bindings.map((value) => value.toJson()).toList(); + } + if (etag != null) { + _json['etag'] = etag; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// A securely stored value. +class Secret { + /// The relative resource name of a Secret Manager secret version, in the + /// following + /// form:"projects/{project_number}/secrets/{secret_id}/versions/{version_id}". + core.String cloudSecret; + + Secret(); + + Secret.fromJson(core.Map _json) { + if (_json.containsKey('cloudSecret')) { + cloudSecret = _json['cloudSecret'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cloudSecret != null) { + _json['cloudSecret'] = cloudSecret; + } + return _json; + } +} + +/// A managed metastore service that serves metadata queries. +class Service { + /// A Cloud Storage URI (starting with gs://) that specifies where artifacts + /// related to the metastore service are stored. + /// + /// Output only. + core.String artifactGcsUri; + + /// The time when the metastore service was created. + /// + /// Output only. + core.String createTime; + + /// The URI of the endpoint used to access the metastore service. + /// + /// Output only. + core.String endpointUri; + + /// Configuration information specific to running Hive metastore software as + /// the metastore service. + HiveMetastoreConfig hiveMetastoreConfig; + + /// User-defined labels for the metastore service. + core.Map<core.String, core.String> labels; + + /// The one hour maintenance window of the metastore service. + /// + /// This specifies when the service can be restarted for maintenance purposes + /// in UTC time. + MaintenanceWindow maintenanceWindow; + + /// The setting that defines how metastore metadata should be integrated with + /// external services and systems. + MetadataIntegration metadataIntegration; + + /// The metadata management activities of the metastore service. + /// + /// Output only. + MetadataManagementActivity metadataManagementActivity; + + /// The relative resource name of the metastore service, of the + /// form:"projects/{project_number}/locations/{location_id}/services/{service_id}". + /// + /// Immutable. + core.String name; + + /// The relative resource name of the VPC network on which the instance can be + /// accessed. + /// + /// The network must belong to the same project as the metastore instance. It + /// is specified in the following + /// form:"projects/{project_number}/global/networks/{network_id}". + /// + /// Immutable. + core.String network; + + /// The TCP port at which the metastore service is reached. + /// + /// Default: 9083. + core.int port; + + /// The current state of the metastore service. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : The state of the metastore service is unknown. + /// - "CREATING" : The metastore service is in the process of being created. + /// - "ACTIVE" : The metastore service is running and ready to serve queries. + /// - "SUSPENDING" : The metastore service is entering suspension. Its + /// query-serving availability may cease unexpectedly. + /// - "SUSPENDED" : The metastore service is suspended and unable to serve + /// queries. + /// - "UPDATING" : The metastore service is being updated. It remains usable + /// but cannot accept additional update requests or be deleted at this time. + /// - "DELETING" : The metastore service is undergoing deletion. It cannot be + /// used. + /// - "ERROR" : The metastore service has encountered an error and cannot be + /// used. The metastore service should be deleted. + core.String state; + + /// Additional information about the current state of the metastore service, + /// if available. + /// + /// Output only. + core.String stateMessage; + + /// The tier of the service. + /// Possible string values are: + /// - "TIER_UNSPECIFIED" : The tier is not set. + /// - "DEVELOPER" : The developer tier provides limited scalability and no + /// fault tolerance. Good for low-cost proof-of-concept. + /// - "ENTERPRISE" : The enterprise tier provides multi-zone high + /// availability, and sufficient scalability for enterprise-level Dataproc + /// Metastore workloads. + core.String tier; + + /// The globally unique resource identifier of the metastore service. + /// + /// Output only. + core.String uid; + + /// The time when the metastore service was last updated. + /// + /// Output only. + core.String updateTime; + + Service(); + + Service.fromJson(core.Map _json) { + if (_json.containsKey('artifactGcsUri')) { + artifactGcsUri = _json['artifactGcsUri'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endpointUri')) { + endpointUri = _json['endpointUri'] as core.String; + } + if (_json.containsKey('hiveMetastoreConfig')) { + hiveMetastoreConfig = HiveMetastoreConfig.fromJson( + _json['hiveMetastoreConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('maintenanceWindow')) { + maintenanceWindow = MaintenanceWindow.fromJson( + _json['maintenanceWindow'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadataIntegration')) { + metadataIntegration = MetadataIntegration.fromJson( + _json['metadataIntegration'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadataManagementActivity')) { + metadataManagementActivity = MetadataManagementActivity.fromJson( + _json['metadataManagementActivity'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('network')) { + network = _json['network'] as core.String; + } + if (_json.containsKey('port')) { + port = _json['port'] as core.int; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('stateMessage')) { + stateMessage = _json['stateMessage'] as core.String; + } + if (_json.containsKey('tier')) { + tier = _json['tier'] as core.String; + } + if (_json.containsKey('uid')) { + uid = _json['uid'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (artifactGcsUri != null) { + _json['artifactGcsUri'] = artifactGcsUri; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endpointUri != null) { + _json['endpointUri'] = endpointUri; + } + if (hiveMetastoreConfig != null) { + _json['hiveMetastoreConfig'] = hiveMetastoreConfig.toJson(); + } + if (labels != null) { + _json['labels'] = labels; + } + if (maintenanceWindow != null) { + _json['maintenanceWindow'] = maintenanceWindow.toJson(); + } + if (metadataIntegration != null) { + _json['metadataIntegration'] = metadataIntegration.toJson(); + } + if (metadataManagementActivity != null) { + _json['metadataManagementActivity'] = metadataManagementActivity.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (network != null) { + _json['network'] = network; + } + if (port != null) { + _json['port'] = port; + } + if (state != null) { + _json['state'] = state; + } + if (stateMessage != null) { + _json['stateMessage'] = stateMessage; + } + if (tier != null) { + _json['tier'] = tier; + } + if (uid != null) { + _json['uid'] = uid; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Request message for SetIamPolicy method. +class SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the resource. + /// + /// The size of the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) might + /// reject them. + Policy policy; + + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. + /// + /// Only the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used:paths: "bindings, etag" + core.String updateMask; + + SetIamPolicyRequest(); + + SetIamPolicyRequest.fromJson(core.Map _json) { + if (_json.containsKey('policy')) { + policy = Policy.fromJson( + _json['policy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (policy != null) { + _json['policy'] = policy.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// The Status type defines a logical error model that is suitable for different +/// programming environments, including REST APIs and RPC APIs. +/// +/// It is used by gRPC (https://github.com/grpc). Each Status message contains +/// three pieces of data: error code, error message, and error details.You can +/// find out more about this error model and how to work with it in the API +/// Design Guide (https://cloud.google.com/apis/design/errors). +class Status { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + Status(); + + Status.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// Request message for TestIamPermissions method. +class TestIamPermissionsRequest { + /// The set of permissions to check for the resource. + /// + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// For more information see IAM Overview + /// (https://cloud.google.com/iam/docs/overview#permissions). + core.List<core.String> permissions; + + TestIamPermissionsRequest(); + + TestIamPermissionsRequest.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Response message for TestIamPermissions method. +class TestIamPermissionsResponse { + /// A subset of TestPermissionsRequest.permissions that the caller is allowed. + core.List<core.String> permissions; + + TestIamPermissionsResponse(); + + TestIamPermissionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/networkconnectivity/v1alpha1.dart b/generated/googleapis_beta/lib/networkconnectivity/v1alpha1.dart new file mode 100644 index 0000000..afec353 --- /dev/null +++ b/generated/googleapis_beta/lib/networkconnectivity/v1alpha1.dart
@@ -0,0 +1,5141 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Network Connectivity API - v1alpha1 +/// +/// The Network Connectivity API will be home to various services which provide +/// information pertaining to network connectivity. +/// +/// For more information, see <https://cloud.google.com/> +/// +/// Create an instance of [NetworkconnectivityApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsGlobalResource] +/// - [ProjectsLocationsGlobalHubsResource] +/// - [ProjectsLocationsOperationsResource] +/// - [ProjectsLocationsPolicyBasedRoutesResource] +/// - [ProjectsLocationsPrivateRangesResource] +/// - [ProjectsLocationsSpokesResource] +library networkconnectivity.v1alpha1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// The Network Connectivity API will be home to various services which provide +/// information pertaining to network connectivity. +class NetworkconnectivityApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + NetworkconnectivityApi(http.Client client, + {core.String rootUrl = 'https://networkconnectivity.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsGlobalResource get global => + ProjectsLocationsGlobalResource(_requester); + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsPolicyBasedRoutesResource get policyBasedRoutes => + ProjectsLocationsPolicyBasedRoutesResource(_requester); + ProjectsLocationsPrivateRangesResource get privateRanges => + ProjectsLocationsPrivateRangesResource(_requester); + ProjectsLocationsSpokesResource get spokes => + ProjectsLocationsSpokesResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsGlobalResource { + final commons.ApiRequester _requester; + + ProjectsLocationsGlobalHubsResource get hubs => + ProjectsLocationsGlobalHubsResource(_requester); + + ProjectsLocationsGlobalResource(commons.ApiRequester client) + : _requester = client; +} + +class ProjectsLocationsGlobalHubsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsGlobalHubsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new Hub in a given project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource's name of the Hub. + /// Value must have pattern `^projects/\[^/\]+/locations/global$`. + /// + /// [hubId] - Optional. Unique id for the Hub to create. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> create( + Hub request, + core.String parent, { + core.String hubId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (hubId != null) { + _queryParams['hubId'] = [hubId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/hubs'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a single Hub. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the Hub to delete. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes after the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> delete( + core.String name, { + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single Hub. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the Hub resource to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Hub]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Hub> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Hub.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists Hubs in a given project and location. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource's name. + /// Value must have pattern `^projects/\[^/\]+/locations/global$`. + /// + /// [filter] - A filter expression that filters the results listed in the + /// response. + /// + /// [orderBy] - Sort the results by a certain order. + /// + /// [pageSize] - The maximum number of results per page that should be + /// returned. + /// + /// [pageToken] - The page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListHubsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListHubsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/hubs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListHubsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the parameters of a single Hub. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Immutable. The name of a Hub resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [updateMask] - Optional. Field mask is used to specify the fields to be + /// overwritten in the Hub resource by the update. The fields specified in the + /// update_mask are relative to the resource, not the full request. A field + /// will be overwritten if it is in the mask. If the user does not provide a + /// mask then all fields will be overwritten. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> patch( + Hub request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/global/hubs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Starts asynchronous cancellation on a long-running operation. + /// + /// The server makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + /// or other methods to check whether the cancellation succeeded or whether + /// the operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with an + /// Operation.error value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be cancelled. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> cancel( + GoogleLongrunningCancelOperationRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':cancel'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsPolicyBasedRoutesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsPolicyBasedRoutesResource(commons.ApiRequester client) + : _requester = client; + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/policyBasedRoutes/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/policyBasedRoutes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/policyBasedRoutes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsPrivateRangesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsPrivateRangesResource(commons.ApiRequester client) + : _requester = client; + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/privateRanges/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/privateRanges/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/privateRanges/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsSpokesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsSpokesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new Spoke in a given project and location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent's resource name of the Spoke. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [spokeId] - Optional. Unique id for the Spoke to create. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> create( + Spoke request, + core.String parent, { + core.String requestId, + core.String spokeId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (spokeId != null) { + _queryParams['spokeId'] = [spokeId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/spokes'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a single Spoke. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the Spoke to delete. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes after the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> delete( + core.String name, { + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single Spoke. + /// + /// Request parameters: + /// + /// [name] - Required. The name of Spoke resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Spoke]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Spoke> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Spoke.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists Spokes in a given project and location. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent's resource name. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - A filter expression that filters the results listed in the + /// response. + /// + /// [orderBy] - Sort the results by a certain order. + /// + /// [pageSize] - The maximum number of results per page that should be + /// returned. + /// + /// [pageToken] - The page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListSpokesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListSpokesResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/spokes'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListSpokesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the parameters of a single Spoke. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Immutable. The name of a Spoke resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [requestId] - Optional. An optional request ID to identify requests. + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// [updateMask] - Optional. Field mask is used to specify the fields to be + /// overwritten in the Spoke resource by the update. The fields specified in + /// the update_mask are relative to the resource, not the full request. A + /// field will be overwritten if it is in the mask. If the user does not + /// provide a mask then all fields will be overwritten. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> patch( + Spoke request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/spokes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// The allowed types for \[VALUE\] in a `[KEY]:[VALUE]` attribute. +class AttributeValue { + /// A Boolean value represented by `true` or `false`. + core.bool boolValue; + + /// A 64-bit signed integer. + core.String intValue; + + /// A string up to 256 bytes long. + TruncatableString stringValue; + + AttributeValue(); + + AttributeValue.fromJson(core.Map _json) { + if (_json.containsKey('boolValue')) { + boolValue = _json['boolValue'] as core.bool; + } + if (_json.containsKey('intValue')) { + intValue = _json['intValue'] as core.String; + } + if (_json.containsKey('stringValue')) { + stringValue = TruncatableString.fromJson( + _json['stringValue'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boolValue != null) { + _json['boolValue'] = boolValue; + } + if (intValue != null) { + _json['intValue'] = intValue; + } + if (stringValue != null) { + _json['stringValue'] = stringValue.toJson(); + } + return _json; + } +} + +/// A set of attributes, each in the format `[KEY]:[VALUE]`. +class Attributes { + /// The set of attributes. + /// + /// Each attribute's key can be up to 128 bytes long. The value can be a + /// string up to 256 bytes, a signed 64-bit integer, or the Boolean values + /// `true` and `false`. For example: "/instance_id": "my-instance" + /// "/http/user_agent": "" "/http/request_bytes": 300 "abc.com/myattribute": + /// true + core.Map<core.String, AttributeValue> attributeMap; + + /// The number of attributes that were discarded. + /// + /// Attributes can be discarded because their keys are too long or because + /// there are too many attributes. If this value is 0 then all attributes are + /// valid. + core.int droppedAttributesCount; + + Attributes(); + + Attributes.fromJson(core.Map _json) { + if (_json.containsKey('attributeMap')) { + attributeMap = + (_json['attributeMap'] as core.Map).cast<core.String, core.Map>().map( + (key, item) => core.MapEntry( + key, + AttributeValue.fromJson( + item as core.Map<core.String, core.dynamic>), + ), + ); + } + if (_json.containsKey('droppedAttributesCount')) { + droppedAttributesCount = _json['droppedAttributesCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attributeMap != null) { + _json['attributeMap'] = + attributeMap.map((key, item) => core.MapEntry(key, item.toJson())); + } + if (droppedAttributesCount != null) { + _json['droppedAttributesCount'] = droppedAttributesCount; + } + return _json; + } +} + +/// Specifies the audit configuration for a service. +/// +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. An AuditConfig must have one +/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` +/// and a specific service, the union of the two AuditConfigs is used for that +/// service: the log_types specified in each AuditConfig are enabled, and the +/// exempted_members in each AuditLogConfig are exempted. Example Policy with +/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", +/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ +/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": +/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", +/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": +/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +class AuditConfig { + /// The configuration for logging of each type of permission. + core.List<AuditLogConfig> auditLogConfigs; + + /// Specifies a service that will be enabled for audit logging. + /// + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + core.String service; + + AuditConfig(); + + AuditConfig.fromJson(core.Map _json) { + if (_json.containsKey('auditLogConfigs')) { + auditLogConfigs = (_json['auditLogConfigs'] as core.List) + .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('service')) { + service = _json['service'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditLogConfigs != null) { + _json['auditLogConfigs'] = + auditLogConfigs.map((value) => value.toJson()).toList(); + } + if (service != null) { + _json['service'] = service; + } + return _json; + } +} + +/// Provides the configuration for logging a type of permissions. +/// +/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", +/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": +/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while +/// exempting jose@example.com from DATA_READ logging. +class AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// + /// Follows the same format of Binding.members. + core.List<core.String> exemptedMembers; + + /// The log type that this config enables. + /// Possible string values are: + /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. + /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy + /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create + /// - "DATA_READ" : Data reads. Example: CloudSQL Users list + core.String logType; + + AuditLogConfig(); + + AuditLogConfig.fromJson(core.Map _json) { + if (_json.containsKey('exemptedMembers')) { + exemptedMembers = (_json['exemptedMembers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('logType')) { + logType = _json['logType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exemptedMembers != null) { + _json['exemptedMembers'] = exemptedMembers; + } + if (logType != null) { + _json['logType'] = logType; + } + return _json; + } +} + +/// Message for reporting billing requests through Eventstream. +class BillingView { + /// Billing requests to be reported for cloud.eventstream.v2.ResourceEvent + /// Each request contains billing operations to be reported under a service + /// name. + /// + /// See go/billing-view-construction for documentation on constructing billing + /// view report requests. + core.List<ReportRequest> reportRequests; + + BillingView(); + + BillingView.fromJson(core.Map _json) { + if (_json.containsKey('reportRequests')) { + reportRequests = (_json['reportRequests'] as core.List) + .map<ReportRequest>((value) => ReportRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (reportRequests != null) { + _json['reportRequests'] = + reportRequests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Associates `members` with a `role`. +class Binding { + /// The condition that is associated with this binding. + /// + /// If the condition evaluates to `true`, then this binding applies to the + /// current request. If the condition evaluates to `false`, then this binding + /// does not apply to the current request. However, a different role binding + /// might grant the same role to one or more of the members in this binding. + /// To learn which resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition; + + /// Specifies the identities requesting access for a Cloud Platform resource. + /// + /// `members` can have the following values: * `allUsers`: A special + /// identifier that represents anyone who is on the internet; with or without + /// a Google account. * `allAuthenticatedUsers`: A special identifier that + /// represents anyone who is authenticated with a Google account or a service + /// account. * `user:{emailid}`: An email address that represents a specific + /// Google account. For example, `alice@example.com` . * + /// `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * + /// `group:{emailid}`: An email address that represents a Google group. For + /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a user that has + /// been recently deleted. For example, + /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, + /// this value reverts to `user:{emailid}` and the recovered user retains the + /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a service account + /// that has been recently deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If + /// the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email + /// address (plus unique identifier) representing a Google group that has been + /// recently deleted. For example, + /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, + /// this value reverts to `group:{emailid}` and the recovered group retains + /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) + /// that represents all the users of that domain. For example, `google.com` or + /// `example.com`. + core.List<core.String> members; + + /// Role that is assigned to `members`. + /// + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + core.String role; + + Binding(); + + Binding.fromJson(core.Map _json) { + if (_json.containsKey('condition')) { + condition = Expr.fromJson( + _json['condition'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('members')) { + members = (_json['members'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('role')) { + role = _json['role'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (condition != null) { + _json['condition'] = condition.toJson(); + } + if (members != null) { + _json['members'] = members; + } + if (role != null) { + _json['role'] = role; + } + return _json; + } +} + +/// Distribution represents a frequency distribution of double-valued sample +/// points. +/// +/// It contains the size of the population of sample points plus additional +/// optional information: - the arithmetic mean of the samples - the minimum and +/// maximum of the samples - the sum-squared-deviation of the samples, used to +/// compute variance - a histogram of the values of the sample points +class Distribution { + /// The number of samples in each histogram bucket. + /// + /// \`bucket_counts\` are optional. If present, they must sum to the \`count\` + /// value. The buckets are defined below in \`bucket_option\`. There are N + /// buckets. \`bucket_counts\[0\]\` is the number of samples in the underflow + /// bucket. \`bucket_counts\[1\]\` to \`bucket_counts\[N-1\]\` are the numbers + /// of samples in each of the finite buckets. And \`bucket_counts\[N\] is the + /// number of samples in the overflow bucket. See the comments of + /// \`bucket_option\` below for more details. Any suffix of trailing zeros may + /// be omitted. + core.List<core.String> bucketCounts; + + /// The total number of samples in the distribution. + /// + /// Must be >= 0. + core.String count; + + /// Example points. + /// + /// Must be in increasing order of `value` field. + core.List<Exemplar> exemplars; + + /// Buckets with arbitrary user-provided width. + ExplicitBuckets explicitBuckets; + + /// Buckets with exponentially growing width. + ExponentialBuckets exponentialBuckets; + + /// Buckets with constant width. + LinearBuckets linearBuckets; + + /// The maximum of the population of values. + /// + /// Ignored if `count` is zero. + core.double maximum; + + /// The arithmetic mean of the samples in the distribution. + /// + /// If `count` is zero then this field must be zero. + core.double mean; + + /// The minimum of the population of values. + /// + /// Ignored if `count` is zero. + core.double minimum; + + /// The sum of squared deviations from the mean: Sum\[i=1..count\]((x_i - + /// mean)^2) where each x_i is a sample values. + /// + /// If `count` is zero then this field must be zero, otherwise validation of + /// the request fails. + core.double sumOfSquaredDeviation; + + Distribution(); + + Distribution.fromJson(core.Map _json) { + if (_json.containsKey('bucketCounts')) { + bucketCounts = (_json['bucketCounts'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('count')) { + count = _json['count'] as core.String; + } + if (_json.containsKey('exemplars')) { + exemplars = (_json['exemplars'] as core.List) + .map<Exemplar>((value) => + Exemplar.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('explicitBuckets')) { + explicitBuckets = ExplicitBuckets.fromJson( + _json['explicitBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('exponentialBuckets')) { + exponentialBuckets = ExponentialBuckets.fromJson( + _json['exponentialBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('linearBuckets')) { + linearBuckets = LinearBuckets.fromJson( + _json['linearBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('maximum')) { + maximum = (_json['maximum'] as core.num).toDouble(); + } + if (_json.containsKey('mean')) { + mean = (_json['mean'] as core.num).toDouble(); + } + if (_json.containsKey('minimum')) { + minimum = (_json['minimum'] as core.num).toDouble(); + } + if (_json.containsKey('sumOfSquaredDeviation')) { + sumOfSquaredDeviation = + (_json['sumOfSquaredDeviation'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bucketCounts != null) { + _json['bucketCounts'] = bucketCounts; + } + if (count != null) { + _json['count'] = count; + } + if (exemplars != null) { + _json['exemplars'] = exemplars.map((value) => value.toJson()).toList(); + } + if (explicitBuckets != null) { + _json['explicitBuckets'] = explicitBuckets.toJson(); + } + if (exponentialBuckets != null) { + _json['exponentialBuckets'] = exponentialBuckets.toJson(); + } + if (linearBuckets != null) { + _json['linearBuckets'] = linearBuckets.toJson(); + } + if (maximum != null) { + _json['maximum'] = maximum; + } + if (mean != null) { + _json['mean'] = mean; + } + if (minimum != null) { + _json['minimum'] = minimum; + } + if (sumOfSquaredDeviation != null) { + _json['sumOfSquaredDeviation'] = sumOfSquaredDeviation; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Exemplars are example points that may be used to annotate aggregated +/// distribution values. +/// +/// They are metadata that gives information about a particular value added to a +/// Distribution bucket, such as a trace ID that was active when a value was +/// added. They may contain further information, such as a example values and +/// timestamps, origin, etc. +class Exemplar { + /// Contextual information about the example value. + /// + /// Examples are: Trace: type.googleapis.com/google.monitoring.v3.SpanContext + /// Literal string: type.googleapis.com/google.protobuf.StringValue Labels + /// dropped during aggregation: + /// type.googleapis.com/google.monitoring.v3.DroppedLabels There may be only a + /// single attachment of any given message type in a single exemplar, and this + /// is enforced by the system. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> attachments; + + /// The observation (sampling) time of the above value. + core.String timestamp; + + /// Value of the exemplar point. + /// + /// This value determines to which bucket the exemplar belongs. + core.double value; + + Exemplar(); + + Exemplar.fromJson(core.Map _json) { + if (_json.containsKey('attachments')) { + attachments = (_json['attachments'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('timestamp')) { + timestamp = _json['timestamp'] as core.String; + } + if (_json.containsKey('value')) { + value = (_json['value'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attachments != null) { + _json['attachments'] = attachments; + } + if (timestamp != null) { + _json['timestamp'] = timestamp; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// Describing buckets with arbitrary user-provided width. +class ExplicitBuckets { + /// 'bound' is a list of strictly increasing boundaries between buckets. + /// + /// Note that a list of length N-1 defines N buckets because of fenceposting. + /// See comments on `bucket_options` for details. The i'th finite bucket + /// covers the interval \[bound\[i-1\], bound\[i\]) where i ranges from 1 to + /// bound_size() - 1. Note that there are no finite buckets at all if 'bound' + /// only contains a single element; in that special case the single bound + /// defines the boundary between the underflow and overflow buckets. bucket + /// number lower bound upper bound i == 0 (underflow) -inf bound\[i\] 0 < i < + /// bound_size() bound\[i-1\] bound\[i\] i == bound_size() (overflow) + /// bound\[i-1\] +inf + core.List<core.double> bounds; + + ExplicitBuckets(); + + ExplicitBuckets.fromJson(core.Map _json) { + if (_json.containsKey('bounds')) { + bounds = (_json['bounds'] as core.List) + .map<core.double>((value) => (value as core.num).toDouble()) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bounds != null) { + _json['bounds'] = bounds; + } + return _json; + } +} + +/// Describing buckets with exponentially growing width. +class ExponentialBuckets { + /// The i'th exponential bucket covers the interval \[scale * + /// growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + /// num_finite_buckets inclusive. + /// + /// Must be larger than 1.0. + core.double growthFactor; + + /// The number of finite buckets. + /// + /// With the underflow and overflow buckets, the total number of buckets is + /// `num_finite_buckets` + 2. See comments on `bucket_options` for details. + core.int numFiniteBuckets; + + /// The i'th exponential bucket covers the interval \[scale * + /// growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + /// num_finite_buckets inclusive. + /// + /// Must be > 0. + core.double scale; + + ExponentialBuckets(); + + ExponentialBuckets.fromJson(core.Map _json) { + if (_json.containsKey('growthFactor')) { + growthFactor = (_json['growthFactor'] as core.num).toDouble(); + } + if (_json.containsKey('numFiniteBuckets')) { + numFiniteBuckets = _json['numFiniteBuckets'] as core.int; + } + if (_json.containsKey('scale')) { + scale = (_json['scale'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (growthFactor != null) { + _json['growthFactor'] = growthFactor; + } + if (numFiniteBuckets != null) { + _json['numFiniteBuckets'] = numFiniteBuckets; + } + if (scale != null) { + _json['scale'] = scale; + } + return _json; + } +} + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. +/// +/// CEL is a C-like expression language. The syntax and semantics of CEL are +/// documented at https://github.com/google/cel-spec. Example (Comparison): +/// title: "Summary size limit" description: "Determines if a summary is less +/// than 100 chars" expression: "document.summary.size() < 100" Example +/// (Equality): title: "Requestor is owner" description: "Determines if +/// requestor is the document owner" expression: "document.owner == +/// request.auth.claims.email" Example (Logic): title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): title: "Notification string" description: +/// "Create a notification string with a timestamp." expression: "'New message +/// received at ' + string(document.create_time)" The exact variables and +/// functions that may be referenced within an expression are determined by the +/// service that evaluates it. See the service documentation for additional +/// information. +class Expr { + /// Description of the expression. + /// + /// This is a longer text which describes the expression, e.g. when hovered + /// over it in a UI. + /// + /// Optional. + core.String description; + + /// Textual representation of an expression in Common Expression Language + /// syntax. + core.String expression; + + /// String indicating the location of the expression for error reporting, e.g. + /// a file name and a position in the file. + /// + /// Optional. + core.String location; + + /// Title for the expression, i.e. a short string describing its purpose. + /// + /// This can be used e.g. in UIs which allow to enter the expression. + /// + /// Optional. + core.String title; + + Expr(); + + Expr.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('location')) { + location = _json['location'] as core.String; + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (location != null) { + _json['location'] = location; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// The request message for Operations.CancelOperation. +class GoogleLongrunningCancelOperationRequest { + GoogleLongrunningCancelOperationRequest(); + + GoogleLongrunningCancelOperationRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The response message for Operations.ListOperations. +class GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<GoogleLongrunningOperation> operations; + + GoogleLongrunningListOperationsResponse(); + + GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<GoogleLongrunningOperation>((value) => + GoogleLongrunningOperation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class GoogleLongrunningOperation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + GoogleRpcStatus error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + GoogleLongrunningOperation(); + + GoogleLongrunningOperation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = GoogleRpcStatus.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class GoogleRpcStatus { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + GoogleRpcStatus(); + + GoogleRpcStatus.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// A common proto for logging HTTP requests. +/// +/// Only contains semantics defined by the HTTP specification. Product-specific +/// logging information MUST be defined in a separate message. +class HttpRequest { + /// The number of HTTP response bytes inserted into cache. + /// + /// Set only when a cache fill was attempted. + core.String cacheFillBytes; + + /// Whether or not an entity was served from cache (with or without + /// validation). + core.bool cacheHit; + + /// Whether or not a cache lookup was attempted. + core.bool cacheLookup; + + /// Whether or not the response was validated with the origin server before + /// being served from cache. + /// + /// This field is only meaningful if `cache_hit` is True. + core.bool cacheValidatedWithOriginServer; + + /// The request processing latency on the server, from the time the request + /// was received until the response was sent. + core.String latency; + + /// Protocol used for the request. + /// + /// Examples: "HTTP/1.1", "HTTP/2", "websocket" + core.String protocol; + + /// The referer URL of the request, as defined in + /// [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + core.String referer; + + /// The IP address (IPv4 or IPv6) of the client that issued the HTTP request. + /// + /// Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + core.String remoteIp; + + /// The request method. + /// + /// Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + core.String requestMethod; + + /// The size of the HTTP request message in bytes, including the request + /// headers and the request body. + core.String requestSize; + + /// The scheme (http, https), the host name, the path, and the query portion + /// of the URL that was requested. + /// + /// Example: `"http://example.com/some/info?color=red"`. + core.String requestUrl; + + /// The size of the HTTP response message sent back to the client, in bytes, + /// including the response headers and the response body. + core.String responseSize; + + /// The IP address (IPv4 or IPv6) of the origin server that the request was + /// sent to. + core.String serverIp; + + /// The response code indicating the status of the response. + /// + /// Examples: 200, 404. + core.int status; + + /// The user agent sent by the client. + /// + /// Example: `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + /// CLR 1.0.3705)"`. + core.String userAgent; + + HttpRequest(); + + HttpRequest.fromJson(core.Map _json) { + if (_json.containsKey('cacheFillBytes')) { + cacheFillBytes = _json['cacheFillBytes'] as core.String; + } + if (_json.containsKey('cacheHit')) { + cacheHit = _json['cacheHit'] as core.bool; + } + if (_json.containsKey('cacheLookup')) { + cacheLookup = _json['cacheLookup'] as core.bool; + } + if (_json.containsKey('cacheValidatedWithOriginServer')) { + cacheValidatedWithOriginServer = + _json['cacheValidatedWithOriginServer'] as core.bool; + } + if (_json.containsKey('latency')) { + latency = _json['latency'] as core.String; + } + if (_json.containsKey('protocol')) { + protocol = _json['protocol'] as core.String; + } + if (_json.containsKey('referer')) { + referer = _json['referer'] as core.String; + } + if (_json.containsKey('remoteIp')) { + remoteIp = _json['remoteIp'] as core.String; + } + if (_json.containsKey('requestMethod')) { + requestMethod = _json['requestMethod'] as core.String; + } + if (_json.containsKey('requestSize')) { + requestSize = _json['requestSize'] as core.String; + } + if (_json.containsKey('requestUrl')) { + requestUrl = _json['requestUrl'] as core.String; + } + if (_json.containsKey('responseSize')) { + responseSize = _json['responseSize'] as core.String; + } + if (_json.containsKey('serverIp')) { + serverIp = _json['serverIp'] as core.String; + } + if (_json.containsKey('status')) { + status = _json['status'] as core.int; + } + if (_json.containsKey('userAgent')) { + userAgent = _json['userAgent'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cacheFillBytes != null) { + _json['cacheFillBytes'] = cacheFillBytes; + } + if (cacheHit != null) { + _json['cacheHit'] = cacheHit; + } + if (cacheLookup != null) { + _json['cacheLookup'] = cacheLookup; + } + if (cacheValidatedWithOriginServer != null) { + _json['cacheValidatedWithOriginServer'] = cacheValidatedWithOriginServer; + } + if (latency != null) { + _json['latency'] = latency; + } + if (protocol != null) { + _json['protocol'] = protocol; + } + if (referer != null) { + _json['referer'] = referer; + } + if (remoteIp != null) { + _json['remoteIp'] = remoteIp; + } + if (requestMethod != null) { + _json['requestMethod'] = requestMethod; + } + if (requestSize != null) { + _json['requestSize'] = requestSize; + } + if (requestUrl != null) { + _json['requestUrl'] = requestUrl; + } + if (responseSize != null) { + _json['responseSize'] = responseSize; + } + if (serverIp != null) { + _json['serverIp'] = serverIp; + } + if (status != null) { + _json['status'] = status; + } + if (userAgent != null) { + _json['userAgent'] = userAgent; + } + return _json; + } +} + +/// Network Connectivity Center is a hub-and-spoke abstraction for network +/// connectivity management in Google Cloud. +/// +/// It reduces operational complexity through a simple, centralized connectivity +/// management model. Following is the resource message of a hub. +class Hub { + /// Time when the Hub was created. + core.String createTime; + + /// Short description of the hub resource. + core.String description; + + /// User-defined labels. + core.Map<core.String, core.String> labels; + + /// The name of a Hub resource. + /// + /// Immutable. + core.String name; + + /// A list of the URIs of all attached spokes + /// + /// Output only. + core.List<core.String> spokes; + + /// The current lifecycle state of this Hub. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : No state information available + /// - "CREATING" : The resource's create operation is in progress + /// - "ACTIVE" : The resource is active + /// - "DELETING" : The resource's Delete operation is in progress + core.String state; + + /// Google-generated UUID for this resource. + /// + /// This is unique across all Hub resources. If a Hub resource is deleted and + /// another with the same name is created, it gets a different unique_id. + /// + /// Output only. + core.String uniqueId; + + /// Time when the Hub was updated. + core.String updateTime; + + Hub(); + + Hub.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('spokes')) { + spokes = (_json['spokes'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('uniqueId')) { + uniqueId = _json['uniqueId'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (spokes != null) { + _json['spokes'] = spokes; + } + if (state != null) { + _json['state'] = state; + } + if (uniqueId != null) { + _json['uniqueId'] = uniqueId; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Describing buckets with constant width. +class LinearBuckets { + /// The number of finite buckets. + /// + /// With the underflow and overflow buckets, the total number of buckets is + /// `num_finite_buckets` + 2. See comments on `bucket_options` for details. + core.int numFiniteBuckets; + + /// The i'th linear bucket covers the interval \[offset + (i-1) * width, + /// offset + i * width) where i ranges from 1 to num_finite_buckets, + /// inclusive. + core.double offset; + + /// The i'th linear bucket covers the interval \[offset + (i-1) * width, + /// offset + i * width) where i ranges from 1 to num_finite_buckets, + /// inclusive. + /// + /// Must be strictly positive. + core.double width; + + LinearBuckets(); + + LinearBuckets.fromJson(core.Map _json) { + if (_json.containsKey('numFiniteBuckets')) { + numFiniteBuckets = _json['numFiniteBuckets'] as core.int; + } + if (_json.containsKey('offset')) { + offset = (_json['offset'] as core.num).toDouble(); + } + if (_json.containsKey('width')) { + width = (_json['width'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (numFiniteBuckets != null) { + _json['numFiniteBuckets'] = numFiniteBuckets; + } + if (offset != null) { + _json['offset'] = offset; + } + if (width != null) { + _json['width'] = width; + } + return _json; + } +} + +/// Response for HubService.ListHubs method. +class ListHubsResponse { + /// Hubs to be returned. + core.List<Hub> hubs; + + /// The next pagination token in the List response. + /// + /// It should be used as page_token for the following request. An empty value + /// means no more result. + core.String nextPageToken; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListHubsResponse(); + + ListHubsResponse.fromJson(core.Map _json) { + if (_json.containsKey('hubs')) { + hubs = (_json['hubs'] as core.List) + .map<Hub>((value) => + Hub.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (hubs != null) { + _json['hubs'] = hubs.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// The response for HubService.ListSpokes. +class ListSpokesResponse { + /// The next pagination token in the List response. + /// + /// It should be used as page_token for the following request. An empty value + /// means no more result. + core.String nextPageToken; + + /// Spokes to be returned. + core.List<Spoke> spokes; + + /// Locations that could not be reached. + core.List<core.String> unreachable; + + ListSpokesResponse(); + + ListSpokesResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('spokes')) { + spokes = (_json['spokes'] as core.List) + .map<Spoke>((value) => + Spoke.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (spokes != null) { + _json['spokes'] = spokes.map((value) => value.toJson()).toList(); + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// An individual log entry. +class LogEntry { + /// Information about the HTTP request associated with this log entry, if + /// applicable. + /// + /// Optional. + HttpRequest httpRequest; + + /// A unique ID for the log entry used for deduplication. + /// + /// If omitted, the implementation will generate one based on operation_id. + core.String insertId; + + /// A set of user-defined (key, value) data that provides additional + /// information about the log entry. + core.Map<core.String, core.String> labels; + + /// The log to which this log entry belongs. + /// + /// Examples: `"syslog"`, `"book_log"`. + /// + /// Required. + core.String name; + + /// Information about an operation associated with the log entry, if + /// applicable. + /// + /// Optional. + LogEntryOperation operation; + + /// The log entry payload, represented as a protocol buffer that is expressed + /// as a JSON object. + /// + /// The only accepted type currently is AuditLog. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> protoPayload; + + /// The severity of the log entry. + /// + /// The default value is `LogSeverity.DEFAULT`. + /// Possible string values are: + /// - "DEFAULT" : (0) The log entry has no assigned severity level. + /// - "DEBUG" : (100) Debug or trace information. + /// - "INFO" : (200) Routine information, such as ongoing status or + /// performance. + /// - "NOTICE" : (300) Normal but significant events, such as start up, shut + /// down, or a configuration change. + /// - "WARNING" : (400) Warning events might cause problems. + /// - "ERROR" : (500) Error events are likely to cause problems. + /// - "CRITICAL" : (600) Critical events cause more severe problems or + /// outages. + /// - "ALERT" : (700) A person must take an action immediately. + /// - "EMERGENCY" : (800) One or more systems are unusable. + core.String severity; + + /// Source code location information associated with the log entry, if any. + /// + /// Optional. + LogEntrySourceLocation sourceLocation; + + /// The log entry payload, represented as a structure that is expressed as a + /// JSON object. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> structPayload; + + /// The log entry payload, represented as a Unicode string (UTF-8). + core.String textPayload; + + /// The time the event described by the log entry occurred. + /// + /// If omitted, defaults to operation start time. + core.String timestamp; + + /// Resource name of the trace associated with the log entry, if any. + /// + /// If this field contains a relative resource name, you can assume the name + /// is relative to `//tracing.googleapis.com`. Example: + /// `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + /// + /// Optional. + core.String trace; + + LogEntry(); + + LogEntry.fromJson(core.Map _json) { + if (_json.containsKey('httpRequest')) { + httpRequest = HttpRequest.fromJson( + _json['httpRequest'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('insertId')) { + insertId = _json['insertId'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('operation')) { + operation = LogEntryOperation.fromJson( + _json['operation'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('protoPayload')) { + protoPayload = (_json['protoPayload'] as core.Map) + .cast<core.String, core.Object>() + .map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('severity')) { + severity = _json['severity'] as core.String; + } + if (_json.containsKey('sourceLocation')) { + sourceLocation = LogEntrySourceLocation.fromJson( + _json['sourceLocation'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('structPayload')) { + structPayload = (_json['structPayload'] as core.Map) + .cast<core.String, core.Object>() + .map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('textPayload')) { + textPayload = _json['textPayload'] as core.String; + } + if (_json.containsKey('timestamp')) { + timestamp = _json['timestamp'] as core.String; + } + if (_json.containsKey('trace')) { + trace = _json['trace'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (httpRequest != null) { + _json['httpRequest'] = httpRequest.toJson(); + } + if (insertId != null) { + _json['insertId'] = insertId; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (operation != null) { + _json['operation'] = operation.toJson(); + } + if (protoPayload != null) { + _json['protoPayload'] = protoPayload; + } + if (severity != null) { + _json['severity'] = severity; + } + if (sourceLocation != null) { + _json['sourceLocation'] = sourceLocation.toJson(); + } + if (structPayload != null) { + _json['structPayload'] = structPayload; + } + if (textPayload != null) { + _json['textPayload'] = textPayload; + } + if (timestamp != null) { + _json['timestamp'] = timestamp; + } + if (trace != null) { + _json['trace'] = trace; + } + return _json; + } +} + +/// Additional information about a potentially long-running operation with which +/// a log entry is associated. +class LogEntryOperation { + /// Set this to True if this is the first log entry in the operation. + /// + /// Optional. + core.bool first; + + /// An arbitrary operation identifier. + /// + /// Log entries with the same identifier are assumed to be part of the same + /// operation. + /// + /// Optional. + core.String id; + + /// Set this to True if this is the last log entry in the operation. + /// + /// Optional. + core.bool last; + + /// An arbitrary producer identifier. + /// + /// The combination of `id` and `producer` must be globally unique. Examples + /// for `producer`: `"MyDivision.MyBigCompany.com"`, + /// `"github.com/MyProject/MyApplication"`. + /// + /// Optional. + core.String producer; + + LogEntryOperation(); + + LogEntryOperation.fromJson(core.Map _json) { + if (_json.containsKey('first')) { + first = _json['first'] as core.bool; + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('last')) { + last = _json['last'] as core.bool; + } + if (_json.containsKey('producer')) { + producer = _json['producer'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (first != null) { + _json['first'] = first; + } + if (id != null) { + _json['id'] = id; + } + if (last != null) { + _json['last'] = last; + } + if (producer != null) { + _json['producer'] = producer; + } + return _json; + } +} + +/// Additional information about the source code location that produced the log +/// entry. +class LogEntrySourceLocation { + /// Source file name. + /// + /// Depending on the runtime environment, this might be a simple name or a + /// fully-qualified name. + /// + /// Optional. + core.String file; + + /// Human-readable name of the function or method being invoked, with optional + /// context such as the class or package name. + /// + /// This information may be used in contexts such as the logs viewer, where a + /// file and line number are less meaningful. The format can vary by language. + /// For example: `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), + /// `function` (Python). + /// + /// Optional. + core.String function; + + /// Line within the source file. + /// + /// 1-based; 0 indicates no line number available. + /// + /// Optional. + core.String line; + + LogEntrySourceLocation(); + + LogEntrySourceLocation.fromJson(core.Map _json) { + if (_json.containsKey('file')) { + file = _json['file'] as core.String; + } + if (_json.containsKey('function')) { + function = _json['function'] as core.String; + } + if (_json.containsKey('line')) { + line = _json['line'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (file != null) { + _json['file'] = file; + } + if (function != null) { + _json['function'] = function; + } + if (line != null) { + _json['line'] = line; + } + return _json; + } +} + +/// Represents a single metric value. +class MetricValue { + /// A boolean value. + core.bool boolValue; + + /// A distribution value. + Distribution distributionValue; + + /// A double precision floating point value. + core.double doubleValue; + + /// The end of the time period over which this metric value's measurement + /// applies. + /// + /// If not specified, google.api.servicecontrol.v1.Operation.end_time will be + /// used. + core.String endTime; + + /// A signed 64-bit integer value. + core.String int64Value; + + /// The labels describing the metric value. + /// + /// See comments on google.api.servicecontrol.v1.Operation.labels for the + /// overriding relationship. Note that this map must not contain monitored + /// resource labels. + core.Map<core.String, core.String> labels; + + /// A money value. + Money moneyValue; + + /// The start of the time period over which this metric value's measurement + /// applies. + /// + /// The time period has different semantics for different metric types + /// (cumulative, delta, and gauge). See the metric definition documentation in + /// the service configuration for details. If not specified, + /// google.api.servicecontrol.v1.Operation.start_time will be used. + core.String startTime; + + /// A text string value. + core.String stringValue; + + MetricValue(); + + MetricValue.fromJson(core.Map _json) { + if (_json.containsKey('boolValue')) { + boolValue = _json['boolValue'] as core.bool; + } + if (_json.containsKey('distributionValue')) { + distributionValue = Distribution.fromJson( + _json['distributionValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('doubleValue')) { + doubleValue = (_json['doubleValue'] as core.num).toDouble(); + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('int64Value')) { + int64Value = _json['int64Value'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('moneyValue')) { + moneyValue = Money.fromJson( + _json['moneyValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('stringValue')) { + stringValue = _json['stringValue'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boolValue != null) { + _json['boolValue'] = boolValue; + } + if (distributionValue != null) { + _json['distributionValue'] = distributionValue.toJson(); + } + if (doubleValue != null) { + _json['doubleValue'] = doubleValue; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (int64Value != null) { + _json['int64Value'] = int64Value; + } + if (labels != null) { + _json['labels'] = labels; + } + if (moneyValue != null) { + _json['moneyValue'] = moneyValue.toJson(); + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (stringValue != null) { + _json['stringValue'] = stringValue; + } + return _json; + } +} + +/// Represents a set of metric values in the same metric. +/// +/// Each metric value in the set should have a unique combination of start time, +/// end time, and label values. +class MetricValueSet { + /// The metric name defined in the service configuration. + core.String metricName; + + /// The values in this metric. + core.List<MetricValue> metricValues; + + MetricValueSet(); + + MetricValueSet.fromJson(core.Map _json) { + if (_json.containsKey('metricName')) { + metricName = _json['metricName'] as core.String; + } + if (_json.containsKey('metricValues')) { + metricValues = (_json['metricValues'] as core.List) + .map<MetricValue>((value) => MetricValue.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metricName != null) { + _json['metricName'] = metricName; + } + if (metricValues != null) { + _json['metricValues'] = + metricValues.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Represents an amount of money with its currency type. +class Money { + /// The three-letter currency code defined in ISO 4217. + core.String currencyCode; + + /// Number of nano (10^-9) units of the amount. + /// + /// The value must be between -999,999,999 and +999,999,999 inclusive. If + /// `units` is positive, `nanos` must be positive or zero. If `units` is zero, + /// `nanos` can be positive, zero, or negative. If `units` is negative, + /// `nanos` must be negative or zero. For example $-1.75 is represented as + /// `units`=-1 and `nanos`=-750,000,000. + core.int nanos; + + /// The whole units of the amount. + /// + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + core.String units; + + Money(); + + Money.fromJson(core.Map _json) { + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('nanos')) { + nanos = _json['nanos'] as core.int; + } + if (_json.containsKey('units')) { + units = _json['units'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (nanos != null) { + _json['nanos'] = nanos; + } + if (units != null) { + _json['units'] = units; + } + return _json; + } +} + +/// Represents information regarding an operation. +class Operation { + /// Identity of the consumer who is using the service. + /// + /// This field should be filled in for the operations initiated by a consumer, + /// but not for service-initiated operations that are not related to a + /// specific consumer. - This can be in one of the following formats: - + /// project:PROJECT_ID, - project`_`number:PROJECT_NUMBER, - + /// projects/PROJECT_ID or PROJECT_NUMBER, - folders/FOLDER_NUMBER, - + /// organizations/ORGANIZATION_NUMBER, - api`_`key:API_KEY. + core.String consumerId; + + /// End time of the operation. + /// + /// Required when the operation is used in ServiceController.Report, but + /// optional when the operation is used in ServiceController.Check. + core.String endTime; + + /// Unimplemented. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> extensions; + + /// DO NOT USE. + /// + /// This is an experimental field. + /// Possible string values are: + /// - "LOW" : Allows data caching, batching, and aggregation. It provides + /// higher performance with higher data loss risk. + /// - "HIGH" : Disables data aggregation to minimize data loss. It is for + /// operations that contains significant monetary value or audit trail. This + /// feature only applies to the client libraries. + /// - "DEBUG" : Deprecated. Do not use. Disables data aggregation and enables + /// additional validation logic. It should only be used during the onboarding + /// process. It is only available to Google internal services, and the service + /// must be approved by chemist-dev@google.com in order to use this level. + core.String importance; + + /// Labels describing the operation. + /// + /// Only the following labels are allowed: - Labels describing monitored + /// resources as defined in the service configuration. - Default labels of + /// metric values. When specified, labels defined in the metric value override + /// these default. - The following labels defined by Google Cloud Platform: - + /// `cloud.googleapis.com/location` describing the location where the + /// operation happened, - `servicecontrol.googleapis.com/user_agent` + /// describing the user agent of the API request, - + /// `servicecontrol.googleapis.com/service_agent` describing the service used + /// to handle the API request (e.g. ESP), - + /// `servicecontrol.googleapis.com/platform` describing the platform where the + /// API is served, such as App Engine, Compute Engine, or Kubernetes Engine. + core.Map<core.String, core.String> labels; + + /// Represents information to be logged. + core.List<LogEntry> logEntries; + + /// Represents information about this operation. + /// + /// Each MetricValueSet corresponds to a metric defined in the service + /// configuration. The data type used in the MetricValueSet must agree with + /// the data type specified in the metric definition. Within a single + /// operation, it is not allowed to have more than one MetricValue instances + /// that have the same metric names and identical label value combinations. If + /// a request has such duplicated MetricValue instances, the entire request is + /// rejected with an invalid argument error. + core.List<MetricValueSet> metricValueSets; + + /// Identity of the operation. + /// + /// This must be unique within the scope of the service that generated the + /// operation. If the service calls Check() and Report() on the same + /// operation, the two calls should carry the same id. UUID version 4 is + /// recommended, though not required. In scenarios where an operation is + /// computed from existing information and an idempotent id is desirable for + /// deduplication purpose, UUID version 5 is recommended. See RFC 4122 for + /// details. + core.String operationId; + + /// Fully qualified name of the operation. + /// + /// Reserved for future use. + core.String operationName; + + /// Represents the properties needed for quota check. + /// + /// Applicable only if this operation is for a quota check request. If this is + /// not specified, no quota check will be performed. + QuotaProperties quotaProperties; + + /// The resources that are involved in the operation. + /// + /// The maximum supported number of entries in this field is 100. + core.List<ResourceInfo> resources; + + /// Start time of the operation. + /// + /// Required. + core.String startTime; + + /// A list of Cloud Trace spans. + /// + /// The span names shall contain the id of the destination project which can + /// be either the produce or the consumer project. + /// + /// Unimplemented. + core.List<TraceSpan> traceSpans; + + /// Private Preview. + /// + /// This feature is only available for approved services. User defined labels + /// for the resource that this operation is associated with. Only a + /// combination of 1000 user labels per consumer project are allowed. + core.Map<core.String, core.String> userLabels; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('consumerId')) { + consumerId = _json['consumerId'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('extensions')) { + extensions = (_json['extensions'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('importance')) { + importance = _json['importance'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('logEntries')) { + logEntries = (_json['logEntries'] as core.List) + .map<LogEntry>((value) => + LogEntry.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metricValueSets')) { + metricValueSets = (_json['metricValueSets'] as core.List) + .map<MetricValueSet>((value) => MetricValueSet.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('operationId')) { + operationId = _json['operationId'] as core.String; + } + if (_json.containsKey('operationName')) { + operationName = _json['operationName'] as core.String; + } + if (_json.containsKey('quotaProperties')) { + quotaProperties = QuotaProperties.fromJson( + _json['quotaProperties'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('resources')) { + resources = (_json['resources'] as core.List) + .map<ResourceInfo>((value) => ResourceInfo.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('traceSpans')) { + traceSpans = (_json['traceSpans'] as core.List) + .map<TraceSpan>((value) => + TraceSpan.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('userLabels')) { + userLabels = (_json['userLabels'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (consumerId != null) { + _json['consumerId'] = consumerId; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (extensions != null) { + _json['extensions'] = extensions; + } + if (importance != null) { + _json['importance'] = importance; + } + if (labels != null) { + _json['labels'] = labels; + } + if (logEntries != null) { + _json['logEntries'] = logEntries.map((value) => value.toJson()).toList(); + } + if (metricValueSets != null) { + _json['metricValueSets'] = + metricValueSets.map((value) => value.toJson()).toList(); + } + if (operationId != null) { + _json['operationId'] = operationId; + } + if (operationName != null) { + _json['operationName'] = operationName; + } + if (quotaProperties != null) { + _json['quotaProperties'] = quotaProperties.toJson(); + } + if (resources != null) { + _json['resources'] = resources.map((value) => value.toJson()).toList(); + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (traceSpans != null) { + _json['traceSpans'] = traceSpans.map((value) => value.toJson()).toList(); + } + if (userLabels != null) { + _json['userLabels'] = userLabels; + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +class OperationMetadata { + /// API version used to start the operation. + /// + /// Output only. + core.String apiVersion; + + /// The time the operation was created. + /// + /// Output only. + core.String createTime; + + /// The time the operation finished running. + /// + /// Output only. + core.String endTime; + + /// Identifies whether the user has requested cancellation of the operation. + /// + /// Operations that have successfully been cancelled have Operation.error + /// value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// Output only. + core.bool requestedCancellation; + + /// Human-readable status of the operation, if any. + /// + /// Output only. + core.String statusMessage; + + /// Server-defined resource path for the target of the operation. + /// + /// Output only. + core.String target; + + /// Name of the verb executed by the operation. + /// + /// Output only. + core.String verb; + + OperationMetadata(); + + OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('requestedCancellation')) { + requestedCancellation = _json['requestedCancellation'] as core.bool; + } + if (_json.containsKey('statusMessage')) { + statusMessage = _json['statusMessage'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (requestedCancellation != null) { + _json['requestedCancellation'] = requestedCancellation; + } + if (statusMessage != null) { + _json['statusMessage'] = statusMessage; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service +/// accounts, Google groups, and domains (such as G Suite). A `role` is a named +/// list of permissions; each `role` can be an IAM predefined role or a +/// user-created custom role. For some types of Google Cloud resources, a +/// `binding` can also specify a `condition`, which is a logical expression that +/// allows access to a resource only if the expression evaluates to `true`. A +/// condition can add constraints based on attributes of the request, the +/// resource, or both. To learn which resources support conditions in their IAM +/// policies, see the +/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +/// **JSON example:** { "bindings": \[ { "role": +/// "roles/resourcemanager.organizationAdmin", "members": \[ +/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": +/// "roles/resourcemanager.organizationViewer", "members": \[ +/// "user:eve@example.com" \], "condition": { "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", "expression": +/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": +/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - +/// user:mike@example.com - group:admins@example.com - domain:google.com - +/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer condition: title: expirable +/// access description: Does not grant access after Sep 2020 expression: +/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - +/// version: 3 For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +class Policy { + /// Specifies cloud audit logging configuration for this policy. + core.List<AuditConfig> auditConfigs; + + /// Associates a list of `members` to a `role`. + /// + /// Optionally, may specify a `condition` that determines how and when the + /// `bindings` are applied. Each of the `bindings` must contain at least one + /// member. + core.List<Binding> bindings; + + /// `etag` is used for optimistic concurrency control as a way to help prevent + /// simultaneous updates of a policy from overwriting each other. + /// + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the + /// policy. **Important:** If you use IAM Conditions, you must include the + /// `etag` field whenever you call `setIamPolicy`. If you omit this field, + /// then IAM allows you to overwrite a version `3` policy with a version `1` + /// policy, and all of the conditions in the version `3` policy are lost. + core.String etag; + core.List<core.int> get etagAsBytes => convert.base64.decode(etag); + + set etagAsBytes(core.List<core.int> _bytes) { + etag = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. Any operation that affects conditional role bindings must + /// specify version `3`. This requirement applies to the following operations: + /// * Getting a policy that includes a conditional role binding * Adding a + /// conditional role binding to a policy * Changing a conditional role binding + /// in a policy * Removing any role binding, with or without a condition, from + /// a policy that includes conditions **Important:** If you use IAM + /// Conditions, you must include the `etag` field whenever you call + /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a + /// version `3` policy with a version `1` policy, and all of the conditions in + /// the version `3` policy are lost. If a policy does not include any + /// conditions, operations on that policy may specify any valid version or + /// leave the field unset. To learn which resources support conditions in + /// their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + core.int version; + + Policy(); + + Policy.fromJson(core.Map _json) { + if (_json.containsKey('auditConfigs')) { + auditConfigs = (_json['auditConfigs'] as core.List) + .map<AuditConfig>((value) => AuditConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('bindings')) { + bindings = (_json['bindings'] as core.List) + .map<Binding>((value) => + Binding.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('etag')) { + etag = _json['etag'] as core.String; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditConfigs != null) { + _json['auditConfigs'] = + auditConfigs.map((value) => value.toJson()).toList(); + } + if (bindings != null) { + _json['bindings'] = bindings.map((value) => value.toJson()).toList(); + } + if (etag != null) { + _json['etag'] = etag; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// Represents the properties needed for quota operations. +class QuotaProperties { + /// Quota mode for this operation. + /// Possible string values are: + /// - "ACQUIRE" : Decreases available quota by the cost specified for the + /// operation. If cost is higher than available quota, operation fails and + /// returns error. + /// - "ACQUIRE_BEST_EFFORT" : Decreases available quota by the cost specified + /// for the operation. If cost is higher than available quota, operation does + /// not fail and available quota goes down to zero but it returns error. + /// - "CHECK" : Does not change any available quota. Only checks if there is + /// enough quota. No lock is placed on the checked tokens neither. + /// - "RELEASE" : Increases available quota by the operation cost specified + /// for the operation. + core.String quotaMode; + + QuotaProperties(); + + QuotaProperties.fromJson(core.Map _json) { + if (_json.containsKey('quotaMode')) { + quotaMode = _json['quotaMode'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (quotaMode != null) { + _json['quotaMode'] = quotaMode; + } + return _json; + } +} + +/// Request message for the Report method. +class ReportRequest { + /// Operations to be reported. + /// + /// Typically the service should report one operation per request. Putting + /// multiple operations into a single request is allowed, but should be used + /// only when multiple operations are natually available at the time of the + /// report. There is no limit on the number of operations in the same + /// ReportRequest, however the ReportRequest size should be no larger than + /// 1MB. See ReportResponse.report_errors for partial failure behavior. + core.List<Operation> operations; + + /// Specifies which version of service config should be used to process the + /// request. + /// + /// If unspecified or no matching version can be found, the latest one will be + /// used. + core.String serviceConfigId; + + /// The service name as specified in its service configuration. + /// + /// For example, `"pubsub.googleapis.com"`. See + /// [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + /// for the definition of a service name. + core.String serviceName; + + ReportRequest(); + + ReportRequest.fromJson(core.Map _json) { + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('serviceConfigId')) { + serviceConfigId = _json['serviceConfigId'] as core.String; + } + if (_json.containsKey('serviceName')) { + serviceName = _json['serviceName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + if (serviceConfigId != null) { + _json['serviceConfigId'] = serviceConfigId; + } + if (serviceName != null) { + _json['serviceName'] = serviceName; + } + return _json; + } +} + +/// Describes a resource associated with this operation. +class ResourceInfo { + /// The identifier of the parent of this resource instance. + /// + /// Must be in one of the following formats: - `projects/` - `folders/` - + /// `organizations/` + core.String resourceContainer; + + /// The location of the resource. + /// + /// If not empty, the resource will be checked against location policy. The + /// value must be a valid zone, region or multiregion. For example: + /// "europe-west4" or "northamerica-northeast1-a" + core.String resourceLocation; + + /// Name of the resource. + /// + /// This is used for auditing purposes. + core.String resourceName; + + ResourceInfo(); + + ResourceInfo.fromJson(core.Map _json) { + if (_json.containsKey('resourceContainer')) { + resourceContainer = _json['resourceContainer'] as core.String; + } + if (_json.containsKey('resourceLocation')) { + resourceLocation = _json['resourceLocation'] as core.String; + } + if (_json.containsKey('resourceName')) { + resourceName = _json['resourceName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (resourceContainer != null) { + _json['resourceContainer'] = resourceContainer; + } + if (resourceLocation != null) { + _json['resourceLocation'] = resourceLocation; + } + if (resourceName != null) { + _json['resourceName'] = resourceName; + } + return _json; + } +} + +/// RouterAppliance represents a Router appliance which is specified by a VM URI +/// and a NIC address. +class RouterApplianceInstance { + /// The IP address of the network interface to use for peering. + core.String ipAddress; + core.String networkInterface; + + /// The URI of the virtual machine resource + core.String virtualMachine; + + RouterApplianceInstance(); + + RouterApplianceInstance.fromJson(core.Map _json) { + if (_json.containsKey('ipAddress')) { + ipAddress = _json['ipAddress'] as core.String; + } + if (_json.containsKey('networkInterface')) { + networkInterface = _json['networkInterface'] as core.String; + } + if (_json.containsKey('virtualMachine')) { + virtualMachine = _json['virtualMachine'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (ipAddress != null) { + _json['ipAddress'] = ipAddress; + } + if (networkInterface != null) { + _json['networkInterface'] = networkInterface; + } + if (virtualMachine != null) { + _json['virtualMachine'] = virtualMachine; + } + return _json; + } +} + +/// Request message for `SetIamPolicy` method. +class SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. + /// + /// The size of the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) might + /// reject them. + Policy policy; + + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. + /// + /// Only the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: `paths: "bindings, etag"` + core.String updateMask; + + SetIamPolicyRequest(); + + SetIamPolicyRequest.fromJson(core.Map _json) { + if (_json.containsKey('policy')) { + policy = Policy.fromJson( + _json['policy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (policy != null) { + _json['policy'] = policy.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// A Spoke is an abstraction of a network attachment being attached to a Hub. +/// +/// A Spoke can be underlying a VPN tunnel, a VLAN (interconnect) attachment, a +/// Router appliance, etc. +class Spoke { + /// The time when the Spoke was created. + core.String createTime; + + /// Short description of the spoke resource + core.String description; + + /// The resource URL of the hub resource that the spoke is attached to + core.String hub; + + /// User-defined labels. + core.Map<core.String, core.String> labels; + + /// The URIs of linked interconnect attachment resources + core.List<core.String> linkedInterconnectAttachments; + + /// The URIs of linked Router appliance resources + core.List<RouterApplianceInstance> linkedRouterApplianceInstances; + + /// The URIs of linked VPN tunnel resources + core.List<core.String> linkedVpnTunnels; + + /// The name of a Spoke resource. + /// + /// Immutable. + core.String name; + + /// The current lifecycle state of this Hub. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : No state information available + /// - "CREATING" : The resource's create operation is in progress + /// - "ACTIVE" : The resource is active + /// - "DELETING" : The resource's Delete operation is in progress + core.String state; + + /// Google-generated UUID for this resource. + /// + /// This is unique across all Spoke resources. If a Spoke resource is deleted + /// and another with the same name is created, it gets a different unique_id. + /// + /// Output only. + core.String uniqueId; + + /// The time when the Spoke was updated. + core.String updateTime; + + Spoke(); + + Spoke.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('hub')) { + hub = _json['hub'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('linkedInterconnectAttachments')) { + linkedInterconnectAttachments = + (_json['linkedInterconnectAttachments'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('linkedRouterApplianceInstances')) { + linkedRouterApplianceInstances = + (_json['linkedRouterApplianceInstances'] as core.List) + .map<RouterApplianceInstance>((value) => + RouterApplianceInstance.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('linkedVpnTunnels')) { + linkedVpnTunnels = (_json['linkedVpnTunnels'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('uniqueId')) { + uniqueId = _json['uniqueId'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (hub != null) { + _json['hub'] = hub; + } + if (labels != null) { + _json['labels'] = labels; + } + if (linkedInterconnectAttachments != null) { + _json['linkedInterconnectAttachments'] = linkedInterconnectAttachments; + } + if (linkedRouterApplianceInstances != null) { + _json['linkedRouterApplianceInstances'] = linkedRouterApplianceInstances + .map((value) => value.toJson()) + .toList(); + } + if (linkedVpnTunnels != null) { + _json['linkedVpnTunnels'] = linkedVpnTunnels; + } + if (name != null) { + _json['name'] = name; + } + if (state != null) { + _json['state'] = state; + } + if (uniqueId != null) { + _json['uniqueId'] = uniqueId; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Request message for `TestIamPermissions` method. +class TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. + /// + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// For more information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + core.List<core.String> permissions; + + TestIamPermissionsRequest(); + + TestIamPermissionsRequest.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Response message for `TestIamPermissions` method. +class TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + core.List<core.String> permissions; + + TestIamPermissionsResponse(); + + TestIamPermissionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// A span represents a single operation within a trace. +/// +/// Spans can be nested to form a trace tree. Often, a trace contains a root +/// span that describes the end-to-end latency, and one or more subspans for its +/// sub-operations. A trace can also contain multiple root spans, or none at +/// all. Spans do not need to be contiguous—there may be gaps or overlaps +/// between spans in a trace. +class TraceSpan { + /// A set of attributes on the span. + /// + /// You can have up to 32 attributes per span. + Attributes attributes; + + /// An optional number of child spans that were generated while this span was + /// active. + /// + /// If set, allows implementation to detect missing child spans. + core.int childSpanCount; + + /// A description of the span's operation (up to 128 bytes). + /// + /// Stackdriver Trace displays the description in the Google Cloud Platform + /// Console. For example, the display name can be a qualified method name or a + /// file name and a line number where the operation is called. A best practice + /// is to use the same display name within an application and at the same call + /// point. This makes it easier to correlate spans in different traces. + TruncatableString displayName; + + /// The end time of the span. + /// + /// On the client side, this is the time kept by the local machine where the + /// span execution ends. On the server side, this is the time when the server + /// application handler stops running. + core.String endTime; + + /// The resource name of the span in the following format: + /// projects/\[PROJECT_ID\]/traces/\[TRACE_ID\]/spans/SPAN_ID is a unique + /// identifier for a trace within a project; it is a 32-character hexadecimal + /// encoding of a 16-byte array. + /// + /// \[SPAN_ID\] is a unique identifier for a span within a trace; it is a + /// 16-character hexadecimal encoding of an 8-byte array. + core.String name; + + /// The \[SPAN_ID\] of this span's parent span. + /// + /// If this is a root span, then this field must be empty. + core.String parentSpanId; + + /// (Optional) Set this parameter to indicate whether this span is in the same + /// process as its parent. + /// + /// If you do not set this parameter, Stackdriver Trace is unable to take + /// advantage of this helpful information. + core.bool sameProcessAsParentSpan; + + /// The \[SPAN_ID\] portion of the span's resource name. + core.String spanId; + + /// Distinguishes between spans generated in a particular context. + /// + /// For example, two spans with the same name may be distinguished using + /// `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. + /// Possible string values are: + /// - "SPAN_KIND_UNSPECIFIED" : Unspecified. Do NOT use as default. + /// Implementations MAY assume SpanKind.INTERNAL to be default. + /// - "INTERNAL" : Indicates that the span is used internally. Default value. + /// - "SERVER" : Indicates that the span covers server-side handling of an RPC + /// or other remote network request. + /// - "CLIENT" : Indicates that the span covers the client-side wrapper around + /// an RPC or other remote request. + /// - "PRODUCER" : Indicates that the span describes producer sending a + /// message to a broker. Unlike client and server, there is no direct critical + /// path latency relationship between producer and consumer spans (e.g. + /// publishing a message to a pubsub service). + /// - "CONSUMER" : Indicates that the span describes consumer receiving a + /// message from a broker. Unlike client and server, there is no direct + /// critical path latency relationship between producer and consumer spans + /// (e.g. receiving a message from a pubsub service subscription). + core.String spanKind; + + /// The start time of the span. + /// + /// On the client side, this is the time kept by the local machine where the + /// span execution starts. On the server side, this is the time when the + /// server's application handler starts running. + core.String startTime; + + /// An optional final status for this span. + GoogleRpcStatus status; + + TraceSpan(); + + TraceSpan.fromJson(core.Map _json) { + if (_json.containsKey('attributes')) { + attributes = Attributes.fromJson( + _json['attributes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('childSpanCount')) { + childSpanCount = _json['childSpanCount'] as core.int; + } + if (_json.containsKey('displayName')) { + displayName = TruncatableString.fromJson( + _json['displayName'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('parentSpanId')) { + parentSpanId = _json['parentSpanId'] as core.String; + } + if (_json.containsKey('sameProcessAsParentSpan')) { + sameProcessAsParentSpan = _json['sameProcessAsParentSpan'] as core.bool; + } + if (_json.containsKey('spanId')) { + spanId = _json['spanId'] as core.String; + } + if (_json.containsKey('spanKind')) { + spanKind = _json['spanKind'] as core.String; + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('status')) { + status = GoogleRpcStatus.fromJson( + _json['status'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attributes != null) { + _json['attributes'] = attributes.toJson(); + } + if (childSpanCount != null) { + _json['childSpanCount'] = childSpanCount; + } + if (displayName != null) { + _json['displayName'] = displayName.toJson(); + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (name != null) { + _json['name'] = name; + } + if (parentSpanId != null) { + _json['parentSpanId'] = parentSpanId; + } + if (sameProcessAsParentSpan != null) { + _json['sameProcessAsParentSpan'] = sameProcessAsParentSpan; + } + if (spanId != null) { + _json['spanId'] = spanId; + } + if (spanKind != null) { + _json['spanKind'] = spanKind; + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (status != null) { + _json['status'] = status.toJson(); + } + return _json; + } +} + +/// Represents a string that might be shortened to a specified length. +class TruncatableString { + /// The number of bytes removed from the original string. + /// + /// If this value is 0, then the string was not shortened. + core.int truncatedByteCount; + + /// The shortened string. + /// + /// For example, if the original string is 500 bytes long and the limit of the + /// string is 128 bytes, then `value` contains the first 128 bytes of the + /// 500-byte string. Truncation always happens on a UTF8 character boundary. + /// If there are multi-byte characters in the string, then the length of the + /// shortened string might be less than the size limit. + core.String value; + + TruncatableString(); + + TruncatableString.fromJson(core.Map _json) { + if (_json.containsKey('truncatedByteCount')) { + truncatedByteCount = _json['truncatedByteCount'] as core.int; + } + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (truncatedByteCount != null) { + _json['truncatedByteCount'] = truncatedByteCount; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/oslogin/v1alpha.dart b/generated/googleapis_beta/lib/oslogin/v1alpha.dart deleted file mode 100644 index ca26a7b..0000000 --- a/generated/googleapis_beta/lib/oslogin/v1alpha.dart +++ /dev/null
@@ -1,765 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud OS Login API - v1alpha -/// -/// You can use OS Login to manage access to your VM instances using IAM roles. -/// -/// For more information, see <https://cloud.google.com/compute/docs/oslogin/> -/// -/// Create an instance of [CloudOSLoginApi] to access these resources: -/// -/// - [UsersResource] -/// - [UsersProjectsResource] -/// - [UsersSshPublicKeysResource] -library oslogin.v1alpha; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// You can use OS Login to manage access to your VM instances using IAM roles. -class CloudOSLoginApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - /// View and manage your Google Compute Engine resources - static const computeScope = 'https://www.googleapis.com/auth/compute'; - - /// View your Google Compute Engine resources - static const computeReadonlyScope = - 'https://www.googleapis.com/auth/compute.readonly'; - - final commons.ApiRequester _requester; - - UsersResource get users => UsersResource(_requester); - - CloudOSLoginApi(http.Client client, - {core.String rootUrl = 'https://oslogin.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class UsersResource { - final commons.ApiRequester _requester; - - UsersProjectsResource get projects => UsersProjectsResource(_requester); - UsersSshPublicKeysResource get sshPublicKeys => - UsersSshPublicKeysResource(_requester); - - UsersResource(commons.ApiRequester client) : _requester = client; - - /// Retrieves the profile information used for logging in to a virtual machine - /// on Google Compute Engine. - /// - /// Request parameters: - /// - /// [name] - Required. The unique ID for the user in format `users/{user}`. - /// Value must have pattern `^users/\[^/\]+$`. - /// - /// [operatingSystemType] - The type of operating system associated with the - /// account. - /// Possible string values are: - /// - "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : The operating system type - /// associated with the user account information is unspecified. - /// - "LINUX" : Linux user account information. - /// - "WINDOWS" : Windows user account information. - /// - /// [projectId] - The project ID of the Google Cloud Platform project. - /// - /// [systemId] - A system ID for filtering the results of the request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [LoginProfile]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<LoginProfile> getLoginProfile( - core.String name, { - core.String operatingSystemType, - core.String projectId, - core.String systemId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (operatingSystemType != null) { - _queryParams['operatingSystemType'] = [operatingSystemType]; - } - if (projectId != null) { - _queryParams['projectId'] = [projectId]; - } - if (systemId != null) { - _queryParams['systemId'] = [systemId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/loginProfile'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - LoginProfile.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Adds an SSH public key and returns the profile information. - /// - /// Default POSIX account information is set when no username and UID exist as - /// part of the login profile. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The unique ID for the user in format `users/{user}`. - /// Value must have pattern `^users/\[^/\]+$`. - /// - /// [projectId] - The project ID of the Google Cloud Platform project. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ImportSshPublicKeyResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ImportSshPublicKeyResponse> importSshPublicKey( - SshPublicKey request, - core.String parent, { - core.String projectId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (projectId != null) { - _queryParams['projectId'] = [projectId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + - commons.Escaper.ecapeVariableReserved('$parent') + - ':importSshPublicKey'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ImportSshPublicKeyResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class UsersProjectsResource { - final commons.ApiRequester _requester; - - UsersProjectsResource(commons.ApiRequester client) : _requester = client; - - /// Deletes a POSIX account. - /// - /// Request parameters: - /// - /// [name] - Required. A reference to the POSIX account to update. POSIX - /// accounts are identified by the project ID they are associated with. A - /// reference to the POSIX account is in format - /// `users/{user}/projects/{project}`. - /// Value must have pattern `^users/\[^/\]+/projects/\[^/\]+$`. - /// - /// [operatingSystemType] - The type of operating system associated with the - /// account. - /// Possible string values are: - /// - "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : The operating system type - /// associated with the user account information is unspecified. - /// - "LINUX" : Linux user account information. - /// - "WINDOWS" : Windows user account information. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String operatingSystemType, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (operatingSystemType != null) { - _queryParams['operatingSystemType'] = [operatingSystemType]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class UsersSshPublicKeysResource { - final commons.ApiRequester _requester; - - UsersSshPublicKeysResource(commons.ApiRequester client) : _requester = client; - - /// Deletes an SSH public key. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to update. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves an SSH public key. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to retrieve. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SshPublicKey]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SshPublicKey> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SshPublicKey.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates an SSH public key and returns the profile information. - /// - /// This method supports patch semantics. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to update. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [updateMask] - Mask to control which fields get updated. Updates all if - /// not present. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SshPublicKey]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SshPublicKey> patch( - SshPublicKey request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SshPublicKey.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A response message for importing an SSH public key. -class ImportSshPublicKeyResponse { - /// Detailed information about import results. - core.String details; - - /// The login profile information for the user. - LoginProfile loginProfile; - - ImportSshPublicKeyResponse(); - - ImportSshPublicKeyResponse.fromJson(core.Map _json) { - if (_json.containsKey('details')) { - details = _json['details'] as core.String; - } - if (_json.containsKey('loginProfile')) { - loginProfile = LoginProfile.fromJson( - _json['loginProfile'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (details != null) { - _json['details'] = details; - } - if (loginProfile != null) { - _json['loginProfile'] = loginProfile.toJson(); - } - return _json; - } -} - -/// The user profile information used for logging in to a virtual machine on -/// Google Compute Engine. -class LoginProfile { - /// A unique user ID. - /// - /// Required. - core.String name; - - /// The list of POSIX accounts associated with the user. - core.List<PosixAccount> posixAccounts; - - /// A map from SSH public key fingerprint to the associated key object. - core.Map<core.String, SshPublicKey> sshPublicKeys; - - LoginProfile(); - - LoginProfile.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('posixAccounts')) { - posixAccounts = (_json['posixAccounts'] as core.List) - .map<PosixAccount>((value) => PosixAccount.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('sshPublicKeys')) { - sshPublicKeys = (_json['sshPublicKeys'] as core.Map) - .cast<core.String, core.Map>() - .map( - (key, item) => core.MapEntry( - key, - SshPublicKey.fromJson( - item as core.Map<core.String, core.dynamic>), - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (posixAccounts != null) { - _json['posixAccounts'] = - posixAccounts.map((value) => value.toJson()).toList(); - } - if (sshPublicKeys != null) { - _json['sshPublicKeys'] = - sshPublicKeys.map((key, item) => core.MapEntry(key, item.toJson())); - } - return _json; - } -} - -/// The POSIX account information associated with a Google account. -class PosixAccount { - /// A POSIX account identifier. - /// - /// Output only. - core.String accountId; - - /// The GECOS (user information) entry for this account. - core.String gecos; - - /// The default group ID. - core.String gid; - - /// The path to the home directory for this account. - core.String homeDirectory; - - /// The canonical resource name. - /// - /// Output only. - core.String name; - - /// The operating system type where this account applies. - /// Possible string values are: - /// - "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : The operating system type - /// associated with the user account information is unspecified. - /// - "LINUX" : Linux user account information. - /// - "WINDOWS" : Windows user account information. - core.String operatingSystemType; - - /// Only one POSIX account can be marked as primary. - core.bool primary; - - /// The path to the logic shell for this account. - core.String shell; - - /// System identifier for which account the username or uid applies to. - /// - /// By default, the empty value is used. - core.String systemId; - - /// The user ID. - core.String uid; - - /// The username of the POSIX account. - core.String username; - - PosixAccount(); - - PosixAccount.fromJson(core.Map _json) { - if (_json.containsKey('accountId')) { - accountId = _json['accountId'] as core.String; - } - if (_json.containsKey('gecos')) { - gecos = _json['gecos'] as core.String; - } - if (_json.containsKey('gid')) { - gid = _json['gid'] as core.String; - } - if (_json.containsKey('homeDirectory')) { - homeDirectory = _json['homeDirectory'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('operatingSystemType')) { - operatingSystemType = _json['operatingSystemType'] as core.String; - } - if (_json.containsKey('primary')) { - primary = _json['primary'] as core.bool; - } - if (_json.containsKey('shell')) { - shell = _json['shell'] as core.String; - } - if (_json.containsKey('systemId')) { - systemId = _json['systemId'] as core.String; - } - if (_json.containsKey('uid')) { - uid = _json['uid'] as core.String; - } - if (_json.containsKey('username')) { - username = _json['username'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (accountId != null) { - _json['accountId'] = accountId; - } - if (gecos != null) { - _json['gecos'] = gecos; - } - if (gid != null) { - _json['gid'] = gid; - } - if (homeDirectory != null) { - _json['homeDirectory'] = homeDirectory; - } - if (name != null) { - _json['name'] = name; - } - if (operatingSystemType != null) { - _json['operatingSystemType'] = operatingSystemType; - } - if (primary != null) { - _json['primary'] = primary; - } - if (shell != null) { - _json['shell'] = shell; - } - if (systemId != null) { - _json['systemId'] = systemId; - } - if (uid != null) { - _json['uid'] = uid; - } - if (username != null) { - _json['username'] = username; - } - return _json; - } -} - -/// The SSH public key information associated with a Google account. -class SshPublicKey { - /// An expiration time in microseconds since epoch. - core.String expirationTimeUsec; - - /// The SHA-256 fingerprint of the SSH public key. - /// - /// Output only. - core.String fingerprint; - - /// Public key text in SSH format, defined by RFC4253 section 6.6. - core.String key; - - /// The canonical resource name. - /// - /// Output only. - core.String name; - - SshPublicKey(); - - SshPublicKey.fromJson(core.Map _json) { - if (_json.containsKey('expirationTimeUsec')) { - expirationTimeUsec = _json['expirationTimeUsec'] as core.String; - } - if (_json.containsKey('fingerprint')) { - fingerprint = _json['fingerprint'] as core.String; - } - if (_json.containsKey('key')) { - key = _json['key'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (expirationTimeUsec != null) { - _json['expirationTimeUsec'] = expirationTimeUsec; - } - if (fingerprint != null) { - _json['fingerprint'] = fingerprint; - } - if (key != null) { - _json['key'] = key; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/oslogin/v1beta.dart b/generated/googleapis_beta/lib/oslogin/v1beta.dart deleted file mode 100644 index 7a6e046..0000000 --- a/generated/googleapis_beta/lib/oslogin/v1beta.dart +++ /dev/null
@@ -1,741 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud OS Login API - v1beta -/// -/// You can use OS Login to manage access to your VM instances using IAM roles. -/// -/// For more information, see <https://cloud.google.com/compute/docs/oslogin/> -/// -/// Create an instance of [CloudOSLoginApi] to access these resources: -/// -/// - [UsersResource] -/// - [UsersProjectsResource] -/// - [UsersSshPublicKeysResource] -library oslogin.v1beta; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// You can use OS Login to manage access to your VM instances using IAM roles. -class CloudOSLoginApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View your data across Google Cloud Platform services - static const cloudPlatformReadOnlyScope = - 'https://www.googleapis.com/auth/cloud-platform.read-only'; - - /// View and manage your Google Compute Engine resources - static const computeScope = 'https://www.googleapis.com/auth/compute'; - - /// View your Google Compute Engine resources - static const computeReadonlyScope = - 'https://www.googleapis.com/auth/compute.readonly'; - - final commons.ApiRequester _requester; - - UsersResource get users => UsersResource(_requester); - - CloudOSLoginApi(http.Client client, - {core.String rootUrl = 'https://oslogin.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class UsersResource { - final commons.ApiRequester _requester; - - UsersProjectsResource get projects => UsersProjectsResource(_requester); - UsersSshPublicKeysResource get sshPublicKeys => - UsersSshPublicKeysResource(_requester); - - UsersResource(commons.ApiRequester client) : _requester = client; - - /// Retrieves the profile information used for logging in to a virtual machine - /// on Google Compute Engine. - /// - /// Request parameters: - /// - /// [name] - Required. The unique ID for the user in format `users/{user}`. - /// Value must have pattern `^users/\[^/\]+$`. - /// - /// [projectId] - The project ID of the Google Cloud Platform project. - /// - /// [systemId] - A system ID for filtering the results of the request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [LoginProfile]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<LoginProfile> getLoginProfile( - core.String name, { - core.String projectId, - core.String systemId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (projectId != null) { - _queryParams['projectId'] = [projectId]; - } - if (systemId != null) { - _queryParams['systemId'] = [systemId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/loginProfile'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - LoginProfile.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Adds an SSH public key and returns the profile information. - /// - /// Default POSIX account information is set when no username and UID exist as - /// part of the login profile. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The unique ID for the user in format `users/{user}`. - /// Value must have pattern `^users/\[^/\]+$`. - /// - /// [projectId] - The project ID of the Google Cloud Platform project. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ImportSshPublicKeyResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ImportSshPublicKeyResponse> importSshPublicKey( - SshPublicKey request, - core.String parent, { - core.String projectId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (projectId != null) { - _queryParams['projectId'] = [projectId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + - commons.Escaper.ecapeVariableReserved('$parent') + - ':importSshPublicKey'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ImportSshPublicKeyResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class UsersProjectsResource { - final commons.ApiRequester _requester; - - UsersProjectsResource(commons.ApiRequester client) : _requester = client; - - /// Deletes a POSIX account. - /// - /// Request parameters: - /// - /// [name] - Required. A reference to the POSIX account to update. POSIX - /// accounts are identified by the project ID they are associated with. A - /// reference to the POSIX account is in format - /// `users/{user}/projects/{project}`. - /// Value must have pattern `^users/\[^/\]+/projects/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class UsersSshPublicKeysResource { - final commons.ApiRequester _requester; - - UsersSshPublicKeysResource(commons.ApiRequester client) : _requester = client; - - /// Deletes an SSH public key. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to update. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Retrieves an SSH public key. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to retrieve. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SshPublicKey]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SshPublicKey> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SshPublicKey.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates an SSH public key and returns the profile information. - /// - /// This method supports patch semantics. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The fingerprint of the public key to update. Public - /// keys are identified by their SHA-256 fingerprint. The fingerprint of the - /// public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - /// Value must have pattern `^users/\[^/\]+/sshPublicKeys/\[^/\]+$`. - /// - /// [updateMask] - Mask to control which fields get updated. Updates all if - /// not present. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SshPublicKey]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SshPublicKey> patch( - SshPublicKey request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - SshPublicKey.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A response message for importing an SSH public key. -class ImportSshPublicKeyResponse { - /// Detailed information about import results. - core.String details; - - /// The login profile information for the user. - LoginProfile loginProfile; - - ImportSshPublicKeyResponse(); - - ImportSshPublicKeyResponse.fromJson(core.Map _json) { - if (_json.containsKey('details')) { - details = _json['details'] as core.String; - } - if (_json.containsKey('loginProfile')) { - loginProfile = LoginProfile.fromJson( - _json['loginProfile'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (details != null) { - _json['details'] = details; - } - if (loginProfile != null) { - _json['loginProfile'] = loginProfile.toJson(); - } - return _json; - } -} - -/// The user profile information used for logging in to a virtual machine on -/// Google Compute Engine. -class LoginProfile { - /// A unique user ID. - /// - /// Required. - core.String name; - - /// The list of POSIX accounts associated with the user. - core.List<PosixAccount> posixAccounts; - - /// A map from SSH public key fingerprint to the associated key object. - core.Map<core.String, SshPublicKey> sshPublicKeys; - - LoginProfile(); - - LoginProfile.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('posixAccounts')) { - posixAccounts = (_json['posixAccounts'] as core.List) - .map<PosixAccount>((value) => PosixAccount.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('sshPublicKeys')) { - sshPublicKeys = (_json['sshPublicKeys'] as core.Map) - .cast<core.String, core.Map>() - .map( - (key, item) => core.MapEntry( - key, - SshPublicKey.fromJson( - item as core.Map<core.String, core.dynamic>), - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (posixAccounts != null) { - _json['posixAccounts'] = - posixAccounts.map((value) => value.toJson()).toList(); - } - if (sshPublicKeys != null) { - _json['sshPublicKeys'] = - sshPublicKeys.map((key, item) => core.MapEntry(key, item.toJson())); - } - return _json; - } -} - -/// The POSIX account information associated with a Google account. -class PosixAccount { - /// A POSIX account identifier. - /// - /// Output only. - core.String accountId; - - /// The GECOS (user information) entry for this account. - core.String gecos; - - /// The default group ID. - core.String gid; - - /// The path to the home directory for this account. - core.String homeDirectory; - - /// The canonical resource name. - /// - /// Output only. - core.String name; - - /// The operating system type where this account applies. - /// Possible string values are: - /// - "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : The operating system type - /// associated with the user account information is unspecified. - /// - "LINUX" : Linux user account information. - /// - "WINDOWS" : Windows user account information. - core.String operatingSystemType; - - /// Only one POSIX account can be marked as primary. - core.bool primary; - - /// The path to the logic shell for this account. - core.String shell; - - /// System identifier for which account the username or uid applies to. - /// - /// By default, the empty value is used. - core.String systemId; - - /// The user ID. - core.String uid; - - /// The username of the POSIX account. - core.String username; - - PosixAccount(); - - PosixAccount.fromJson(core.Map _json) { - if (_json.containsKey('accountId')) { - accountId = _json['accountId'] as core.String; - } - if (_json.containsKey('gecos')) { - gecos = _json['gecos'] as core.String; - } - if (_json.containsKey('gid')) { - gid = _json['gid'] as core.String; - } - if (_json.containsKey('homeDirectory')) { - homeDirectory = _json['homeDirectory'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('operatingSystemType')) { - operatingSystemType = _json['operatingSystemType'] as core.String; - } - if (_json.containsKey('primary')) { - primary = _json['primary'] as core.bool; - } - if (_json.containsKey('shell')) { - shell = _json['shell'] as core.String; - } - if (_json.containsKey('systemId')) { - systemId = _json['systemId'] as core.String; - } - if (_json.containsKey('uid')) { - uid = _json['uid'] as core.String; - } - if (_json.containsKey('username')) { - username = _json['username'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (accountId != null) { - _json['accountId'] = accountId; - } - if (gecos != null) { - _json['gecos'] = gecos; - } - if (gid != null) { - _json['gid'] = gid; - } - if (homeDirectory != null) { - _json['homeDirectory'] = homeDirectory; - } - if (name != null) { - _json['name'] = name; - } - if (operatingSystemType != null) { - _json['operatingSystemType'] = operatingSystemType; - } - if (primary != null) { - _json['primary'] = primary; - } - if (shell != null) { - _json['shell'] = shell; - } - if (systemId != null) { - _json['systemId'] = systemId; - } - if (uid != null) { - _json['uid'] = uid; - } - if (username != null) { - _json['username'] = username; - } - return _json; - } -} - -/// The SSH public key information associated with a Google account. -class SshPublicKey { - /// An expiration time in microseconds since epoch. - core.String expirationTimeUsec; - - /// The SHA-256 fingerprint of the SSH public key. - /// - /// Output only. - core.String fingerprint; - - /// Public key text in SSH format, defined by RFC4253 section 6.6. - core.String key; - - /// The canonical resource name. - /// - /// Output only. - core.String name; - - SshPublicKey(); - - SshPublicKey.fromJson(core.Map _json) { - if (_json.containsKey('expirationTimeUsec')) { - expirationTimeUsec = _json['expirationTimeUsec'] as core.String; - } - if (_json.containsKey('fingerprint')) { - fingerprint = _json['fingerprint'] as core.String; - } - if (_json.containsKey('key')) { - key = _json['key'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (expirationTimeUsec != null) { - _json['expirationTimeUsec'] = expirationTimeUsec; - } - if (fingerprint != null) { - _json['fingerprint'] = fingerprint; - } - if (key != null) { - _json['key'] = key; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/privateca/v1beta1.dart b/generated/googleapis_beta/lib/privateca/v1beta1.dart new file mode 100644 index 0000000..48cab0b --- /dev/null +++ b/generated/googleapis_beta/lib/privateca/v1beta1.dart
@@ -0,0 +1,8029 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Certificate Authority API - v1beta1 +/// +/// The Certificate Authority Service API is a highly-available, scalable +/// service that enables you to simplify and automate the management of private +/// certificate authorities (CAs) while staying in control of your private +/// keys." +/// +/// For more information, see <https://cloud.google.com/> +/// +/// Create an instance of [CertificateAuthorityServiceApi] to access these +/// resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsCertificateAuthoritiesResource] +/// - +/// [ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsResource] +/// - [ProjectsLocationsCertificateAuthoritiesCertificatesResource] +/// - [ProjectsLocationsOperationsResource] +/// - [ProjectsLocationsReusableConfigsResource] +library privateca.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// The Certificate Authority Service API is a highly-available, scalable +/// service that enables you to simplify and automate the management of private +/// certificate authorities (CAs) while staying in control of your private +/// keys." +class CertificateAuthorityServiceApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + CertificateAuthorityServiceApi(http.Client client, + {core.String rootUrl = 'https://privateca.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCertificateAuthoritiesResource get certificateAuthorities => + ProjectsLocationsCertificateAuthoritiesResource(_requester); + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsReusableConfigsResource get reusableConfigs => + ProjectsLocationsReusableConfigsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCertificateAuthoritiesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsResource + get certificateRevocationLists => + ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsResource( + _requester); + ProjectsLocationsCertificateAuthoritiesCertificatesResource + get certificates => + ProjectsLocationsCertificateAuthoritiesCertificatesResource( + _requester); + + ProjectsLocationsCertificateAuthoritiesResource(commons.ApiRequester client) + : _requester = client; + + /// Activate a CertificateAuthority that is in state PENDING_ACTIVATION and is + /// of type SUBORDINATE. + /// + /// After the parent Certificate Authority signs a certificate signing request + /// from FetchCertificateAuthorityCsr, this method can complete the activation + /// process. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> activate( + ActivateCertificateAuthorityRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':activate'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Create a new CertificateAuthority in a given Project and Location. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location associated with the + /// CertificateAuthorities, in the format `projects / * /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [certificateAuthorityId] - Required. It must be unique within a location + /// and match the regular expression `[a-zA-Z0-9_-]{1,63}` + /// + /// [requestId] - Optional. An ID to identify requests. Specify a unique + /// request ID so that if you must retry your request, the server will know to + /// ignore the request if it has already been completed. The server will + /// guarantee that for at least 60 minutes since the first request. For + /// example, consider a situation where you make an initial request and t he + /// request times out. If you make the request again with the same request ID, + /// the server can check if original operation with the same request ID was + /// received, and if so, will ignore the second request. This prevents clients + /// from accidentally creating duplicate commitments. The request ID must be a + /// valid UUID with the exception that zero UUID is not supported + /// (00000000-0000-0000-0000-000000000000). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + CertificateAuthority request, + core.String parent, { + core.String certificateAuthorityId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (certificateAuthorityId != null) { + _queryParams['certificateAuthorityId'] = [certificateAuthorityId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/certificateAuthorities'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Disable a CertificateAuthority. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> disable( + DisableCertificateAuthorityRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':disable'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Enable a CertificateAuthority. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> enable( + EnableCertificateAuthorityRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':enable'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Fetch a certificate signing request (CSR) from a CertificateAuthority that + /// is in state PENDING_ACTIVATION and is of type SUBORDINATE. + /// + /// The CSR must then be signed by the desired parent Certificate Authority, + /// which could be another CertificateAuthority resource, or could be an + /// on-prem certificate authority. See also ActivateCertificateAuthority. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [FetchCertificateAuthorityCsrResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<FetchCertificateAuthorityCsrResponse> fetch( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':fetch'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => FetchCertificateAuthorityCsrResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a CertificateAuthority. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the CertificateAuthority to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [CertificateAuthority]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<CertificateAuthority> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => CertificateAuthority.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists CertificateAuthorities. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location associated with the + /// CertificateAuthorities, in the format `projects / * /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - Optional. Only include resources that match the filter in the + /// response. + /// + /// [orderBy] - Optional. Specify how the results should be sorted. + /// + /// [pageSize] - Optional. Limit on the number of CertificateAuthorities to + /// include in the response. Further CertificateAuthorities can subsequently + /// be obtained by including the + /// ListCertificateAuthoritiesResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// [pageToken] - Optional. Pagination token, returned earlier via + /// ListCertificateAuthoritiesResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListCertificateAuthoritiesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListCertificateAuthoritiesResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/certificateAuthorities'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListCertificateAuthoritiesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Update a CertificateAuthority. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. The resource name for this CertificateAuthority in + /// the format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [requestId] - Optional. An ID to identify requests. Specify a unique + /// request ID so that if you must retry your request, the server will know to + /// ignore the request if it has already been completed. The server will + /// guarantee that for at least 60 minutes since the first request. For + /// example, consider a situation where you make an initial request and t he + /// request times out. If you make the request again with the same request ID, + /// the server can check if original operation with the same request ID was + /// received, and if so, will ignore the second request. This prevents clients + /// from accidentally creating duplicate commitments. The request ID must be a + /// valid UUID with the exception that zero UUID is not supported + /// (00000000-0000-0000-0000-000000000000). + /// + /// [updateMask] - Required. A list of fields to be updated in this request. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + CertificateAuthority request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Restore a CertificateAuthority that is scheduled for deletion. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> restore( + RestoreCertificateAuthorityRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':restore'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Schedule a CertificateAuthority for deletion. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this CertificateAuthority in the + /// format `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> scheduleDelete( + ScheduleDeleteCertificateAuthorityRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':scheduleDelete'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsResource( + commons.ApiRequester client) + : _requester = client; + + /// Returns a CertificateRevocationList. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the CertificateRevocationList to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificateRevocationLists/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [CertificateRevocationList]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<CertificateRevocationList> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => CertificateRevocationList.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificateRevocationLists/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists CertificateRevocationLists. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location associated with the + /// CertificateRevocationLists, in the format `projects / * /locations / * + /// /certificateauthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [filter] - Optional. Only include resources that match the filter in the + /// response. + /// + /// [orderBy] - Optional. Specify how the results should be sorted. + /// + /// [pageSize] - Optional. Limit on the number of CertificateRevocationLists + /// to include in the response. Further CertificateRevocationLists can + /// subsequently be obtained by including the + /// ListCertificateRevocationListsResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// [pageToken] - Optional. Pagination token, returned earlier via + /// ListCertificateRevocationListsResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListCertificateRevocationListsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListCertificateRevocationListsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/certificateRevocationLists'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListCertificateRevocationListsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Update a CertificateRevocationList. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. The resource path for this CertificateRevocationList + /// in the format `projects / * /locations / * /certificateAuthorities / * / + /// certificateRevocationLists / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificateRevocationLists/\[^/\]+$`. + /// + /// [requestId] - Optional. An ID to identify requests. Specify a unique + /// request ID so that if you must retry your request, the server will know to + /// ignore the request if it has already been completed. The server will + /// guarantee that for at least 60 minutes since the first request. For + /// example, consider a situation where you make an initial request and t he + /// request times out. If you make the request again with the same request ID, + /// the server can check if original operation with the same request ID was + /// received, and if so, will ignore the second request. This prevents clients + /// from accidentally creating duplicate commitments. The request ID must be a + /// valid UUID with the exception that zero UUID is not supported + /// (00000000-0000-0000-0000-000000000000). + /// + /// [updateMask] - Required. A list of fields to be updated in this request. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + CertificateRevocationList request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificateRevocationLists/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificateRevocationLists/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCertificateAuthoritiesCertificatesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCertificateAuthoritiesCertificatesResource( + commons.ApiRequester client) + : _requester = client; + + /// Create a new Certificate in a given Project, Location from a particular + /// CertificateAuthority. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location and + /// CertificateAuthority associated with the Certificate, in the format + /// `projects / * /locations / * /certificateAuthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [certificateId] - Optional. It must be unique within a location and match + /// the regular expression `[a-zA-Z0-9_-]{1,63}`. This field is required when + /// using a CertificateAuthority in the Enterprise CertificateAuthority.Tier, + /// but is optional and its value is ignored otherwise. + /// + /// [requestId] - Optional. An ID to identify requests. Specify a unique + /// request ID so that if you must retry your request, the server will know to + /// ignore the request if it has already been completed. The server will + /// guarantee that for at least 60 minutes since the first request. For + /// example, consider a situation where you make an initial request and t he + /// request times out. If you make the request again with the same request ID, + /// the server can check if original operation with the same request ID was + /// received, and if so, will ignore the second request. This prevents clients + /// from accidentally creating duplicate commitments. The request ID must be a + /// valid UUID with the exception that zero UUID is not supported + /// (00000000-0000-0000-0000-000000000000). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Certificate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Certificate> create( + Certificate request, + core.String parent, { + core.String certificateId, + core.String requestId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (certificateId != null) { + _queryParams['certificateId'] = [certificateId]; + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/certificates'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + Certificate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a Certificate. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the Certificate to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificates/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Certificate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Certificate> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + Certificate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists Certificates. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location associated with the + /// Certificates, in the format `projects / * /locations / * + /// /certificateauthorities / * `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+$`. + /// + /// [filter] - Optional. Only include resources that match the filter in the + /// response. For details on supported filters and syntax, see + /// [Certificates Filtering documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support). + /// + /// [orderBy] - Optional. Specify how the results should be sorted. For + /// details on supported fields and syntax, see + /// [Certificates Sorting documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support). + /// + /// [pageSize] - Optional. Limit on the number of Certificates to include in + /// the response. Further Certificates can subsequently be obtained by + /// including the ListCertificatesResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// [pageToken] - Optional. Pagination token, returned earlier via + /// ListCertificatesResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListCertificatesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListCertificatesResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/certificates'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListCertificatesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Update a Certificate. + /// + /// Currently, the only field you can update is the labels field. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. The resource path for this Certificate in the format + /// `projects / * /locations / * /certificateAuthorities / * /certificates / * + /// `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificates/\[^/\]+$`. + /// + /// [requestId] - Optional. An ID to identify requests. Specify a unique + /// request ID so that if you must retry your request, the server will know to + /// ignore the request if it has already been completed. The server will + /// guarantee that for at least 60 minutes since the first request. For + /// example, consider a situation where you make an initial request and t he + /// request times out. If you make the request again with the same request ID, + /// the server can check if original operation with the same request ID was + /// received, and if so, will ignore the second request. This prevents clients + /// from accidentally creating duplicate commitments. The request ID must be a + /// valid UUID with the exception that zero UUID is not supported + /// (00000000-0000-0000-0000-000000000000). + /// + /// [updateMask] - Required. A list of fields to be updated in this request. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Certificate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Certificate> patch( + Certificate request, + core.String name, { + core.String requestId, + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (requestId != null) { + _queryParams['requestId'] = [requestId]; + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + Certificate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Revoke a Certificate. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. The resource name for this Certificate in the format + /// `projects / * /locations / * /certificateAuthorities / * /certificates / * + /// `. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/certificateAuthorities/\[^/\]+/certificates/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Certificate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Certificate> revoke( + RevokeCertificateRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':revoke'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + Certificate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Starts asynchronous cancellation on a long-running operation. + /// + /// The server makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + /// or other methods to check whether the cancellation succeeded or whether + /// the operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with an + /// Operation.error value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be cancelled. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> cancel( + CancelOperationRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsReusableConfigsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsReusableConfigsResource(commons.ApiRequester client) + : _requester = client; + + /// Returns a ReusableConfig. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the ReusableConfigs to get. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/reusableConfigs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ReusableConfig]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ReusableConfig> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + ReusableConfig.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the access control policy for a resource. + /// + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/reusableConfigs/\[^/\]+$`. + /// + /// [options_requestedPolicyVersion] - Optional. The policy format version to + /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid + /// value will be rejected. Requests for policies with any conditional + /// bindings must specify version 3. Policies without any conditional bindings + /// may specify any valid value or leave the field unset. To learn which + /// resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> getIamPolicy( + core.String resource, { + core.int options_requestedPolicyVersion, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if (options_requestedPolicyVersion != null) { + _queryParams['options.requestedPolicyVersion'] = [ + '${options_requestedPolicyVersion}' + ]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':getIamPolicy'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists ReusableConfigs. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the location associated with the + /// ReusableConfigs, in the format `projects / * /locations / * `. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - Optional. Only include resources that match the filter in the + /// response. + /// + /// [orderBy] - Optional. Specify how the results should be sorted. + /// + /// [pageSize] - Optional. Limit on the number of ReusableConfigs to include + /// in the response. Further ReusableConfigs can subsequently be obtained by + /// including the ListReusableConfigsResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// [pageToken] - Optional. Pagination token, returned earlier via + /// ListReusableConfigsResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListReusableConfigsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListReusableConfigsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/reusableConfigs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListReusableConfigsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Sets the access control policy on the specified resource. + /// + /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, + /// and `PERMISSION_DENIED` errors. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy is being + /// specified. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/reusableConfigs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Policy]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Policy> setIamPolicy( + SetIamPolicyRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':setIamPolicy'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns permissions that a caller has on the specified resource. + /// + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to + /// be used for building permission-aware UIs and command-line tools, not for + /// authorization checking. This operation may "fail open" without warning. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [resource] - REQUIRED: The resource for which the policy detail is being + /// requested. See the operation documentation for the appropriate value for + /// this field. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/reusableConfigs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [TestIamPermissionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<TestIamPermissionsResponse> testIamPermissions( + TestIamPermissionsRequest request, + core.String resource, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (resource == null) { + throw core.ArgumentError('Parameter resource is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$resource') + + ':testIamPermissions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => TestIamPermissionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// URLs where a CertificateAuthority will publish content. +class AccessUrls { + /// The URL where this CertificateAuthority's CA certificate is published. + /// + /// This will only be set for CAs that have been activated. + core.String caCertificateAccessUrl; + + /// The URL where this CertificateAuthority's CRLs are published. + /// + /// This will only be set for CAs that have been activated. + core.String crlAccessUrl; + + AccessUrls(); + + AccessUrls.fromJson(core.Map _json) { + if (_json.containsKey('caCertificateAccessUrl')) { + caCertificateAccessUrl = _json['caCertificateAccessUrl'] as core.String; + } + if (_json.containsKey('crlAccessUrl')) { + crlAccessUrl = _json['crlAccessUrl'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (caCertificateAccessUrl != null) { + _json['caCertificateAccessUrl'] = caCertificateAccessUrl; + } + if (crlAccessUrl != null) { + _json['crlAccessUrl'] = crlAccessUrl; + } + return _json; + } +} + +/// Request message for +/// CertificateAuthorityService.ActivateCertificateAuthority. +class ActivateCertificateAuthorityRequest { + /// The signed CA certificate issued from + /// FetchCertificateAuthorityCsrResponse.pem_csr. + /// + /// Required. + core.String pemCaCertificate; + + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + /// Must include information about the issuer of 'pem_ca_certificate', and any + /// further issuers until the self-signed CA. + /// + /// Required. + SubordinateConfig subordinateConfig; + + ActivateCertificateAuthorityRequest(); + + ActivateCertificateAuthorityRequest.fromJson(core.Map _json) { + if (_json.containsKey('pemCaCertificate')) { + pemCaCertificate = _json['pemCaCertificate'] as core.String; + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + if (_json.containsKey('subordinateConfig')) { + subordinateConfig = SubordinateConfig.fromJson( + _json['subordinateConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pemCaCertificate != null) { + _json['pemCaCertificate'] = pemCaCertificate; + } + if (requestId != null) { + _json['requestId'] = requestId; + } + if (subordinateConfig != null) { + _json['subordinateConfig'] = subordinateConfig.toJson(); + } + return _json; + } +} + +class AllowedConfigList { + /// All Certificates issued by the CertificateAuthority must match at least + /// one listed ReusableConfigWrapper. + /// + /// If a ReusableConfigWrapper has an empty field, any value will be allowed + /// for that field. + /// + /// Required. + core.List<ReusableConfigWrapper> allowedConfigValues; + + AllowedConfigList(); + + AllowedConfigList.fromJson(core.Map _json) { + if (_json.containsKey('allowedConfigValues')) { + allowedConfigValues = (_json['allowedConfigValues'] as core.List) + .map<ReusableConfigWrapper>((value) => ReusableConfigWrapper.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowedConfigValues != null) { + _json['allowedConfigValues'] = + allowedConfigValues.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// AllowedSubjectAltNames specifies the allowed values for SubjectAltNames by +/// the CertificateAuthority when issuing Certificates. +class AllowedSubjectAltNames { + /// Specifies if to allow custom X509Extension values. + /// + /// Optional. + core.bool allowCustomSans; + + /// Specifies if glob patterns used for allowed_dns_names allow wildcard + /// certificates. + /// + /// If this is set, certificate requests with wildcard domains will be + /// permitted to match a glob pattern specified in allowed_dns_names. + /// Otherwise, certificate requests with wildcard domains will be permitted + /// only if allowed_dns_names contains a literal wildcard. + /// + /// Optional. + core.bool allowGlobbingDnsWildcards; + + /// Contains valid, fully-qualified host names. + /// + /// Glob patterns are also supported. To allow an explicit wildcard + /// certificate, escape with backlash (i.e. "\*"). E.g. for globbed entries: + /// '*bar.com' will allow 'foo.bar.com', but not '*.bar.com', unless the + /// allow_globbing_dns_wildcards field is set. E.g. for wildcard entries: + /// '\*.bar.com' will allow '*.bar.com', but not 'foo.bar.com'. + /// + /// Optional. + core.List<core.String> allowedDnsNames; + + /// Contains valid RFC 2822 E-mail addresses. + /// + /// Glob patterns are also supported. + /// + /// Optional. + core.List<core.String> allowedEmailAddresses; + + /// Contains valid 32-bit IPv4 addresses and subnet ranges or RFC 4291 IPv6 + /// addresses and subnet ranges. + /// + /// Subnet ranges are specified using the '/' notation (e.g. 10.0.0.0/8, + /// 2001:700:300:1800::/64). Glob patterns are supported only for ip address + /// entries (i.e. not for subnet ranges). + /// + /// Optional. + core.List<core.String> allowedIps; + + /// Contains valid RFC 3986 URIs. + /// + /// Glob patterns are also supported. To match across path seperators (i.e. + /// '/') use the double star glob pattern (i.e. '**'). + /// + /// Optional. + core.List<core.String> allowedUris; + + AllowedSubjectAltNames(); + + AllowedSubjectAltNames.fromJson(core.Map _json) { + if (_json.containsKey('allowCustomSans')) { + allowCustomSans = _json['allowCustomSans'] as core.bool; + } + if (_json.containsKey('allowGlobbingDnsWildcards')) { + allowGlobbingDnsWildcards = + _json['allowGlobbingDnsWildcards'] as core.bool; + } + if (_json.containsKey('allowedDnsNames')) { + allowedDnsNames = (_json['allowedDnsNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('allowedEmailAddresses')) { + allowedEmailAddresses = (_json['allowedEmailAddresses'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('allowedIps')) { + allowedIps = (_json['allowedIps'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('allowedUris')) { + allowedUris = (_json['allowedUris'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowCustomSans != null) { + _json['allowCustomSans'] = allowCustomSans; + } + if (allowGlobbingDnsWildcards != null) { + _json['allowGlobbingDnsWildcards'] = allowGlobbingDnsWildcards; + } + if (allowedDnsNames != null) { + _json['allowedDnsNames'] = allowedDnsNames; + } + if (allowedEmailAddresses != null) { + _json['allowedEmailAddresses'] = allowedEmailAddresses; + } + if (allowedIps != null) { + _json['allowedIps'] = allowedIps; + } + if (allowedUris != null) { + _json['allowedUris'] = allowedUris; + } + return _json; + } +} + +/// Specifies the audit configuration for a service. +/// +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. An AuditConfig must have one +/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices` +/// and a specific service, the union of the two AuditConfigs is used for that +/// service: the log_types specified in each AuditConfig are enabled, and the +/// exempted_members in each AuditLogConfig are exempted. Example Policy with +/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices", +/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[ +/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type": +/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com", +/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type": +/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] } +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +class AuditConfig { + /// The configuration for logging of each type of permission. + core.List<AuditLogConfig> auditLogConfigs; + + /// Specifies a service that will be enabled for audit logging. + /// + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + core.String service; + + AuditConfig(); + + AuditConfig.fromJson(core.Map _json) { + if (_json.containsKey('auditLogConfigs')) { + auditLogConfigs = (_json['auditLogConfigs'] as core.List) + .map<AuditLogConfig>((value) => AuditLogConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('service')) { + service = _json['service'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditLogConfigs != null) { + _json['auditLogConfigs'] = + auditLogConfigs.map((value) => value.toJson()).toList(); + } + if (service != null) { + _json['service'] = service; + } + return _json; + } +} + +/// Provides the configuration for logging a type of permissions. +/// +/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ", +/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type": +/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while +/// exempting jose@example.com from DATA_READ logging. +class AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// + /// Follows the same format of Binding.members. + core.List<core.String> exemptedMembers; + + /// The log type that this config enables. + /// Possible string values are: + /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. + /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy + /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create + /// - "DATA_READ" : Data reads. Example: CloudSQL Users list + core.String logType; + + AuditLogConfig(); + + AuditLogConfig.fromJson(core.Map _json) { + if (_json.containsKey('exemptedMembers')) { + exemptedMembers = (_json['exemptedMembers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('logType')) { + logType = _json['logType'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (exemptedMembers != null) { + _json['exemptedMembers'] = exemptedMembers; + } + if (logType != null) { + _json['logType'] = logType; + } + return _json; + } +} + +/// Message for reporting billing requests through Eventstream. +class BillingView { + /// Billing requests to be reported for cloud.eventstream.v2.ResourceEvent + /// Each request contains billing operations to be reported under a service + /// name. + /// + /// See go/billing-view-construction for documentation on constructing billing + /// view report requests. + core.List<GoogleApiServicecontrolV1ReportRequest> reportRequests; + + BillingView(); + + BillingView.fromJson(core.Map _json) { + if (_json.containsKey('reportRequests')) { + reportRequests = (_json['reportRequests'] as core.List) + .map<GoogleApiServicecontrolV1ReportRequest>((value) => + GoogleApiServicecontrolV1ReportRequest.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (reportRequests != null) { + _json['reportRequests'] = + reportRequests.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Associates `members` with a `role`. +class Binding { + /// The condition that is associated with this binding. + /// + /// If the condition evaluates to `true`, then this binding applies to the + /// current request. If the condition evaluates to `false`, then this binding + /// does not apply to the current request. However, a different role binding + /// might grant the same role to one or more of the members in this binding. + /// To learn which resources support conditions in their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition; + + /// Specifies the identities requesting access for a Cloud Platform resource. + /// + /// `members` can have the following values: * `allUsers`: A special + /// identifier that represents anyone who is on the internet; with or without + /// a Google account. * `allAuthenticatedUsers`: A special identifier that + /// represents anyone who is authenticated with a Google account or a service + /// account. * `user:{emailid}`: An email address that represents a specific + /// Google account. For example, `alice@example.com` . * + /// `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * + /// `group:{emailid}`: An email address that represents a Google group. For + /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a user that has + /// been recently deleted. For example, + /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, + /// this value reverts to `user:{emailid}` and the recovered user retains the + /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: + /// An email address (plus unique identifier) representing a service account + /// that has been recently deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If + /// the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email + /// address (plus unique identifier) representing a Google group that has been + /// recently deleted. For example, + /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, + /// this value reverts to `group:{emailid}` and the recovered group retains + /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) + /// that represents all the users of that domain. For example, `google.com` or + /// `example.com`. + core.List<core.String> members; + + /// Role that is assigned to `members`. + /// + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + core.String role; + + Binding(); + + Binding.fromJson(core.Map _json) { + if (_json.containsKey('condition')) { + condition = Expr.fromJson( + _json['condition'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('members')) { + members = (_json['members'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('role')) { + role = _json['role'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (condition != null) { + _json['condition'] = condition.toJson(); + } + if (members != null) { + _json['members'] = members; + } + if (role != null) { + _json['role'] = role; + } + return _json; + } +} + +/// Describes values that are relevant in a CA certificate. +class CaOptions { + /// Refers to the "CA" X.509 extension, which is a boolean value. + /// + /// When this value is missing, the extension will be omitted from the CA + /// certificate. + /// + /// Optional. + core.bool isCa; + + /// Refers to the path length restriction X.509 extension. + /// + /// For a CA certificate, this value describes the depth of subordinate CA + /// certificates that are allowed. If this value is less than 0, the request + /// will fail. If this value is missing, the max path length will be omitted + /// from the CA certificate. + /// + /// Optional. + core.int maxIssuerPathLength; + + CaOptions(); + + CaOptions.fromJson(core.Map _json) { + if (_json.containsKey('isCa')) { + isCa = _json['isCa'] as core.bool; + } + if (_json.containsKey('maxIssuerPathLength')) { + maxIssuerPathLength = _json['maxIssuerPathLength'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (isCa != null) { + _json['isCa'] = isCa; + } + if (maxIssuerPathLength != null) { + _json['maxIssuerPathLength'] = maxIssuerPathLength; + } + return _json; + } +} + +/// The request message for Operations.CancelOperation. +class CancelOperationRequest { + CancelOperationRequest(); + + CancelOperationRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// A Certificate corresponds to a signed X.509 certificate issued by a +/// CertificateAuthority. +class Certificate { + /// A structured description of the issued X.509 certificate. + /// + /// Output only. + CertificateDescription certificateDescription; + + /// A description of the certificate and key that does not require X.509 or + /// ASN.1. + /// + /// Immutable. + CertificateConfig config; + + /// The time at which this Certificate was created. + /// + /// Output only. + core.String createTime; + + /// Labels with user-defined metadata. + /// + /// Optional. + core.Map<core.String, core.String> labels; + + /// The desired lifetime of a certificate. + /// + /// Used to create the "not_before_time" and "not_after_time" fields inside an + /// X.509 certificate. Note that the lifetime may be truncated if it would + /// extend past the life of any certificate authority in the issuing chain. + /// + /// Required. Immutable. + core.String lifetime; + + /// The resource path for this Certificate in the format `projects / * + /// /locations / * /certificateAuthorities / * /certificates / * `. + /// + /// Output only. + core.String name; + + /// The pem-encoded, signed X.509 certificate. + /// + /// Output only. + core.String pemCertificate; + + /// The chain that may be used to verify the X.509 certificate. + /// + /// Expected to be in issuer-to-root order according to RFC 5246. + /// + /// Output only. + core.List<core.String> pemCertificateChain; + + /// A pem-encoded X.509 certificate signing request (CSR). + /// + /// Immutable. + core.String pemCsr; + + /// Details regarding the revocation of this Certificate. + /// + /// This Certificate is considered revoked if and only if this field is + /// present. + /// + /// Output only. + RevocationDetails revocationDetails; + + /// The time at which this Certificate was updated. + /// + /// Output only. + core.String updateTime; + + Certificate(); + + Certificate.fromJson(core.Map _json) { + if (_json.containsKey('certificateDescription')) { + certificateDescription = CertificateDescription.fromJson( + _json['certificateDescription'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('config')) { + config = CertificateConfig.fromJson( + _json['config'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('lifetime')) { + lifetime = _json['lifetime'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('pemCertificate')) { + pemCertificate = _json['pemCertificate'] as core.String; + } + if (_json.containsKey('pemCertificateChain')) { + pemCertificateChain = (_json['pemCertificateChain'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('pemCsr')) { + pemCsr = _json['pemCsr'] as core.String; + } + if (_json.containsKey('revocationDetails')) { + revocationDetails = RevocationDetails.fromJson( + _json['revocationDetails'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificateDescription != null) { + _json['certificateDescription'] = certificateDescription.toJson(); + } + if (config != null) { + _json['config'] = config.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (labels != null) { + _json['labels'] = labels; + } + if (lifetime != null) { + _json['lifetime'] = lifetime; + } + if (name != null) { + _json['name'] = name; + } + if (pemCertificate != null) { + _json['pemCertificate'] = pemCertificate; + } + if (pemCertificateChain != null) { + _json['pemCertificateChain'] = pemCertificateChain; + } + if (pemCsr != null) { + _json['pemCsr'] = pemCsr; + } + if (revocationDetails != null) { + _json['revocationDetails'] = revocationDetails.toJson(); + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// A CertificateAuthority represents an individual Certificate Authority. +/// +/// A CertificateAuthority can be used to create Certificates. +class CertificateAuthority { + /// URLs for accessing content published by this CA, such as the CA + /// certificate and CRLs. + /// + /// Output only. + AccessUrls accessUrls; + + /// A structured description of this CertificateAuthority's CA certificate and + /// its issuers. + /// + /// Ordered as self-to-root. + /// + /// Output only. + core.List<CertificateDescription> caCertificateDescriptions; + + /// The CertificateAuthorityPolicy to enforce when issuing Certificates from + /// this CertificateAuthority. + /// + /// Optional. + CertificateAuthorityPolicy certificatePolicy; + + /// The config used to create a self-signed X.509 certificate or CSR. + /// + /// Required. Immutable. + CertificateConfig config; + + /// The time at which this CertificateAuthority was created. + /// + /// Output only. + core.String createTime; + + /// The time at which this CertificateAuthority will be deleted, if scheduled + /// for deletion. + /// + /// Output only. + core.String deleteTime; + + /// The name of a Cloud Storage bucket where this CertificateAuthority will + /// publish content, such as the CA certificate and CRLs. + /// + /// This must be a bucket name, without any prefixes (such as `gs://`) or + /// suffixes (such as `.googleapis.com`). For example, to use a bucket named + /// `my-bucket`, you would simply specify `my-bucket`. If not specified, a + /// managed bucket will be created. + /// + /// Immutable. + core.String gcsBucket; + + /// The IssuingOptions to follow when issuing Certificates from this + /// CertificateAuthority. + /// + /// Optional. + IssuingOptions issuingOptions; + + /// Used when issuing certificates for this CertificateAuthority. + /// + /// If this CertificateAuthority is a self-signed CertificateAuthority, this + /// key is also used to sign the self-signed CA certificate. Otherwise, it is + /// used to sign a CSR. + /// + /// Required. Immutable. + KeyVersionSpec keySpec; + + /// Labels with user-defined metadata. + /// + /// Optional. + core.Map<core.String, core.String> labels; + + /// The desired lifetime of the CA certificate. + /// + /// Used to create the "not_before_time" and "not_after_time" fields inside an + /// X.509 certificate. + /// + /// Required. + core.String lifetime; + + /// The resource name for this CertificateAuthority in the format `projects / + /// * /locations / * /certificateAuthorities / * `. + /// + /// Output only. + core.String name; + + /// This CertificateAuthority's certificate chain, including the current + /// CertificateAuthority's certificate. + /// + /// Ordered such that the root issuer is the final element (consistent with + /// RFC 5246). For a self-signed CA, this will only list the current + /// CertificateAuthority's certificate. + /// + /// Output only. + core.List<core.String> pemCaCertificates; + + /// The State for this CertificateAuthority. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Not specified. + /// - "ENABLED" : Certificates can be issued from this CA. CRLs will be + /// generated for this CA. + /// - "DISABLED" : Certificates cannot be issued from this CA. CRLs will still + /// be generated. + /// - "PENDING_ACTIVATION" : Certificates cannot be issued from this CA. CRLs + /// will not be generated. + /// - "PENDING_DELETION" : Certificates cannot be issued from this CA. CRLs + /// will not be generated. + core.String state; + + /// If this is a subordinate CertificateAuthority, this field will be set with + /// the subordinate configuration, which describes its issuers. + /// + /// This may be updated, but this CertificateAuthority must continue to + /// validate. + /// + /// Optional. + SubordinateConfig subordinateConfig; + + /// The Tier of this CertificateAuthority. + /// + /// Required. Immutable. + /// Possible string values are: + /// - "TIER_UNSPECIFIED" : Not specified. + /// - "ENTERPRISE" : Enterprise tier. + /// - "DEVOPS" : DevOps tier. + core.String tier; + + /// The Type of this CertificateAuthority. + /// + /// Required. Immutable. + /// Possible string values are: + /// - "TYPE_UNSPECIFIED" : Not specified. + /// - "SELF_SIGNED" : Self-signed CA. + /// - "SUBORDINATE" : Subordinate CA. Could be issued by a Private CA + /// CertificateAuthority or an unmanaged CA. + core.String type; + + /// The time at which this CertificateAuthority was updated. + /// + /// Output only. + core.String updateTime; + + CertificateAuthority(); + + CertificateAuthority.fromJson(core.Map _json) { + if (_json.containsKey('accessUrls')) { + accessUrls = AccessUrls.fromJson( + _json['accessUrls'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('caCertificateDescriptions')) { + caCertificateDescriptions = + (_json['caCertificateDescriptions'] as core.List) + .map<CertificateDescription>((value) => + CertificateDescription.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('certificatePolicy')) { + certificatePolicy = CertificateAuthorityPolicy.fromJson( + _json['certificatePolicy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('config')) { + config = CertificateConfig.fromJson( + _json['config'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('deleteTime')) { + deleteTime = _json['deleteTime'] as core.String; + } + if (_json.containsKey('gcsBucket')) { + gcsBucket = _json['gcsBucket'] as core.String; + } + if (_json.containsKey('issuingOptions')) { + issuingOptions = IssuingOptions.fromJson( + _json['issuingOptions'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('keySpec')) { + keySpec = KeyVersionSpec.fromJson( + _json['keySpec'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('lifetime')) { + lifetime = _json['lifetime'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('pemCaCertificates')) { + pemCaCertificates = (_json['pemCaCertificates'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('subordinateConfig')) { + subordinateConfig = SubordinateConfig.fromJson( + _json['subordinateConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('tier')) { + tier = _json['tier'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accessUrls != null) { + _json['accessUrls'] = accessUrls.toJson(); + } + if (caCertificateDescriptions != null) { + _json['caCertificateDescriptions'] = + caCertificateDescriptions.map((value) => value.toJson()).toList(); + } + if (certificatePolicy != null) { + _json['certificatePolicy'] = certificatePolicy.toJson(); + } + if (config != null) { + _json['config'] = config.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (deleteTime != null) { + _json['deleteTime'] = deleteTime; + } + if (gcsBucket != null) { + _json['gcsBucket'] = gcsBucket; + } + if (issuingOptions != null) { + _json['issuingOptions'] = issuingOptions.toJson(); + } + if (keySpec != null) { + _json['keySpec'] = keySpec.toJson(); + } + if (labels != null) { + _json['labels'] = labels; + } + if (lifetime != null) { + _json['lifetime'] = lifetime; + } + if (name != null) { + _json['name'] = name; + } + if (pemCaCertificates != null) { + _json['pemCaCertificates'] = pemCaCertificates; + } + if (state != null) { + _json['state'] = state; + } + if (subordinateConfig != null) { + _json['subordinateConfig'] = subordinateConfig.toJson(); + } + if (tier != null) { + _json['tier'] = tier; + } + if (type != null) { + _json['type'] = type; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// The issuing policy for a CertificateAuthority. +/// +/// Certificates will not be successfully issued from this CertificateAuthority +/// if they violate the policy. +class CertificateAuthorityPolicy { + /// If any value is specified here, then all Certificates issued by the + /// CertificateAuthority must match at least one listed value. + /// + /// If no value is specified, all values will be allowed for this fied. Glob + /// patterns are also supported. + /// + /// Optional. + core.List<core.String> allowedCommonNames; + + /// All Certificates issued by the CertificateAuthority must match at least + /// one listed ReusableConfigWrapper in the list. + /// + /// Optional. + AllowedConfigList allowedConfigList; + + /// If specified, then only methods allowed in the IssuanceModes may be used + /// to issue Certificates. + /// + /// Optional. + IssuanceModes allowedIssuanceModes; + + /// If any Subject is specified here, then all Certificates issued by the + /// CertificateAuthority must match at least one listed Subject. + /// + /// If a Subject has an empty field, any value will be allowed for that field. + /// + /// Optional. + core.List<Subject> allowedLocationsAndOrganizations; + + /// If a AllowedSubjectAltNames is specified here, then all Certificates + /// issued by the CertificateAuthority must match AllowedSubjectAltNames. + /// + /// If no value or an empty value is specified, any value will be allowed for + /// the SubjectAltNames field. + /// + /// Optional. + AllowedSubjectAltNames allowedSans; + + /// The maximum lifetime allowed by the CertificateAuthority. + /// + /// Note that if the any part if the issuing chain expires before a + /// Certificate's requested maximum_lifetime, the effective lifetime will be + /// explicitly truncated. + /// + /// Optional. + core.String maximumLifetime; + + /// All Certificates issued by the CertificateAuthority will use the provided + /// configuration values, overwriting any requested configuration values. + /// + /// Optional. + ReusableConfigWrapper overwriteConfigValues; + + CertificateAuthorityPolicy(); + + CertificateAuthorityPolicy.fromJson(core.Map _json) { + if (_json.containsKey('allowedCommonNames')) { + allowedCommonNames = (_json['allowedCommonNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('allowedConfigList')) { + allowedConfigList = AllowedConfigList.fromJson( + _json['allowedConfigList'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('allowedIssuanceModes')) { + allowedIssuanceModes = IssuanceModes.fromJson( + _json['allowedIssuanceModes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('allowedLocationsAndOrganizations')) { + allowedLocationsAndOrganizations = + (_json['allowedLocationsAndOrganizations'] as core.List) + .map<Subject>((value) => Subject.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('allowedSans')) { + allowedSans = AllowedSubjectAltNames.fromJson( + _json['allowedSans'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('maximumLifetime')) { + maximumLifetime = _json['maximumLifetime'] as core.String; + } + if (_json.containsKey('overwriteConfigValues')) { + overwriteConfigValues = ReusableConfigWrapper.fromJson( + _json['overwriteConfigValues'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowedCommonNames != null) { + _json['allowedCommonNames'] = allowedCommonNames; + } + if (allowedConfigList != null) { + _json['allowedConfigList'] = allowedConfigList.toJson(); + } + if (allowedIssuanceModes != null) { + _json['allowedIssuanceModes'] = allowedIssuanceModes.toJson(); + } + if (allowedLocationsAndOrganizations != null) { + _json['allowedLocationsAndOrganizations'] = + allowedLocationsAndOrganizations + .map((value) => value.toJson()) + .toList(); + } + if (allowedSans != null) { + _json['allowedSans'] = allowedSans.toJson(); + } + if (maximumLifetime != null) { + _json['maximumLifetime'] = maximumLifetime; + } + if (overwriteConfigValues != null) { + _json['overwriteConfigValues'] = overwriteConfigValues.toJson(); + } + return _json; + } +} + +/// A CertificateConfig describes an X.509 certificate or CSR that is to be +/// created, as an alternative to using ASN.1. +class CertificateConfig { + /// The public key that corresponds to this config. + /// + /// This is, for example, used when issuing Certificates, but not when + /// creating a self-signed CertificateAuthority or CertificateAuthority CSR. + /// + /// Optional. + PublicKey publicKey; + + /// Describes how some of the technical fields in a certificate should be + /// populated. + /// + /// Required. + ReusableConfigWrapper reusableConfig; + + /// Specifies some of the values in a certificate that are related to the + /// subject. + /// + /// Required. + SubjectConfig subjectConfig; + + CertificateConfig(); + + CertificateConfig.fromJson(core.Map _json) { + if (_json.containsKey('publicKey')) { + publicKey = PublicKey.fromJson( + _json['publicKey'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('reusableConfig')) { + reusableConfig = ReusableConfigWrapper.fromJson( + _json['reusableConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('subjectConfig')) { + subjectConfig = SubjectConfig.fromJson( + _json['subjectConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (publicKey != null) { + _json['publicKey'] = publicKey.toJson(); + } + if (reusableConfig != null) { + _json['reusableConfig'] = reusableConfig.toJson(); + } + if (subjectConfig != null) { + _json['subjectConfig'] = subjectConfig.toJson(); + } + return _json; + } +} + +/// A CertificateDescription describes an X.509 certificate or CSR that has been +/// issued, as an alternative to using ASN.1 / X.509. +class CertificateDescription { + /// Describes lists of issuer CA certificate URLs that appear in the + /// "Authority Information Access" extension in the certificate. + core.List<core.String> aiaIssuingCertificateUrls; + + /// Identifies the subject_key_id of the parent certificate, per + /// https://tools.ietf.org/html/rfc5280#section-4.2.1.1 + KeyId authorityKeyId; + + /// The hash of the x.509 certificate. + CertificateFingerprint certFingerprint; + + /// Describes some of the technical fields in a certificate. + ReusableConfigValues configValues; + + /// Describes a list of locations to obtain CRL information, i.e. the + /// DistributionPoint.fullName described by + /// https://tools.ietf.org/html/rfc5280#section-4.2.1.13 + core.List<core.String> crlDistributionPoints; + + /// The public key that corresponds to an issued certificate. + PublicKey publicKey; + + /// Describes some of the values in a certificate that are related to the + /// subject and lifetime. + SubjectDescription subjectDescription; + + /// Provides a means of identifiying certificates that contain a particular + /// public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2. + KeyId subjectKeyId; + + CertificateDescription(); + + CertificateDescription.fromJson(core.Map _json) { + if (_json.containsKey('aiaIssuingCertificateUrls')) { + aiaIssuingCertificateUrls = + (_json['aiaIssuingCertificateUrls'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('authorityKeyId')) { + authorityKeyId = KeyId.fromJson( + _json['authorityKeyId'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('certFingerprint')) { + certFingerprint = CertificateFingerprint.fromJson( + _json['certFingerprint'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('configValues')) { + configValues = ReusableConfigValues.fromJson( + _json['configValues'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('crlDistributionPoints')) { + crlDistributionPoints = (_json['crlDistributionPoints'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('publicKey')) { + publicKey = PublicKey.fromJson( + _json['publicKey'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('subjectDescription')) { + subjectDescription = SubjectDescription.fromJson( + _json['subjectDescription'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('subjectKeyId')) { + subjectKeyId = KeyId.fromJson( + _json['subjectKeyId'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (aiaIssuingCertificateUrls != null) { + _json['aiaIssuingCertificateUrls'] = aiaIssuingCertificateUrls; + } + if (authorityKeyId != null) { + _json['authorityKeyId'] = authorityKeyId.toJson(); + } + if (certFingerprint != null) { + _json['certFingerprint'] = certFingerprint.toJson(); + } + if (configValues != null) { + _json['configValues'] = configValues.toJson(); + } + if (crlDistributionPoints != null) { + _json['crlDistributionPoints'] = crlDistributionPoints; + } + if (publicKey != null) { + _json['publicKey'] = publicKey.toJson(); + } + if (subjectDescription != null) { + _json['subjectDescription'] = subjectDescription.toJson(); + } + if (subjectKeyId != null) { + _json['subjectKeyId'] = subjectKeyId.toJson(); + } + return _json; + } +} + +/// A group of fingerprints for the x509 certificate. +class CertificateFingerprint { + /// The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate. + core.String sha256Hash; + + CertificateFingerprint(); + + CertificateFingerprint.fromJson(core.Map _json) { + if (_json.containsKey('sha256Hash')) { + sha256Hash = _json['sha256Hash'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (sha256Hash != null) { + _json['sha256Hash'] = sha256Hash; + } + return _json; + } +} + +/// A CertificateRevocationList corresponds to a signed X.509 certificate +/// Revocation List (CRL). +/// +/// A CRL contains the serial numbers of certificates that should no longer be +/// trusted. +class CertificateRevocationList { + /// The location where 'pem_crl' can be accessed. + /// + /// Output only. + core.String accessUrl; + + /// The time at which this CertificateRevocationList was created. + /// + /// Output only. + core.String createTime; + + /// Labels with user-defined metadata. + /// + /// Optional. + core.Map<core.String, core.String> labels; + + /// The resource path for this CertificateRevocationList in the format + /// `projects / * /locations / * /certificateAuthorities / * / + /// certificateRevocationLists / * `. + /// + /// Output only. + core.String name; + + /// The PEM-encoded X.509 CRL. + /// + /// Output only. + core.String pemCrl; + + /// The revoked serial numbers that appear in pem_crl. + /// + /// Output only. + core.List<RevokedCertificate> revokedCertificates; + + /// The CRL sequence number that appears in pem_crl. + /// + /// Output only. + core.String sequenceNumber; + + /// The State for this CertificateRevocationList. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Not specified. + /// - "ACTIVE" : The CertificateRevocationList is up to date. + /// - "SUPERSEDED" : The CertificateRevocationList is no longer current. + core.String state; + + /// The time at which this CertificateRevocationList was updated. + /// + /// Output only. + core.String updateTime; + + CertificateRevocationList(); + + CertificateRevocationList.fromJson(core.Map _json) { + if (_json.containsKey('accessUrl')) { + accessUrl = _json['accessUrl'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('pemCrl')) { + pemCrl = _json['pemCrl'] as core.String; + } + if (_json.containsKey('revokedCertificates')) { + revokedCertificates = (_json['revokedCertificates'] as core.List) + .map<RevokedCertificate>((value) => RevokedCertificate.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('sequenceNumber')) { + sequenceNumber = _json['sequenceNumber'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (accessUrl != null) { + _json['accessUrl'] = accessUrl; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (pemCrl != null) { + _json['pemCrl'] = pemCrl; + } + if (revokedCertificates != null) { + _json['revokedCertificates'] = + revokedCertificates.map((value) => value.toJson()).toList(); + } + if (sequenceNumber != null) { + _json['sequenceNumber'] = sequenceNumber; + } + if (state != null) { + _json['state'] = state; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Request message for CertificateAuthorityService.DisableCertificateAuthority. +class DisableCertificateAuthorityRequest { + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + DisableCertificateAuthorityRequest(); + + DisableCertificateAuthorityRequest.fromJson(core.Map _json) { + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for CertificateAuthorityService.EnableCertificateAuthority. +class EnableCertificateAuthorityRequest { + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + EnableCertificateAuthorityRequest(); + + EnableCertificateAuthorityRequest.fromJson(core.Map _json) { + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// Exemplars are example points that may be used to annotate aggregated +/// distribution values. +/// +/// They are metadata that gives information about a particular value added to a +/// Distribution bucket, such as a trace ID that was active when a value was +/// added. They may contain further information, such as a example values and +/// timestamps, origin, etc. +class Exemplar { + /// Contextual information about the example value. + /// + /// Examples are: Trace: type.googleapis.com/google.monitoring.v3.SpanContext + /// Literal string: type.googleapis.com/google.protobuf.StringValue Labels + /// dropped during aggregation: + /// type.googleapis.com/google.monitoring.v3.DroppedLabels There may be only a + /// single attachment of any given message type in a single exemplar, and this + /// is enforced by the system. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> attachments; + + /// The observation (sampling) time of the above value. + core.String timestamp; + + /// Value of the exemplar point. + /// + /// This value determines to which bucket the exemplar belongs. + core.double value; + + Exemplar(); + + Exemplar.fromJson(core.Map _json) { + if (_json.containsKey('attachments')) { + attachments = (_json['attachments'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('timestamp')) { + timestamp = _json['timestamp'] as core.String; + } + if (_json.containsKey('value')) { + value = (_json['value'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attachments != null) { + _json['attachments'] = attachments; + } + if (timestamp != null) { + _json['timestamp'] = timestamp; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. +/// +/// CEL is a C-like expression language. The syntax and semantics of CEL are +/// documented at https://github.com/google/cel-spec. Example (Comparison): +/// title: "Summary size limit" description: "Determines if a summary is less +/// than 100 chars" expression: "document.summary.size() < 100" Example +/// (Equality): title: "Requestor is owner" description: "Determines if +/// requestor is the document owner" expression: "document.owner == +/// request.auth.claims.email" Example (Logic): title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): title: "Notification string" description: +/// "Create a notification string with a timestamp." expression: "'New message +/// received at ' + string(document.create_time)" The exact variables and +/// functions that may be referenced within an expression are determined by the +/// service that evaluates it. See the service documentation for additional +/// information. +class Expr { + /// Description of the expression. + /// + /// This is a longer text which describes the expression, e.g. when hovered + /// over it in a UI. + /// + /// Optional. + core.String description; + + /// Textual representation of an expression in Common Expression Language + /// syntax. + core.String expression; + + /// String indicating the location of the expression for error reporting, e.g. + /// a file name and a position in the file. + /// + /// Optional. + core.String location; + + /// Title for the expression, i.e. a short string describing its purpose. + /// + /// This can be used e.g. in UIs which allow to enter the expression. + /// + /// Optional. + core.String title; + + Expr(); + + Expr.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('expression')) { + expression = _json['expression'] as core.String; + } + if (_json.containsKey('location')) { + location = _json['location'] as core.String; + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + if (expression != null) { + _json['expression'] = expression; + } + if (location != null) { + _json['location'] = location; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// KeyUsage.ExtendedKeyUsageOptions has fields that correspond to certain +/// common OIDs that could be specified as an extended key usage value. +class ExtendedKeyUsageOptions { + /// Corresponds to OID 1.3.6.1.5.5.7.3.2. + /// + /// Officially described as "TLS WWW client authentication", though regularly + /// used for non-WWW TLS. + core.bool clientAuth; + + /// Corresponds to OID 1.3.6.1.5.5.7.3.3. + /// + /// Officially described as "Signing of downloadable executable code client + /// authentication". + core.bool codeSigning; + + /// Corresponds to OID 1.3.6.1.5.5.7.3.4. + /// + /// Officially described as "Email protection". + core.bool emailProtection; + + /// Corresponds to OID 1.3.6.1.5.5.7.3.9. + /// + /// Officially described as "Signing OCSP responses". + core.bool ocspSigning; + + /// Corresponds to OID 1.3.6.1.5.5.7.3.1. + /// + /// Officially described as "TLS WWW server authentication", though regularly + /// used for non-WWW TLS. + core.bool serverAuth; + + /// Corresponds to OID 1.3.6.1.5.5.7.3.8. + /// + /// Officially described as "Binding the hash of an object to a time". + core.bool timeStamping; + + ExtendedKeyUsageOptions(); + + ExtendedKeyUsageOptions.fromJson(core.Map _json) { + if (_json.containsKey('clientAuth')) { + clientAuth = _json['clientAuth'] as core.bool; + } + if (_json.containsKey('codeSigning')) { + codeSigning = _json['codeSigning'] as core.bool; + } + if (_json.containsKey('emailProtection')) { + emailProtection = _json['emailProtection'] as core.bool; + } + if (_json.containsKey('ocspSigning')) { + ocspSigning = _json['ocspSigning'] as core.bool; + } + if (_json.containsKey('serverAuth')) { + serverAuth = _json['serverAuth'] as core.bool; + } + if (_json.containsKey('timeStamping')) { + timeStamping = _json['timeStamping'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (clientAuth != null) { + _json['clientAuth'] = clientAuth; + } + if (codeSigning != null) { + _json['codeSigning'] = codeSigning; + } + if (emailProtection != null) { + _json['emailProtection'] = emailProtection; + } + if (ocspSigning != null) { + _json['ocspSigning'] = ocspSigning; + } + if (serverAuth != null) { + _json['serverAuth'] = serverAuth; + } + if (timeStamping != null) { + _json['timeStamping'] = timeStamping; + } + return _json; + } +} + +/// Response message for +/// CertificateAuthorityService.FetchCertificateAuthorityCsr. +class FetchCertificateAuthorityCsrResponse { + /// The PEM-encoded signed certificate signing request (CSR). + /// + /// Output only. + core.String pemCsr; + + FetchCertificateAuthorityCsrResponse(); + + FetchCertificateAuthorityCsrResponse.fromJson(core.Map _json) { + if (_json.containsKey('pemCsr')) { + pemCsr = _json['pemCsr'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pemCsr != null) { + _json['pemCsr'] = pemCsr; + } + return _json; + } +} + +/// The allowed types for \[VALUE\] in a `[KEY]:[VALUE]` attribute. +class GoogleApiServicecontrolV1AttributeValue { + /// A Boolean value represented by `true` or `false`. + core.bool boolValue; + + /// A 64-bit signed integer. + core.String intValue; + + /// A string up to 256 bytes long. + GoogleApiServicecontrolV1TruncatableString stringValue; + + GoogleApiServicecontrolV1AttributeValue(); + + GoogleApiServicecontrolV1AttributeValue.fromJson(core.Map _json) { + if (_json.containsKey('boolValue')) { + boolValue = _json['boolValue'] as core.bool; + } + if (_json.containsKey('intValue')) { + intValue = _json['intValue'] as core.String; + } + if (_json.containsKey('stringValue')) { + stringValue = GoogleApiServicecontrolV1TruncatableString.fromJson( + _json['stringValue'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boolValue != null) { + _json['boolValue'] = boolValue; + } + if (intValue != null) { + _json['intValue'] = intValue; + } + if (stringValue != null) { + _json['stringValue'] = stringValue.toJson(); + } + return _json; + } +} + +/// A set of attributes, each in the format `[KEY]:[VALUE]`. +class GoogleApiServicecontrolV1Attributes { + /// The set of attributes. + /// + /// Each attribute's key can be up to 128 bytes long. The value can be a + /// string up to 256 bytes, a signed 64-bit integer, or the Boolean values + /// `true` and `false`. For example: "/instance_id": "my-instance" + /// "/http/user_agent": "" "/http/request_bytes": 300 "abc.com/myattribute": + /// true + core.Map<core.String, GoogleApiServicecontrolV1AttributeValue> attributeMap; + + /// The number of attributes that were discarded. + /// + /// Attributes can be discarded because their keys are too long or because + /// there are too many attributes. If this value is 0 then all attributes are + /// valid. + core.int droppedAttributesCount; + + GoogleApiServicecontrolV1Attributes(); + + GoogleApiServicecontrolV1Attributes.fromJson(core.Map _json) { + if (_json.containsKey('attributeMap')) { + attributeMap = + (_json['attributeMap'] as core.Map).cast<core.String, core.Map>().map( + (key, item) => core.MapEntry( + key, + GoogleApiServicecontrolV1AttributeValue.fromJson( + item as core.Map<core.String, core.dynamic>), + ), + ); + } + if (_json.containsKey('droppedAttributesCount')) { + droppedAttributesCount = _json['droppedAttributesCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attributeMap != null) { + _json['attributeMap'] = + attributeMap.map((key, item) => core.MapEntry(key, item.toJson())); + } + if (droppedAttributesCount != null) { + _json['droppedAttributesCount'] = droppedAttributesCount; + } + return _json; + } +} + +/// Distribution represents a frequency distribution of double-valued sample +/// points. +/// +/// It contains the size of the population of sample points plus additional +/// optional information: - the arithmetic mean of the samples - the minimum and +/// maximum of the samples - the sum-squared-deviation of the samples, used to +/// compute variance - a histogram of the values of the sample points +class GoogleApiServicecontrolV1Distribution { + /// The number of samples in each histogram bucket. + /// + /// \`bucket_counts\` are optional. If present, they must sum to the \`count\` + /// value. The buckets are defined below in \`bucket_option\`. There are N + /// buckets. \`bucket_counts\[0\]\` is the number of samples in the underflow + /// bucket. \`bucket_counts\[1\]\` to \`bucket_counts\[N-1\]\` are the numbers + /// of samples in each of the finite buckets. And \`bucket_counts\[N\] is the + /// number of samples in the overflow bucket. See the comments of + /// \`bucket_option\` below for more details. Any suffix of trailing zeros may + /// be omitted. + core.List<core.String> bucketCounts; + + /// The total number of samples in the distribution. + /// + /// Must be >= 0. + core.String count; + + /// Example points. + /// + /// Must be in increasing order of `value` field. + core.List<Exemplar> exemplars; + + /// Buckets with arbitrary user-provided width. + GoogleApiServicecontrolV1ExplicitBuckets explicitBuckets; + + /// Buckets with exponentially growing width. + GoogleApiServicecontrolV1ExponentialBuckets exponentialBuckets; + + /// Buckets with constant width. + GoogleApiServicecontrolV1LinearBuckets linearBuckets; + + /// The maximum of the population of values. + /// + /// Ignored if `count` is zero. + core.double maximum; + + /// The arithmetic mean of the samples in the distribution. + /// + /// If `count` is zero then this field must be zero. + core.double mean; + + /// The minimum of the population of values. + /// + /// Ignored if `count` is zero. + core.double minimum; + + /// The sum of squared deviations from the mean: Sum\[i=1..count\]((x_i - + /// mean)^2) where each x_i is a sample values. + /// + /// If `count` is zero then this field must be zero, otherwise validation of + /// the request fails. + core.double sumOfSquaredDeviation; + + GoogleApiServicecontrolV1Distribution(); + + GoogleApiServicecontrolV1Distribution.fromJson(core.Map _json) { + if (_json.containsKey('bucketCounts')) { + bucketCounts = (_json['bucketCounts'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('count')) { + count = _json['count'] as core.String; + } + if (_json.containsKey('exemplars')) { + exemplars = (_json['exemplars'] as core.List) + .map<Exemplar>((value) => + Exemplar.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('explicitBuckets')) { + explicitBuckets = GoogleApiServicecontrolV1ExplicitBuckets.fromJson( + _json['explicitBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('exponentialBuckets')) { + exponentialBuckets = GoogleApiServicecontrolV1ExponentialBuckets.fromJson( + _json['exponentialBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('linearBuckets')) { + linearBuckets = GoogleApiServicecontrolV1LinearBuckets.fromJson( + _json['linearBuckets'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('maximum')) { + maximum = (_json['maximum'] as core.num).toDouble(); + } + if (_json.containsKey('mean')) { + mean = (_json['mean'] as core.num).toDouble(); + } + if (_json.containsKey('minimum')) { + minimum = (_json['minimum'] as core.num).toDouble(); + } + if (_json.containsKey('sumOfSquaredDeviation')) { + sumOfSquaredDeviation = + (_json['sumOfSquaredDeviation'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bucketCounts != null) { + _json['bucketCounts'] = bucketCounts; + } + if (count != null) { + _json['count'] = count; + } + if (exemplars != null) { + _json['exemplars'] = exemplars.map((value) => value.toJson()).toList(); + } + if (explicitBuckets != null) { + _json['explicitBuckets'] = explicitBuckets.toJson(); + } + if (exponentialBuckets != null) { + _json['exponentialBuckets'] = exponentialBuckets.toJson(); + } + if (linearBuckets != null) { + _json['linearBuckets'] = linearBuckets.toJson(); + } + if (maximum != null) { + _json['maximum'] = maximum; + } + if (mean != null) { + _json['mean'] = mean; + } + if (minimum != null) { + _json['minimum'] = minimum; + } + if (sumOfSquaredDeviation != null) { + _json['sumOfSquaredDeviation'] = sumOfSquaredDeviation; + } + return _json; + } +} + +/// Describing buckets with arbitrary user-provided width. +class GoogleApiServicecontrolV1ExplicitBuckets { + /// 'bound' is a list of strictly increasing boundaries between buckets. + /// + /// Note that a list of length N-1 defines N buckets because of fenceposting. + /// See comments on `bucket_options` for details. The i'th finite bucket + /// covers the interval \[bound\[i-1\], bound\[i\]) where i ranges from 1 to + /// bound_size() - 1. Note that there are no finite buckets at all if 'bound' + /// only contains a single element; in that special case the single bound + /// defines the boundary between the underflow and overflow buckets. bucket + /// number lower bound upper bound i == 0 (underflow) -inf bound\[i\] 0 < i < + /// bound_size() bound\[i-1\] bound\[i\] i == bound_size() (overflow) + /// bound\[i-1\] +inf + core.List<core.double> bounds; + + GoogleApiServicecontrolV1ExplicitBuckets(); + + GoogleApiServicecontrolV1ExplicitBuckets.fromJson(core.Map _json) { + if (_json.containsKey('bounds')) { + bounds = (_json['bounds'] as core.List) + .map<core.double>((value) => (value as core.num).toDouble()) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bounds != null) { + _json['bounds'] = bounds; + } + return _json; + } +} + +/// Describing buckets with exponentially growing width. +class GoogleApiServicecontrolV1ExponentialBuckets { + /// The i'th exponential bucket covers the interval \[scale * + /// growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + /// num_finite_buckets inclusive. + /// + /// Must be larger than 1.0. + core.double growthFactor; + + /// The number of finite buckets. + /// + /// With the underflow and overflow buckets, the total number of buckets is + /// `num_finite_buckets` + 2. See comments on `bucket_options` for details. + core.int numFiniteBuckets; + + /// The i'th exponential bucket covers the interval \[scale * + /// growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + /// num_finite_buckets inclusive. + /// + /// Must be > 0. + core.double scale; + + GoogleApiServicecontrolV1ExponentialBuckets(); + + GoogleApiServicecontrolV1ExponentialBuckets.fromJson(core.Map _json) { + if (_json.containsKey('growthFactor')) { + growthFactor = (_json['growthFactor'] as core.num).toDouble(); + } + if (_json.containsKey('numFiniteBuckets')) { + numFiniteBuckets = _json['numFiniteBuckets'] as core.int; + } + if (_json.containsKey('scale')) { + scale = (_json['scale'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (growthFactor != null) { + _json['growthFactor'] = growthFactor; + } + if (numFiniteBuckets != null) { + _json['numFiniteBuckets'] = numFiniteBuckets; + } + if (scale != null) { + _json['scale'] = scale; + } + return _json; + } +} + +/// A common proto for logging HTTP requests. +/// +/// Only contains semantics defined by the HTTP specification. Product-specific +/// logging information MUST be defined in a separate message. +class GoogleApiServicecontrolV1HttpRequest { + /// The number of HTTP response bytes inserted into cache. + /// + /// Set only when a cache fill was attempted. + core.String cacheFillBytes; + + /// Whether or not an entity was served from cache (with or without + /// validation). + core.bool cacheHit; + + /// Whether or not a cache lookup was attempted. + core.bool cacheLookup; + + /// Whether or not the response was validated with the origin server before + /// being served from cache. + /// + /// This field is only meaningful if `cache_hit` is True. + core.bool cacheValidatedWithOriginServer; + + /// The request processing latency on the server, from the time the request + /// was received until the response was sent. + core.String latency; + + /// Protocol used for the request. + /// + /// Examples: "HTTP/1.1", "HTTP/2", "websocket" + core.String protocol; + + /// The referer URL of the request, as defined in + /// [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + core.String referer; + + /// The IP address (IPv4 or IPv6) of the client that issued the HTTP request. + /// + /// Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + core.String remoteIp; + + /// The request method. + /// + /// Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + core.String requestMethod; + + /// The size of the HTTP request message in bytes, including the request + /// headers and the request body. + core.String requestSize; + + /// The scheme (http, https), the host name, the path, and the query portion + /// of the URL that was requested. + /// + /// Example: `"http://example.com/some/info?color=red"`. + core.String requestUrl; + + /// The size of the HTTP response message sent back to the client, in bytes, + /// including the response headers and the response body. + core.String responseSize; + + /// The IP address (IPv4 or IPv6) of the origin server that the request was + /// sent to. + core.String serverIp; + + /// The response code indicating the status of the response. + /// + /// Examples: 200, 404. + core.int status; + + /// The user agent sent by the client. + /// + /// Example: `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + /// CLR 1.0.3705)"`. + core.String userAgent; + + GoogleApiServicecontrolV1HttpRequest(); + + GoogleApiServicecontrolV1HttpRequest.fromJson(core.Map _json) { + if (_json.containsKey('cacheFillBytes')) { + cacheFillBytes = _json['cacheFillBytes'] as core.String; + } + if (_json.containsKey('cacheHit')) { + cacheHit = _json['cacheHit'] as core.bool; + } + if (_json.containsKey('cacheLookup')) { + cacheLookup = _json['cacheLookup'] as core.bool; + } + if (_json.containsKey('cacheValidatedWithOriginServer')) { + cacheValidatedWithOriginServer = + _json['cacheValidatedWithOriginServer'] as core.bool; + } + if (_json.containsKey('latency')) { + latency = _json['latency'] as core.String; + } + if (_json.containsKey('protocol')) { + protocol = _json['protocol'] as core.String; + } + if (_json.containsKey('referer')) { + referer = _json['referer'] as core.String; + } + if (_json.containsKey('remoteIp')) { + remoteIp = _json['remoteIp'] as core.String; + } + if (_json.containsKey('requestMethod')) { + requestMethod = _json['requestMethod'] as core.String; + } + if (_json.containsKey('requestSize')) { + requestSize = _json['requestSize'] as core.String; + } + if (_json.containsKey('requestUrl')) { + requestUrl = _json['requestUrl'] as core.String; + } + if (_json.containsKey('responseSize')) { + responseSize = _json['responseSize'] as core.String; + } + if (_json.containsKey('serverIp')) { + serverIp = _json['serverIp'] as core.String; + } + if (_json.containsKey('status')) { + status = _json['status'] as core.int; + } + if (_json.containsKey('userAgent')) { + userAgent = _json['userAgent'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cacheFillBytes != null) { + _json['cacheFillBytes'] = cacheFillBytes; + } + if (cacheHit != null) { + _json['cacheHit'] = cacheHit; + } + if (cacheLookup != null) { + _json['cacheLookup'] = cacheLookup; + } + if (cacheValidatedWithOriginServer != null) { + _json['cacheValidatedWithOriginServer'] = cacheValidatedWithOriginServer; + } + if (latency != null) { + _json['latency'] = latency; + } + if (protocol != null) { + _json['protocol'] = protocol; + } + if (referer != null) { + _json['referer'] = referer; + } + if (remoteIp != null) { + _json['remoteIp'] = remoteIp; + } + if (requestMethod != null) { + _json['requestMethod'] = requestMethod; + } + if (requestSize != null) { + _json['requestSize'] = requestSize; + } + if (requestUrl != null) { + _json['requestUrl'] = requestUrl; + } + if (responseSize != null) { + _json['responseSize'] = responseSize; + } + if (serverIp != null) { + _json['serverIp'] = serverIp; + } + if (status != null) { + _json['status'] = status; + } + if (userAgent != null) { + _json['userAgent'] = userAgent; + } + return _json; + } +} + +/// Describing buckets with constant width. +class GoogleApiServicecontrolV1LinearBuckets { + /// The number of finite buckets. + /// + /// With the underflow and overflow buckets, the total number of buckets is + /// `num_finite_buckets` + 2. See comments on `bucket_options` for details. + core.int numFiniteBuckets; + + /// The i'th linear bucket covers the interval \[offset + (i-1) * width, + /// offset + i * width) where i ranges from 1 to num_finite_buckets, + /// inclusive. + core.double offset; + + /// The i'th linear bucket covers the interval \[offset + (i-1) * width, + /// offset + i * width) where i ranges from 1 to num_finite_buckets, + /// inclusive. + /// + /// Must be strictly positive. + core.double width; + + GoogleApiServicecontrolV1LinearBuckets(); + + GoogleApiServicecontrolV1LinearBuckets.fromJson(core.Map _json) { + if (_json.containsKey('numFiniteBuckets')) { + numFiniteBuckets = _json['numFiniteBuckets'] as core.int; + } + if (_json.containsKey('offset')) { + offset = (_json['offset'] as core.num).toDouble(); + } + if (_json.containsKey('width')) { + width = (_json['width'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (numFiniteBuckets != null) { + _json['numFiniteBuckets'] = numFiniteBuckets; + } + if (offset != null) { + _json['offset'] = offset; + } + if (width != null) { + _json['width'] = width; + } + return _json; + } +} + +/// An individual log entry. +class GoogleApiServicecontrolV1LogEntry { + /// Information about the HTTP request associated with this log entry, if + /// applicable. + /// + /// Optional. + GoogleApiServicecontrolV1HttpRequest httpRequest; + + /// A unique ID for the log entry used for deduplication. + /// + /// If omitted, the implementation will generate one based on operation_id. + core.String insertId; + + /// A set of user-defined (key, value) data that provides additional + /// information about the log entry. + core.Map<core.String, core.String> labels; + + /// The log to which this log entry belongs. + /// + /// Examples: `"syslog"`, `"book_log"`. + /// + /// Required. + core.String name; + + /// Information about an operation associated with the log entry, if + /// applicable. + /// + /// Optional. + GoogleApiServicecontrolV1LogEntryOperation operation; + + /// The log entry payload, represented as a protocol buffer that is expressed + /// as a JSON object. + /// + /// The only accepted type currently is AuditLog. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> protoPayload; + + /// The severity of the log entry. + /// + /// The default value is `LogSeverity.DEFAULT`. + /// Possible string values are: + /// - "DEFAULT" : (0) The log entry has no assigned severity level. + /// - "DEBUG" : (100) Debug or trace information. + /// - "INFO" : (200) Routine information, such as ongoing status or + /// performance. + /// - "NOTICE" : (300) Normal but significant events, such as start up, shut + /// down, or a configuration change. + /// - "WARNING" : (400) Warning events might cause problems. + /// - "ERROR" : (500) Error events are likely to cause problems. + /// - "CRITICAL" : (600) Critical events cause more severe problems or + /// outages. + /// - "ALERT" : (700) A person must take an action immediately. + /// - "EMERGENCY" : (800) One or more systems are unusable. + core.String severity; + + /// Source code location information associated with the log entry, if any. + /// + /// Optional. + GoogleApiServicecontrolV1LogEntrySourceLocation sourceLocation; + + /// The log entry payload, represented as a structure that is expressed as a + /// JSON object. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> structPayload; + + /// The log entry payload, represented as a Unicode string (UTF-8). + core.String textPayload; + + /// The time the event described by the log entry occurred. + /// + /// If omitted, defaults to operation start time. + core.String timestamp; + + /// Resource name of the trace associated with the log entry, if any. + /// + /// If this field contains a relative resource name, you can assume the name + /// is relative to `//tracing.googleapis.com`. Example: + /// `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + /// + /// Optional. + core.String trace; + + GoogleApiServicecontrolV1LogEntry(); + + GoogleApiServicecontrolV1LogEntry.fromJson(core.Map _json) { + if (_json.containsKey('httpRequest')) { + httpRequest = GoogleApiServicecontrolV1HttpRequest.fromJson( + _json['httpRequest'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('insertId')) { + insertId = _json['insertId'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('operation')) { + operation = GoogleApiServicecontrolV1LogEntryOperation.fromJson( + _json['operation'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('protoPayload')) { + protoPayload = (_json['protoPayload'] as core.Map) + .cast<core.String, core.Object>() + .map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('severity')) { + severity = _json['severity'] as core.String; + } + if (_json.containsKey('sourceLocation')) { + sourceLocation = GoogleApiServicecontrolV1LogEntrySourceLocation.fromJson( + _json['sourceLocation'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('structPayload')) { + structPayload = (_json['structPayload'] as core.Map) + .cast<core.String, core.Object>() + .map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('textPayload')) { + textPayload = _json['textPayload'] as core.String; + } + if (_json.containsKey('timestamp')) { + timestamp = _json['timestamp'] as core.String; + } + if (_json.containsKey('trace')) { + trace = _json['trace'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (httpRequest != null) { + _json['httpRequest'] = httpRequest.toJson(); + } + if (insertId != null) { + _json['insertId'] = insertId; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (operation != null) { + _json['operation'] = operation.toJson(); + } + if (protoPayload != null) { + _json['protoPayload'] = protoPayload; + } + if (severity != null) { + _json['severity'] = severity; + } + if (sourceLocation != null) { + _json['sourceLocation'] = sourceLocation.toJson(); + } + if (structPayload != null) { + _json['structPayload'] = structPayload; + } + if (textPayload != null) { + _json['textPayload'] = textPayload; + } + if (timestamp != null) { + _json['timestamp'] = timestamp; + } + if (trace != null) { + _json['trace'] = trace; + } + return _json; + } +} + +/// Additional information about a potentially long-running operation with which +/// a log entry is associated. +class GoogleApiServicecontrolV1LogEntryOperation { + /// Set this to True if this is the first log entry in the operation. + /// + /// Optional. + core.bool first; + + /// An arbitrary operation identifier. + /// + /// Log entries with the same identifier are assumed to be part of the same + /// operation. + /// + /// Optional. + core.String id; + + /// Set this to True if this is the last log entry in the operation. + /// + /// Optional. + core.bool last; + + /// An arbitrary producer identifier. + /// + /// The combination of `id` and `producer` must be globally unique. Examples + /// for `producer`: `"MyDivision.MyBigCompany.com"`, + /// `"github.com/MyProject/MyApplication"`. + /// + /// Optional. + core.String producer; + + GoogleApiServicecontrolV1LogEntryOperation(); + + GoogleApiServicecontrolV1LogEntryOperation.fromJson(core.Map _json) { + if (_json.containsKey('first')) { + first = _json['first'] as core.bool; + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('last')) { + last = _json['last'] as core.bool; + } + if (_json.containsKey('producer')) { + producer = _json['producer'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (first != null) { + _json['first'] = first; + } + if (id != null) { + _json['id'] = id; + } + if (last != null) { + _json['last'] = last; + } + if (producer != null) { + _json['producer'] = producer; + } + return _json; + } +} + +/// Additional information about the source code location that produced the log +/// entry. +class GoogleApiServicecontrolV1LogEntrySourceLocation { + /// Source file name. + /// + /// Depending on the runtime environment, this might be a simple name or a + /// fully-qualified name. + /// + /// Optional. + core.String file; + + /// Human-readable name of the function or method being invoked, with optional + /// context such as the class or package name. + /// + /// This information may be used in contexts such as the logs viewer, where a + /// file and line number are less meaningful. The format can vary by language. + /// For example: `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), + /// `function` (Python). + /// + /// Optional. + core.String function; + + /// Line within the source file. + /// + /// 1-based; 0 indicates no line number available. + /// + /// Optional. + core.String line; + + GoogleApiServicecontrolV1LogEntrySourceLocation(); + + GoogleApiServicecontrolV1LogEntrySourceLocation.fromJson(core.Map _json) { + if (_json.containsKey('file')) { + file = _json['file'] as core.String; + } + if (_json.containsKey('function')) { + function = _json['function'] as core.String; + } + if (_json.containsKey('line')) { + line = _json['line'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (file != null) { + _json['file'] = file; + } + if (function != null) { + _json['function'] = function; + } + if (line != null) { + _json['line'] = line; + } + return _json; + } +} + +/// Represents a single metric value. +class GoogleApiServicecontrolV1MetricValue { + /// A boolean value. + core.bool boolValue; + + /// A distribution value. + GoogleApiServicecontrolV1Distribution distributionValue; + + /// A double precision floating point value. + core.double doubleValue; + + /// The end of the time period over which this metric value's measurement + /// applies. + /// + /// If not specified, google.api.servicecontrol.v1.Operation.end_time will be + /// used. + core.String endTime; + + /// A signed 64-bit integer value. + core.String int64Value; + + /// The labels describing the metric value. + /// + /// See comments on google.api.servicecontrol.v1.Operation.labels for the + /// overriding relationship. Note that this map must not contain monitored + /// resource labels. + core.Map<core.String, core.String> labels; + + /// A money value. + Money moneyValue; + + /// The start of the time period over which this metric value's measurement + /// applies. + /// + /// The time period has different semantics for different metric types + /// (cumulative, delta, and gauge). See the metric definition documentation in + /// the service configuration for details. If not specified, + /// google.api.servicecontrol.v1.Operation.start_time will be used. + core.String startTime; + + /// A text string value. + core.String stringValue; + + GoogleApiServicecontrolV1MetricValue(); + + GoogleApiServicecontrolV1MetricValue.fromJson(core.Map _json) { + if (_json.containsKey('boolValue')) { + boolValue = _json['boolValue'] as core.bool; + } + if (_json.containsKey('distributionValue')) { + distributionValue = GoogleApiServicecontrolV1Distribution.fromJson( + _json['distributionValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('doubleValue')) { + doubleValue = (_json['doubleValue'] as core.num).toDouble(); + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('int64Value')) { + int64Value = _json['int64Value'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('moneyValue')) { + moneyValue = Money.fromJson( + _json['moneyValue'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('stringValue')) { + stringValue = _json['stringValue'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (boolValue != null) { + _json['boolValue'] = boolValue; + } + if (distributionValue != null) { + _json['distributionValue'] = distributionValue.toJson(); + } + if (doubleValue != null) { + _json['doubleValue'] = doubleValue; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (int64Value != null) { + _json['int64Value'] = int64Value; + } + if (labels != null) { + _json['labels'] = labels; + } + if (moneyValue != null) { + _json['moneyValue'] = moneyValue.toJson(); + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (stringValue != null) { + _json['stringValue'] = stringValue; + } + return _json; + } +} + +/// Represents a set of metric values in the same metric. +/// +/// Each metric value in the set should have a unique combination of start time, +/// end time, and label values. +class GoogleApiServicecontrolV1MetricValueSet { + /// The metric name defined in the service configuration. + core.String metricName; + + /// The values in this metric. + core.List<GoogleApiServicecontrolV1MetricValue> metricValues; + + GoogleApiServicecontrolV1MetricValueSet(); + + GoogleApiServicecontrolV1MetricValueSet.fromJson(core.Map _json) { + if (_json.containsKey('metricName')) { + metricName = _json['metricName'] as core.String; + } + if (_json.containsKey('metricValues')) { + metricValues = (_json['metricValues'] as core.List) + .map<GoogleApiServicecontrolV1MetricValue>((value) => + GoogleApiServicecontrolV1MetricValue.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (metricName != null) { + _json['metricName'] = metricName; + } + if (metricValues != null) { + _json['metricValues'] = + metricValues.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Represents information regarding an operation. +class GoogleApiServicecontrolV1Operation { + /// Identity of the consumer who is using the service. + /// + /// This field should be filled in for the operations initiated by a consumer, + /// but not for service-initiated operations that are not related to a + /// specific consumer. - This can be in one of the following formats: - + /// project:PROJECT_ID, - project`_`number:PROJECT_NUMBER, - + /// projects/PROJECT_ID or PROJECT_NUMBER, - folders/FOLDER_NUMBER, - + /// organizations/ORGANIZATION_NUMBER, - api`_`key:API_KEY. + core.String consumerId; + + /// End time of the operation. + /// + /// Required when the operation is used in ServiceController.Report, but + /// optional when the operation is used in ServiceController.Check. + core.String endTime; + + /// Unimplemented. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> extensions; + + /// DO NOT USE. + /// + /// This is an experimental field. + /// Possible string values are: + /// - "LOW" : Allows data caching, batching, and aggregation. It provides + /// higher performance with higher data loss risk. + /// - "HIGH" : Disables data aggregation to minimize data loss. It is for + /// operations that contains significant monetary value or audit trail. This + /// feature only applies to the client libraries. + /// - "DEBUG" : Deprecated. Do not use. Disables data aggregation and enables + /// additional validation logic. It should only be used during the onboarding + /// process. It is only available to Google internal services, and the service + /// must be approved by chemist-dev@google.com in order to use this level. + core.String importance; + + /// Labels describing the operation. + /// + /// Only the following labels are allowed: - Labels describing monitored + /// resources as defined in the service configuration. - Default labels of + /// metric values. When specified, labels defined in the metric value override + /// these default. - The following labels defined by Google Cloud Platform: - + /// `cloud.googleapis.com/location` describing the location where the + /// operation happened, - `servicecontrol.googleapis.com/user_agent` + /// describing the user agent of the API request, - + /// `servicecontrol.googleapis.com/service_agent` describing the service used + /// to handle the API request (e.g. ESP), - + /// `servicecontrol.googleapis.com/platform` describing the platform where the + /// API is served, such as App Engine, Compute Engine, or Kubernetes Engine. + core.Map<core.String, core.String> labels; + + /// Represents information to be logged. + core.List<GoogleApiServicecontrolV1LogEntry> logEntries; + + /// Represents information about this operation. + /// + /// Each MetricValueSet corresponds to a metric defined in the service + /// configuration. The data type used in the MetricValueSet must agree with + /// the data type specified in the metric definition. Within a single + /// operation, it is not allowed to have more than one MetricValue instances + /// that have the same metric names and identical label value combinations. If + /// a request has such duplicated MetricValue instances, the entire request is + /// rejected with an invalid argument error. + core.List<GoogleApiServicecontrolV1MetricValueSet> metricValueSets; + + /// Identity of the operation. + /// + /// This must be unique within the scope of the service that generated the + /// operation. If the service calls Check() and Report() on the same + /// operation, the two calls should carry the same id. UUID version 4 is + /// recommended, though not required. In scenarios where an operation is + /// computed from existing information and an idempotent id is desirable for + /// deduplication purpose, UUID version 5 is recommended. See RFC 4122 for + /// details. + core.String operationId; + + /// Fully qualified name of the operation. + /// + /// Reserved for future use. + core.String operationName; + + /// Represents the properties needed for quota check. + /// + /// Applicable only if this operation is for a quota check request. If this is + /// not specified, no quota check will be performed. + GoogleApiServicecontrolV1QuotaProperties quotaProperties; + + /// The resources that are involved in the operation. + /// + /// The maximum supported number of entries in this field is 100. + core.List<GoogleApiServicecontrolV1ResourceInfo> resources; + + /// Start time of the operation. + /// + /// Required. + core.String startTime; + + /// A list of Cloud Trace spans. + /// + /// The span names shall contain the id of the destination project which can + /// be either the produce or the consumer project. + /// + /// Unimplemented. + core.List<GoogleApiServicecontrolV1TraceSpan> traceSpans; + + /// Private Preview. + /// + /// This feature is only available for approved services. User defined labels + /// for the resource that this operation is associated with. Only a + /// combination of 1000 user labels per consumer project are allowed. + core.Map<core.String, core.String> userLabels; + + GoogleApiServicecontrolV1Operation(); + + GoogleApiServicecontrolV1Operation.fromJson(core.Map _json) { + if (_json.containsKey('consumerId')) { + consumerId = _json['consumerId'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('extensions')) { + extensions = (_json['extensions'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('importance')) { + importance = _json['importance'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('logEntries')) { + logEntries = (_json['logEntries'] as core.List) + .map<GoogleApiServicecontrolV1LogEntry>((value) => + GoogleApiServicecontrolV1LogEntry.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('metricValueSets')) { + metricValueSets = (_json['metricValueSets'] as core.List) + .map<GoogleApiServicecontrolV1MetricValueSet>((value) => + GoogleApiServicecontrolV1MetricValueSet.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('operationId')) { + operationId = _json['operationId'] as core.String; + } + if (_json.containsKey('operationName')) { + operationName = _json['operationName'] as core.String; + } + if (_json.containsKey('quotaProperties')) { + quotaProperties = GoogleApiServicecontrolV1QuotaProperties.fromJson( + _json['quotaProperties'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('resources')) { + resources = (_json['resources'] as core.List) + .map<GoogleApiServicecontrolV1ResourceInfo>((value) => + GoogleApiServicecontrolV1ResourceInfo.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('traceSpans')) { + traceSpans = (_json['traceSpans'] as core.List) + .map<GoogleApiServicecontrolV1TraceSpan>((value) => + GoogleApiServicecontrolV1TraceSpan.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('userLabels')) { + userLabels = (_json['userLabels'] as core.Map) + .cast<core.String, core.String>() + .map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (consumerId != null) { + _json['consumerId'] = consumerId; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (extensions != null) { + _json['extensions'] = extensions; + } + if (importance != null) { + _json['importance'] = importance; + } + if (labels != null) { + _json['labels'] = labels; + } + if (logEntries != null) { + _json['logEntries'] = logEntries.map((value) => value.toJson()).toList(); + } + if (metricValueSets != null) { + _json['metricValueSets'] = + metricValueSets.map((value) => value.toJson()).toList(); + } + if (operationId != null) { + _json['operationId'] = operationId; + } + if (operationName != null) { + _json['operationName'] = operationName; + } + if (quotaProperties != null) { + _json['quotaProperties'] = quotaProperties.toJson(); + } + if (resources != null) { + _json['resources'] = resources.map((value) => value.toJson()).toList(); + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (traceSpans != null) { + _json['traceSpans'] = traceSpans.map((value) => value.toJson()).toList(); + } + if (userLabels != null) { + _json['userLabels'] = userLabels; + } + return _json; + } +} + +/// Represents the properties needed for quota operations. +class GoogleApiServicecontrolV1QuotaProperties { + /// Quota mode for this operation. + /// Possible string values are: + /// - "ACQUIRE" : Decreases available quota by the cost specified for the + /// operation. If cost is higher than available quota, operation fails and + /// returns error. + /// - "ACQUIRE_BEST_EFFORT" : Decreases available quota by the cost specified + /// for the operation. If cost is higher than available quota, operation does + /// not fail and available quota goes down to zero but it returns error. + /// - "CHECK" : Does not change any available quota. Only checks if there is + /// enough quota. No lock is placed on the checked tokens neither. + /// - "RELEASE" : Increases available quota by the operation cost specified + /// for the operation. + core.String quotaMode; + + GoogleApiServicecontrolV1QuotaProperties(); + + GoogleApiServicecontrolV1QuotaProperties.fromJson(core.Map _json) { + if (_json.containsKey('quotaMode')) { + quotaMode = _json['quotaMode'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (quotaMode != null) { + _json['quotaMode'] = quotaMode; + } + return _json; + } +} + +/// Request message for the Report method. +class GoogleApiServicecontrolV1ReportRequest { + /// Operations to be reported. + /// + /// Typically the service should report one operation per request. Putting + /// multiple operations into a single request is allowed, but should be used + /// only when multiple operations are natually available at the time of the + /// report. There is no limit on the number of operations in the same + /// ReportRequest, however the ReportRequest size should be no larger than + /// 1MB. See ReportResponse.report_errors for partial failure behavior. + core.List<GoogleApiServicecontrolV1Operation> operations; + + /// Specifies which version of service config should be used to process the + /// request. + /// + /// If unspecified or no matching version can be found, the latest one will be + /// used. + core.String serviceConfigId; + + /// The service name as specified in its service configuration. + /// + /// For example, `"pubsub.googleapis.com"`. See + /// [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + /// for the definition of a service name. + core.String serviceName; + + GoogleApiServicecontrolV1ReportRequest(); + + GoogleApiServicecontrolV1ReportRequest.fromJson(core.Map _json) { + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<GoogleApiServicecontrolV1Operation>((value) => + GoogleApiServicecontrolV1Operation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('serviceConfigId')) { + serviceConfigId = _json['serviceConfigId'] as core.String; + } + if (_json.containsKey('serviceName')) { + serviceName = _json['serviceName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + if (serviceConfigId != null) { + _json['serviceConfigId'] = serviceConfigId; + } + if (serviceName != null) { + _json['serviceName'] = serviceName; + } + return _json; + } +} + +/// Describes a resource associated with this operation. +class GoogleApiServicecontrolV1ResourceInfo { + /// The identifier of the parent of this resource instance. + /// + /// Must be in one of the following formats: - `projects/` - `folders/` - + /// `organizations/` + core.String resourceContainer; + + /// The location of the resource. + /// + /// If not empty, the resource will be checked against location policy. The + /// value must be a valid zone, region or multiregion. For example: + /// "europe-west4" or "northamerica-northeast1-a" + core.String resourceLocation; + + /// Name of the resource. + /// + /// This is used for auditing purposes. + core.String resourceName; + + GoogleApiServicecontrolV1ResourceInfo(); + + GoogleApiServicecontrolV1ResourceInfo.fromJson(core.Map _json) { + if (_json.containsKey('resourceContainer')) { + resourceContainer = _json['resourceContainer'] as core.String; + } + if (_json.containsKey('resourceLocation')) { + resourceLocation = _json['resourceLocation'] as core.String; + } + if (_json.containsKey('resourceName')) { + resourceName = _json['resourceName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (resourceContainer != null) { + _json['resourceContainer'] = resourceContainer; + } + if (resourceLocation != null) { + _json['resourceLocation'] = resourceLocation; + } + if (resourceName != null) { + _json['resourceName'] = resourceName; + } + return _json; + } +} + +/// A span represents a single operation within a trace. +/// +/// Spans can be nested to form a trace tree. Often, a trace contains a root +/// span that describes the end-to-end latency, and one or more subspans for its +/// sub-operations. A trace can also contain multiple root spans, or none at +/// all. Spans do not need to be contiguous—there may be gaps or overlaps +/// between spans in a trace. +class GoogleApiServicecontrolV1TraceSpan { + /// A set of attributes on the span. + /// + /// You can have up to 32 attributes per span. + GoogleApiServicecontrolV1Attributes attributes; + + /// An optional number of child spans that were generated while this span was + /// active. + /// + /// If set, allows implementation to detect missing child spans. + core.int childSpanCount; + + /// A description of the span's operation (up to 128 bytes). + /// + /// Stackdriver Trace displays the description in the Google Cloud Platform + /// Console. For example, the display name can be a qualified method name or a + /// file name and a line number where the operation is called. A best practice + /// is to use the same display name within an application and at the same call + /// point. This makes it easier to correlate spans in different traces. + GoogleApiServicecontrolV1TruncatableString displayName; + + /// The end time of the span. + /// + /// On the client side, this is the time kept by the local machine where the + /// span execution ends. On the server side, this is the time when the server + /// application handler stops running. + core.String endTime; + + /// The resource name of the span in the following format: + /// projects/\[PROJECT_ID\]/traces/\[TRACE_ID\]/spans/SPAN_ID is a unique + /// identifier for a trace within a project; it is a 32-character hexadecimal + /// encoding of a 16-byte array. + /// + /// \[SPAN_ID\] is a unique identifier for a span within a trace; it is a + /// 16-character hexadecimal encoding of an 8-byte array. + core.String name; + + /// The \[SPAN_ID\] of this span's parent span. + /// + /// If this is a root span, then this field must be empty. + core.String parentSpanId; + + /// (Optional) Set this parameter to indicate whether this span is in the same + /// process as its parent. + /// + /// If you do not set this parameter, Stackdriver Trace is unable to take + /// advantage of this helpful information. + core.bool sameProcessAsParentSpan; + + /// The \[SPAN_ID\] portion of the span's resource name. + core.String spanId; + + /// Distinguishes between spans generated in a particular context. + /// + /// For example, two spans with the same name may be distinguished using + /// `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. + /// Possible string values are: + /// - "SPAN_KIND_UNSPECIFIED" : Unspecified. Do NOT use as default. + /// Implementations MAY assume SpanKind.INTERNAL to be default. + /// - "INTERNAL" : Indicates that the span is used internally. Default value. + /// - "SERVER" : Indicates that the span covers server-side handling of an RPC + /// or other remote network request. + /// - "CLIENT" : Indicates that the span covers the client-side wrapper around + /// an RPC or other remote request. + /// - "PRODUCER" : Indicates that the span describes producer sending a + /// message to a broker. Unlike client and server, there is no direct critical + /// path latency relationship between producer and consumer spans (e.g. + /// publishing a message to a pubsub service). + /// - "CONSUMER" : Indicates that the span describes consumer receiving a + /// message from a broker. Unlike client and server, there is no direct + /// critical path latency relationship between producer and consumer spans + /// (e.g. receiving a message from a pubsub service subscription). + core.String spanKind; + + /// The start time of the span. + /// + /// On the client side, this is the time kept by the local machine where the + /// span execution starts. On the server side, this is the time when the + /// server's application handler starts running. + core.String startTime; + + /// An optional final status for this span. + Status status; + + GoogleApiServicecontrolV1TraceSpan(); + + GoogleApiServicecontrolV1TraceSpan.fromJson(core.Map _json) { + if (_json.containsKey('attributes')) { + attributes = GoogleApiServicecontrolV1Attributes.fromJson( + _json['attributes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('childSpanCount')) { + childSpanCount = _json['childSpanCount'] as core.int; + } + if (_json.containsKey('displayName')) { + displayName = GoogleApiServicecontrolV1TruncatableString.fromJson( + _json['displayName'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('parentSpanId')) { + parentSpanId = _json['parentSpanId'] as core.String; + } + if (_json.containsKey('sameProcessAsParentSpan')) { + sameProcessAsParentSpan = _json['sameProcessAsParentSpan'] as core.bool; + } + if (_json.containsKey('spanId')) { + spanId = _json['spanId'] as core.String; + } + if (_json.containsKey('spanKind')) { + spanKind = _json['spanKind'] as core.String; + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('status')) { + status = Status.fromJson( + _json['status'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (attributes != null) { + _json['attributes'] = attributes.toJson(); + } + if (childSpanCount != null) { + _json['childSpanCount'] = childSpanCount; + } + if (displayName != null) { + _json['displayName'] = displayName.toJson(); + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (name != null) { + _json['name'] = name; + } + if (parentSpanId != null) { + _json['parentSpanId'] = parentSpanId; + } + if (sameProcessAsParentSpan != null) { + _json['sameProcessAsParentSpan'] = sameProcessAsParentSpan; + } + if (spanId != null) { + _json['spanId'] = spanId; + } + if (spanKind != null) { + _json['spanKind'] = spanKind; + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (status != null) { + _json['status'] = status.toJson(); + } + return _json; + } +} + +/// Represents a string that might be shortened to a specified length. +class GoogleApiServicecontrolV1TruncatableString { + /// The number of bytes removed from the original string. + /// + /// If this value is 0, then the string was not shortened. + core.int truncatedByteCount; + + /// The shortened string. + /// + /// For example, if the original string is 500 bytes long and the limit of the + /// string is 128 bytes, then `value` contains the first 128 bytes of the + /// 500-byte string. Truncation always happens on a UTF8 character boundary. + /// If there are multi-byte characters in the string, then the length of the + /// shortened string might be less than the size limit. + core.String value; + + GoogleApiServicecontrolV1TruncatableString(); + + GoogleApiServicecontrolV1TruncatableString.fromJson(core.Map _json) { + if (_json.containsKey('truncatedByteCount')) { + truncatedByteCount = _json['truncatedByteCount'] as core.int; + } + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (truncatedByteCount != null) { + _json['truncatedByteCount'] = truncatedByteCount; + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// IssuanceModes specifies the allowed ways in which Certificates may be +/// requested from this CertificateAuthority. +class IssuanceModes { + /// When true, allows callers to create Certificates by specifying a + /// CertificateConfig. + /// + /// Required. + core.bool allowConfigBasedIssuance; + + /// When true, allows callers to create Certificates by specifying a CSR. + /// + /// Required. + core.bool allowCsrBasedIssuance; + + IssuanceModes(); + + IssuanceModes.fromJson(core.Map _json) { + if (_json.containsKey('allowConfigBasedIssuance')) { + allowConfigBasedIssuance = _json['allowConfigBasedIssuance'] as core.bool; + } + if (_json.containsKey('allowCsrBasedIssuance')) { + allowCsrBasedIssuance = _json['allowCsrBasedIssuance'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowConfigBasedIssuance != null) { + _json['allowConfigBasedIssuance'] = allowConfigBasedIssuance; + } + if (allowCsrBasedIssuance != null) { + _json['allowCsrBasedIssuance'] = allowCsrBasedIssuance; + } + return _json; + } +} + +/// Options that affect all certificates issued by a CertificateAuthority. +class IssuingOptions { + /// When true, includes a URL to the issuing CA certificate in the "authority + /// information access" X.509 extension. + /// + /// Required. + core.bool includeCaCertUrl; + + /// When true, includes a URL to the CRL corresponding to certificates issued + /// from a CertificateAuthority. + /// + /// CRLs will expire 7 days from their creation. However, we will rebuild + /// daily. CRLs are also rebuilt shortly after a certificate is revoked. + /// + /// Required. + core.bool includeCrlAccessUrl; + + IssuingOptions(); + + IssuingOptions.fromJson(core.Map _json) { + if (_json.containsKey('includeCaCertUrl')) { + includeCaCertUrl = _json['includeCaCertUrl'] as core.bool; + } + if (_json.containsKey('includeCrlAccessUrl')) { + includeCrlAccessUrl = _json['includeCrlAccessUrl'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (includeCaCertUrl != null) { + _json['includeCaCertUrl'] = includeCaCertUrl; + } + if (includeCrlAccessUrl != null) { + _json['includeCrlAccessUrl'] = includeCrlAccessUrl; + } + return _json; + } +} + +/// A KeyId identifies a specific public key, usually by hashing the public key. +class KeyId { + /// The value of this KeyId encoded in lowercase hexadecimal. + /// + /// This is most likely the 160 bit SHA-1 hash of the public key. + /// + /// Optional. + core.String keyId; + + KeyId(); + + KeyId.fromJson(core.Map _json) { + if (_json.containsKey('keyId')) { + keyId = _json['keyId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (keyId != null) { + _json['keyId'] = keyId; + } + return _json; + } +} + +/// A KeyUsage describes key usage values that may appear in an X.509 +/// certificate. +class KeyUsage { + /// Describes high-level ways in which a key may be used. + KeyUsageOptions baseKeyUsage; + + /// Detailed scenarios in which a key may be used. + ExtendedKeyUsageOptions extendedKeyUsage; + + /// Used to describe extended key usages that are not listed in the + /// KeyUsage.ExtendedKeyUsageOptions message. + core.List<ObjectId> unknownExtendedKeyUsages; + + KeyUsage(); + + KeyUsage.fromJson(core.Map _json) { + if (_json.containsKey('baseKeyUsage')) { + baseKeyUsage = KeyUsageOptions.fromJson( + _json['baseKeyUsage'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('extendedKeyUsage')) { + extendedKeyUsage = ExtendedKeyUsageOptions.fromJson( + _json['extendedKeyUsage'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('unknownExtendedKeyUsages')) { + unknownExtendedKeyUsages = (_json['unknownExtendedKeyUsages'] + as core.List) + .map<ObjectId>((value) => + ObjectId.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (baseKeyUsage != null) { + _json['baseKeyUsage'] = baseKeyUsage.toJson(); + } + if (extendedKeyUsage != null) { + _json['extendedKeyUsage'] = extendedKeyUsage.toJson(); + } + if (unknownExtendedKeyUsages != null) { + _json['unknownExtendedKeyUsages'] = + unknownExtendedKeyUsages.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// KeyUsage.KeyUsageOptions corresponds to the key usage values described in +/// https://tools.ietf.org/html/rfc5280#section-4.2.1.3. +class KeyUsageOptions { + /// The key may be used to sign certificates. + core.bool certSign; + + /// The key may be used for cryptographic commitments. + /// + /// Note that this may also be referred to as "non-repudiation". + core.bool contentCommitment; + + /// The key may be used sign certificate revocation lists. + core.bool crlSign; + + /// The key may be used to encipher data. + core.bool dataEncipherment; + + /// The key may be used to decipher only. + core.bool decipherOnly; + + /// The key may be used for digital signatures. + core.bool digitalSignature; + + /// The key may be used to encipher only. + core.bool encipherOnly; + + /// The key may be used in a key agreement protocol. + core.bool keyAgreement; + + /// The key may be used to encipher other keys. + core.bool keyEncipherment; + + KeyUsageOptions(); + + KeyUsageOptions.fromJson(core.Map _json) { + if (_json.containsKey('certSign')) { + certSign = _json['certSign'] as core.bool; + } + if (_json.containsKey('contentCommitment')) { + contentCommitment = _json['contentCommitment'] as core.bool; + } + if (_json.containsKey('crlSign')) { + crlSign = _json['crlSign'] as core.bool; + } + if (_json.containsKey('dataEncipherment')) { + dataEncipherment = _json['dataEncipherment'] as core.bool; + } + if (_json.containsKey('decipherOnly')) { + decipherOnly = _json['decipherOnly'] as core.bool; + } + if (_json.containsKey('digitalSignature')) { + digitalSignature = _json['digitalSignature'] as core.bool; + } + if (_json.containsKey('encipherOnly')) { + encipherOnly = _json['encipherOnly'] as core.bool; + } + if (_json.containsKey('keyAgreement')) { + keyAgreement = _json['keyAgreement'] as core.bool; + } + if (_json.containsKey('keyEncipherment')) { + keyEncipherment = _json['keyEncipherment'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certSign != null) { + _json['certSign'] = certSign; + } + if (contentCommitment != null) { + _json['contentCommitment'] = contentCommitment; + } + if (crlSign != null) { + _json['crlSign'] = crlSign; + } + if (dataEncipherment != null) { + _json['dataEncipherment'] = dataEncipherment; + } + if (decipherOnly != null) { + _json['decipherOnly'] = decipherOnly; + } + if (digitalSignature != null) { + _json['digitalSignature'] = digitalSignature; + } + if (encipherOnly != null) { + _json['encipherOnly'] = encipherOnly; + } + if (keyAgreement != null) { + _json['keyAgreement'] = keyAgreement; + } + if (keyEncipherment != null) { + _json['keyEncipherment'] = keyEncipherment; + } + return _json; + } +} + +/// A Cloud KMS key configuration that a CertificateAuthority will use. +class KeyVersionSpec { + /// The algorithm to use for creating a managed Cloud KMS key for a for a + /// simplified experience. + /// + /// All managed keys will be have their ProtectionLevel as `HSM`. + /// + /// Required. + /// Possible string values are: + /// - "SIGN_HASH_ALGORITHM_UNSPECIFIED" : Not specified. + /// - "RSA_PSS_2048_SHA256" : maps to + /// CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256 + /// - "RSA_PSS_3072_SHA256" : maps to CryptoKeyVersionAlgorithm. + /// RSA_SIGN_PSS_3072_SHA256 + /// - "RSA_PSS_4096_SHA256" : maps to + /// CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256 + /// - "RSA_PKCS1_2048_SHA256" : maps to + /// CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256 + /// - "RSA_PKCS1_3072_SHA256" : maps to + /// CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256 + /// - "RSA_PKCS1_4096_SHA256" : maps to + /// CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256 + /// - "EC_P256_SHA256" : maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256 + /// - "EC_P384_SHA384" : maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384 + core.String algorithm; + + /// The resource name for an existing Cloud KMS CryptoKeyVersion in the format + /// `projects / * /locations / * /keyRings / * /cryptoKeys / * + /// /cryptoKeyVersions / * `. + /// + /// This option enables full flexibility in the key's capabilities and + /// properties. + /// + /// Required. + core.String cloudKmsKeyVersion; + + KeyVersionSpec(); + + KeyVersionSpec.fromJson(core.Map _json) { + if (_json.containsKey('algorithm')) { + algorithm = _json['algorithm'] as core.String; + } + if (_json.containsKey('cloudKmsKeyVersion')) { + cloudKmsKeyVersion = _json['cloudKmsKeyVersion'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (algorithm != null) { + _json['algorithm'] = algorithm; + } + if (cloudKmsKeyVersion != null) { + _json['cloudKmsKeyVersion'] = cloudKmsKeyVersion; + } + return _json; + } +} + +/// Response message for CertificateAuthorityService.ListCertificateAuthorities. +class ListCertificateAuthoritiesResponse { + /// The list of CertificateAuthorities. + core.List<CertificateAuthority> certificateAuthorities; + + /// A token to retrieve next page of results. + /// + /// Pass this value in ListCertificateAuthoritiesRequest.next_page_token to + /// retrieve the next page of results. + core.String nextPageToken; + + /// A list of locations (e.g. "us-west1") that could not be reached. + core.List<core.String> unreachable; + + ListCertificateAuthoritiesResponse(); + + ListCertificateAuthoritiesResponse.fromJson(core.Map _json) { + if (_json.containsKey('certificateAuthorities')) { + certificateAuthorities = (_json['certificateAuthorities'] as core.List) + .map<CertificateAuthority>((value) => CertificateAuthority.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificateAuthorities != null) { + _json['certificateAuthorities'] = + certificateAuthorities.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// Response message for +/// CertificateAuthorityService.ListCertificateRevocationLists. +class ListCertificateRevocationListsResponse { + /// The list of CertificateRevocationLists. + core.List<CertificateRevocationList> certificateRevocationLists; + + /// A token to retrieve next page of results. + /// + /// Pass this value in ListCertificateRevocationListsRequest.next_page_token + /// to retrieve the next page of results. + core.String nextPageToken; + + /// A list of locations (e.g. "us-west1") that could not be reached. + core.List<core.String> unreachable; + + ListCertificateRevocationListsResponse(); + + ListCertificateRevocationListsResponse.fromJson(core.Map _json) { + if (_json.containsKey('certificateRevocationLists')) { + certificateRevocationLists = + (_json['certificateRevocationLists'] as core.List) + .map<CertificateRevocationList>((value) => + CertificateRevocationList.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificateRevocationLists != null) { + _json['certificateRevocationLists'] = + certificateRevocationLists.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// Response message for CertificateAuthorityService.ListCertificates. +class ListCertificatesResponse { + /// The list of Certificates. + core.List<Certificate> certificates; + + /// A token to retrieve next page of results. + /// + /// Pass this value in ListCertificatesRequest.next_page_token to retrieve the + /// next page of results. + core.String nextPageToken; + + /// A list of locations (e.g. "us-west1") that could not be reached. + core.List<core.String> unreachable; + + ListCertificatesResponse(); + + ListCertificatesResponse.fromJson(core.Map _json) { + if (_json.containsKey('certificates')) { + certificates = (_json['certificates'] as core.List) + .map<Certificate>((value) => Certificate.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificates != null) { + _json['certificates'] = + certificates.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class ListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<Operation> operations; + + ListOperationsResponse(); + + ListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for CertificateAuthorityService.ListReusableConfigs. +class ListReusableConfigsResponse { + /// A token to retrieve next page of results. + /// + /// Pass this value in ListReusableConfigsRequest.next_page_token to retrieve + /// the next page of results. + core.String nextPageToken; + + /// The list of ReusableConfigs. + core.List<ReusableConfig> reusableConfigs; + + /// A list of locations (e.g. "us-west1") that could not be reached. + core.List<core.String> unreachable; + + ListReusableConfigsResponse(); + + ListReusableConfigsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('reusableConfigs')) { + reusableConfigs = (_json['reusableConfigs'] as core.List) + .map<ReusableConfig>((value) => ReusableConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (reusableConfigs != null) { + _json['reusableConfigs'] = + reusableConfigs.map((value) => value.toJson()).toList(); + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Represents an amount of money with its currency type. +class Money { + /// The three-letter currency code defined in ISO 4217. + core.String currencyCode; + + /// Number of nano (10^-9) units of the amount. + /// + /// The value must be between -999,999,999 and +999,999,999 inclusive. If + /// `units` is positive, `nanos` must be positive or zero. If `units` is zero, + /// `nanos` can be positive, zero, or negative. If `units` is negative, + /// `nanos` must be negative or zero. For example $-1.75 is represented as + /// `units`=-1 and `nanos`=-750,000,000. + core.int nanos; + + /// The whole units of the amount. + /// + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + core.String units; + + Money(); + + Money.fromJson(core.Map _json) { + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('nanos')) { + nanos = _json['nanos'] as core.int; + } + if (_json.containsKey('units')) { + units = _json['units'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (nanos != null) { + _json['nanos'] = nanos; + } + if (units != null) { + _json['units'] = units; + } + return _json; + } +} + +/// An ObjectId specifies an object identifier (OID). +/// +/// These provide context and describe types in ASN.1 messages. +class ObjectId { + /// The parts of an OID path. + /// + /// The most significant parts of the path come first. + /// + /// Required. + core.List<core.int> objectIdPath; + + ObjectId(); + + ObjectId.fromJson(core.Map _json) { + if (_json.containsKey('objectIdPath')) { + objectIdPath = (_json['objectIdPath'] as core.List) + .map<core.int>((value) => value as core.int) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (objectIdPath != null) { + _json['objectIdPath'] = objectIdPath; + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class Operation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + Status error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +class OperationMetadata { + /// API version used to start the operation. + /// + /// Output only. + core.String apiVersion; + + /// The time the operation was created. + /// + /// Output only. + core.String createTime; + + /// The time the operation finished running. + /// + /// Output only. + core.String endTime; + + /// Identifies whether the user has requested cancellation of the operation. + /// + /// Operations that have successfully been cancelled have Operation.error + /// value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// Output only. + core.bool requestedCancellation; + + /// Human-readable status of the operation, if any. + /// + /// Output only. + core.String statusMessage; + + /// Server-defined resource path for the target of the operation. + /// + /// Output only. + core.String target; + + /// Name of the verb executed by the operation. + /// + /// Output only. + core.String verb; + + OperationMetadata(); + + OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('requestedCancellation')) { + requestedCancellation = _json['requestedCancellation'] as core.bool; + } + if (_json.containsKey('statusMessage')) { + statusMessage = _json['statusMessage'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (requestedCancellation != null) { + _json['requestedCancellation'] = requestedCancellation; + } + if (statusMessage != null) { + _json['statusMessage'] = statusMessage; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service +/// accounts, Google groups, and domains (such as G Suite). A `role` is a named +/// list of permissions; each `role` can be an IAM predefined role or a +/// user-created custom role. For some types of Google Cloud resources, a +/// `binding` can also specify a `condition`, which is a logical expression that +/// allows access to a resource only if the expression evaluates to `true`. A +/// condition can add constraints based on attributes of the request, the +/// resource, or both. To learn which resources support conditions in their IAM +/// policies, see the +/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +/// **JSON example:** { "bindings": \[ { "role": +/// "roles/resourcemanager.organizationAdmin", "members": \[ +/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": +/// "roles/resourcemanager.organizationViewer", "members": \[ +/// "user:eve@example.com" \], "condition": { "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", "expression": +/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": +/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - +/// user:mike@example.com - group:admins@example.com - domain:google.com - +/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: +/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer condition: title: expirable +/// access description: Does not grant access after Sep 2020 expression: +/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - +/// version: 3 For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +class Policy { + /// Specifies cloud audit logging configuration for this policy. + core.List<AuditConfig> auditConfigs; + + /// Associates a list of `members` to a `role`. + /// + /// Optionally, may specify a `condition` that determines how and when the + /// `bindings` are applied. Each of the `bindings` must contain at least one + /// member. + core.List<Binding> bindings; + + /// `etag` is used for optimistic concurrency control as a way to help prevent + /// simultaneous updates of a policy from overwriting each other. + /// + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the + /// policy. **Important:** If you use IAM Conditions, you must include the + /// `etag` field whenever you call `setIamPolicy`. If you omit this field, + /// then IAM allows you to overwrite a version `3` policy with a version `1` + /// policy, and all of the conditions in the version `3` policy are lost. + core.String etag; + core.List<core.int> get etagAsBytes => convert.base64.decode(etag); + + set etagAsBytes(core.List<core.int> _bytes) { + etag = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. Any operation that affects conditional role bindings must + /// specify version `3`. This requirement applies to the following operations: + /// * Getting a policy that includes a conditional role binding * Adding a + /// conditional role binding to a policy * Changing a conditional role binding + /// in a policy * Removing any role binding, with or without a condition, from + /// a policy that includes conditions **Important:** If you use IAM + /// Conditions, you must include the `etag` field whenever you call + /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a + /// version `3` policy with a version `1` policy, and all of the conditions in + /// the version `3` policy are lost. If a policy does not include any + /// conditions, operations on that policy may specify any valid version or + /// leave the field unset. To learn which resources support conditions in + /// their IAM policies, see the + /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + core.int version; + + Policy(); + + Policy.fromJson(core.Map _json) { + if (_json.containsKey('auditConfigs')) { + auditConfigs = (_json['auditConfigs'] as core.List) + .map<AuditConfig>((value) => AuditConfig.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('bindings')) { + bindings = (_json['bindings'] as core.List) + .map<Binding>((value) => + Binding.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('etag')) { + etag = _json['etag'] as core.String; + } + if (_json.containsKey('version')) { + version = _json['version'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (auditConfigs != null) { + _json['auditConfigs'] = + auditConfigs.map((value) => value.toJson()).toList(); + } + if (bindings != null) { + _json['bindings'] = bindings.map((value) => value.toJson()).toList(); + } + if (etag != null) { + _json['etag'] = etag; + } + if (version != null) { + _json['version'] = version; + } + return _json; + } +} + +/// A PublicKey describes a public key. +class PublicKey { + /// A public key. + /// + /// When this is specified in a request, the padding and encoding can be any + /// of the options described by the respective 'KeyType' value. When this is + /// generated by the service, it will always be an RFC 5280 + /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + /// structure containing an algorithm identifier and a key. + /// + /// Required. + core.String key; + core.List<core.int> get keyAsBytes => convert.base64.decode(key); + + set keyAsBytes(core.List<core.int> _bytes) { + key = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// The type of public key. + /// + /// If specified, it must match the public key used for the`key` field. + /// + /// Optional. + /// Possible string values are: + /// - "KEY_TYPE_UNSPECIFIED" : Default unspecified value. + /// - "PEM_RSA_KEY" : A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey structure, or + /// an RFC 5280 + /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + /// structure containing the former. + /// - "PEM_EC_KEY" : An RFC 5280 + /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1) + /// structure containing a PEM-encoded compressed NIST + /// P-256/secp256r1/prime256v1 or P-384 key. + core.String type; + + PublicKey(); + + PublicKey.fromJson(core.Map _json) { + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (key != null) { + _json['key'] = key; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Request message for CertificateAuthorityService.RestoreCertificateAuthority. +class RestoreCertificateAuthorityRequest { + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + RestoreCertificateAuthorityRequest(); + + RestoreCertificateAuthorityRequest.fromJson(core.Map _json) { + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// A ReusableConfig refers to a managed ReusableConfigValues. +/// +/// Those, in turn, are used to describe certain fields of an X.509 certificate, +/// such as the key usage fields, fields specific to CA certificates, +/// certificate policy extensions and custom extensions. +class ReusableConfig { + /// The time at which this ReusableConfig was created. + /// + /// Output only. + core.String createTime; + + /// A human-readable description of scenarios these ReusableConfigValues may + /// be compatible with. + /// + /// Optional. + core.String description; + + /// Labels with user-defined metadata. + /// + /// Optional. + core.Map<core.String, core.String> labels; + + /// The resource path for this ReusableConfig in the format `projects / * + /// /locations / * /reusableConfigs / * `. + /// + /// Output only. + core.String name; + + /// The time at which this ReusableConfig was updated. + /// + /// Output only. + core.String updateTime; + + /// The config values. + /// + /// Required. + ReusableConfigValues values; + + ReusableConfig(); + + ReusableConfig.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + if (_json.containsKey('values')) { + values = ReusableConfigValues.fromJson( + _json['values'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + if (values != null) { + _json['values'] = values.toJson(); + } + return _json; + } +} + +/// A ReusableConfigValues is used to describe certain fields of an X.509 +/// certificate, such as the key usage fields, fields specific to CA +/// certificates, certificate policy extensions and custom extensions. +class ReusableConfigValues { + /// Describes custom X.509 extensions. + /// + /// Optional. + core.List<X509Extension> additionalExtensions; + + /// Describes Online Certificate Status Protocol (OCSP) endpoint addresses + /// that appear in the "Authority Information Access" extension in the + /// certificate. + /// + /// Optional. + core.List<core.String> aiaOcspServers; + + /// Describes options in this ReusableConfigValues that are relevant in a CA + /// certificate. + /// + /// Optional. + CaOptions caOptions; + + /// Indicates the intended use for keys that correspond to a certificate. + /// + /// Optional. + KeyUsage keyUsage; + + /// Describes the X.509 certificate policy object identifiers, per + /// https://tools.ietf.org/html/rfc5280#section-4.2.1.4. + /// + /// Optional. + core.List<ObjectId> policyIds; + + ReusableConfigValues(); + + ReusableConfigValues.fromJson(core.Map _json) { + if (_json.containsKey('additionalExtensions')) { + additionalExtensions = (_json['additionalExtensions'] as core.List) + .map<X509Extension>((value) => X509Extension.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('aiaOcspServers')) { + aiaOcspServers = (_json['aiaOcspServers'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('caOptions')) { + caOptions = CaOptions.fromJson( + _json['caOptions'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('keyUsage')) { + keyUsage = KeyUsage.fromJson( + _json['keyUsage'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('policyIds')) { + policyIds = (_json['policyIds'] as core.List) + .map<ObjectId>((value) => + ObjectId.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (additionalExtensions != null) { + _json['additionalExtensions'] = + additionalExtensions.map((value) => value.toJson()).toList(); + } + if (aiaOcspServers != null) { + _json['aiaOcspServers'] = aiaOcspServers; + } + if (caOptions != null) { + _json['caOptions'] = caOptions.toJson(); + } + if (keyUsage != null) { + _json['keyUsage'] = keyUsage.toJson(); + } + if (policyIds != null) { + _json['policyIds'] = policyIds.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A ReusableConfigWrapper describes values that may assist in creating an +/// X.509 certificate, or a reference to a pre-defined set of values. +class ReusableConfigWrapper { + /// A resource path to a ReusableConfig in the format `projects / * /locations + /// / * /reusableConfigs / * `. + /// + /// Required. + core.String reusableConfig; + + /// A user-specified inline ReusableConfigValues. + /// + /// Required. + ReusableConfigValues reusableConfigValues; + + ReusableConfigWrapper(); + + ReusableConfigWrapper.fromJson(core.Map _json) { + if (_json.containsKey('reusableConfig')) { + reusableConfig = _json['reusableConfig'] as core.String; + } + if (_json.containsKey('reusableConfigValues')) { + reusableConfigValues = ReusableConfigValues.fromJson( + _json['reusableConfigValues'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (reusableConfig != null) { + _json['reusableConfig'] = reusableConfig; + } + if (reusableConfigValues != null) { + _json['reusableConfigValues'] = reusableConfigValues.toJson(); + } + return _json; + } +} + +/// Describes fields that are relavent to the revocation of a Certificate. +class RevocationDetails { + /// Indicates why a Certificate was revoked. + /// Possible string values are: + /// - "REVOCATION_REASON_UNSPECIFIED" : Default unspecified value. This value + /// does indicate that a Certificate has been revoked, but that a reason has + /// not been recorded. + /// - "KEY_COMPROMISE" : Key material for this Certificate may have leaked. + /// - "CERTIFICATE_AUTHORITY_COMPROMISE" : The key material for a certificate + /// authority in the issuing path may have leaked. + /// - "AFFILIATION_CHANGED" : The subject or other attributes in this + /// Certificate have changed. + /// - "SUPERSEDED" : This Certificate has been superseded. + /// - "CESSATION_OF_OPERATION" : This Certificate or entities in the issuing + /// path have ceased to operate. + /// - "CERTIFICATE_HOLD" : This Certificate should not be considered valid, it + /// is expected that it may become valid in the future. + /// - "PRIVILEGE_WITHDRAWN" : This Certificate no longer has permission to + /// assert the listed attributes. + /// - "ATTRIBUTE_AUTHORITY_COMPROMISE" : The authority which determines + /// appropriate attributes for a Certificate may have been compromised. + core.String revocationState; + + /// The time at which this Certificate was revoked. + core.String revocationTime; + + RevocationDetails(); + + RevocationDetails.fromJson(core.Map _json) { + if (_json.containsKey('revocationState')) { + revocationState = _json['revocationState'] as core.String; + } + if (_json.containsKey('revocationTime')) { + revocationTime = _json['revocationTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (revocationState != null) { + _json['revocationState'] = revocationState; + } + if (revocationTime != null) { + _json['revocationTime'] = revocationTime; + } + return _json; + } +} + +/// Request message for CertificateAuthorityService.RevokeCertificate. +class RevokeCertificateRequest { + /// The RevocationReason for revoking this certificate. + /// + /// Required. + /// Possible string values are: + /// - "REVOCATION_REASON_UNSPECIFIED" : Default unspecified value. This value + /// does indicate that a Certificate has been revoked, but that a reason has + /// not been recorded. + /// - "KEY_COMPROMISE" : Key material for this Certificate may have leaked. + /// - "CERTIFICATE_AUTHORITY_COMPROMISE" : The key material for a certificate + /// authority in the issuing path may have leaked. + /// - "AFFILIATION_CHANGED" : The subject or other attributes in this + /// Certificate have changed. + /// - "SUPERSEDED" : This Certificate has been superseded. + /// - "CESSATION_OF_OPERATION" : This Certificate or entities in the issuing + /// path have ceased to operate. + /// - "CERTIFICATE_HOLD" : This Certificate should not be considered valid, it + /// is expected that it may become valid in the future. + /// - "PRIVILEGE_WITHDRAWN" : This Certificate no longer has permission to + /// assert the listed attributes. + /// - "ATTRIBUTE_AUTHORITY_COMPROMISE" : The authority which determines + /// appropriate attributes for a Certificate may have been compromised. + core.String reason; + + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + RevokeCertificateRequest(); + + RevokeCertificateRequest.fromJson(core.Map _json) { + if (_json.containsKey('reason')) { + reason = _json['reason'] as core.String; + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (reason != null) { + _json['reason'] = reason; + } + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// Describes a revoked Certificate. +class RevokedCertificate { + /// The resource path for the Certificate in the format `projects / * + /// /locations / * /certificateAuthorities / * /certificates / * `. + core.String certificate; + + /// The serial number of the Certificate. + core.String hexSerialNumber; + + /// The reason the Certificate was revoked. + /// Possible string values are: + /// - "REVOCATION_REASON_UNSPECIFIED" : Default unspecified value. This value + /// does indicate that a Certificate has been revoked, but that a reason has + /// not been recorded. + /// - "KEY_COMPROMISE" : Key material for this Certificate may have leaked. + /// - "CERTIFICATE_AUTHORITY_COMPROMISE" : The key material for a certificate + /// authority in the issuing path may have leaked. + /// - "AFFILIATION_CHANGED" : The subject or other attributes in this + /// Certificate have changed. + /// - "SUPERSEDED" : This Certificate has been superseded. + /// - "CESSATION_OF_OPERATION" : This Certificate or entities in the issuing + /// path have ceased to operate. + /// - "CERTIFICATE_HOLD" : This Certificate should not be considered valid, it + /// is expected that it may become valid in the future. + /// - "PRIVILEGE_WITHDRAWN" : This Certificate no longer has permission to + /// assert the listed attributes. + /// - "ATTRIBUTE_AUTHORITY_COMPROMISE" : The authority which determines + /// appropriate attributes for a Certificate may have been compromised. + core.String revocationReason; + + RevokedCertificate(); + + RevokedCertificate.fromJson(core.Map _json) { + if (_json.containsKey('certificate')) { + certificate = _json['certificate'] as core.String; + } + if (_json.containsKey('hexSerialNumber')) { + hexSerialNumber = _json['hexSerialNumber'] as core.String; + } + if (_json.containsKey('revocationReason')) { + revocationReason = _json['revocationReason'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificate != null) { + _json['certificate'] = certificate; + } + if (hexSerialNumber != null) { + _json['hexSerialNumber'] = hexSerialNumber; + } + if (revocationReason != null) { + _json['revocationReason'] = revocationReason; + } + return _json; + } +} + +/// Request message for +/// CertificateAuthorityService.ScheduleDeleteCertificateAuthority. +class ScheduleDeleteCertificateAuthorityRequest { + /// This field allows the CA to be scheduled for deletion even if the CA has + /// active certs. + /// + /// Active certs include both unrevoked and unexpired certs. + /// + /// Optional. + core.bool ignoreActiveCertificates; + + /// An ID to identify requests. + /// + /// Specify a unique request ID so that if you must retry your request, the + /// server will know to ignore the request if it has already been completed. + /// The server will guarantee that for at least 60 minutes since the first + /// request. For example, consider a situation where you make an initial + /// request and t he request times out. If you make the request again with the + /// same request ID, the server can check if original operation with the same + /// request ID was received, and if so, will ignore the second request. This + /// prevents clients from accidentally creating duplicate commitments. The + /// request ID must be a valid UUID with the exception that zero UUID is not + /// supported (00000000-0000-0000-0000-000000000000). + /// + /// Optional. + core.String requestId; + + ScheduleDeleteCertificateAuthorityRequest(); + + ScheduleDeleteCertificateAuthorityRequest.fromJson(core.Map _json) { + if (_json.containsKey('ignoreActiveCertificates')) { + ignoreActiveCertificates = _json['ignoreActiveCertificates'] as core.bool; + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (ignoreActiveCertificates != null) { + _json['ignoreActiveCertificates'] = ignoreActiveCertificates; + } + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// Request message for `SetIamPolicy` method. +class SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. + /// + /// The size of the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) might + /// reject them. + Policy policy; + + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. + /// + /// Only the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: `paths: "bindings, etag"` + core.String updateMask; + + SetIamPolicyRequest(); + + SetIamPolicyRequest.fromJson(core.Map _json) { + if (_json.containsKey('policy')) { + policy = Policy.fromJson( + _json['policy'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (policy != null) { + _json['policy'] = policy.toJson(); + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class Status { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + Status(); + + Status.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// Subject describes parts of a distinguished name that, in turn, describes the +/// subject of the certificate. +class Subject { + /// The country code of the subject. + core.String countryCode; + + /// The locality or city of the subject. + core.String locality; + + /// The organization of the subject. + core.String organization; + + /// The organizational_unit of the subject. + core.String organizationalUnit; + + /// The postal code of the subject. + core.String postalCode; + + /// The province, territory, or regional state of the subject. + core.String province; + + /// The street address of the subject. + core.String streetAddress; + + Subject(); + + Subject.fromJson(core.Map _json) { + if (_json.containsKey('countryCode')) { + countryCode = _json['countryCode'] as core.String; + } + if (_json.containsKey('locality')) { + locality = _json['locality'] as core.String; + } + if (_json.containsKey('organization')) { + organization = _json['organization'] as core.String; + } + if (_json.containsKey('organizationalUnit')) { + organizationalUnit = _json['organizationalUnit'] as core.String; + } + if (_json.containsKey('postalCode')) { + postalCode = _json['postalCode'] as core.String; + } + if (_json.containsKey('province')) { + province = _json['province'] as core.String; + } + if (_json.containsKey('streetAddress')) { + streetAddress = _json['streetAddress'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (countryCode != null) { + _json['countryCode'] = countryCode; + } + if (locality != null) { + _json['locality'] = locality; + } + if (organization != null) { + _json['organization'] = organization; + } + if (organizationalUnit != null) { + _json['organizationalUnit'] = organizationalUnit; + } + if (postalCode != null) { + _json['postalCode'] = postalCode; + } + if (province != null) { + _json['province'] = province; + } + if (streetAddress != null) { + _json['streetAddress'] = streetAddress; + } + return _json; + } +} + +/// SubjectAltNames corresponds to a more modern way of listing what the +/// asserted identity is in a certificate (i.e., compared to the "common name" +/// in the distinguished name). +class SubjectAltNames { + /// Contains additional subject alternative name values. + core.List<X509Extension> customSans; + + /// Contains only valid, fully-qualified host names. + core.List<core.String> dnsNames; + + /// Contains only valid RFC 2822 E-mail addresses. + core.List<core.String> emailAddresses; + + /// Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses. + core.List<core.String> ipAddresses; + + /// Contains only valid RFC 3986 URIs. + core.List<core.String> uris; + + SubjectAltNames(); + + SubjectAltNames.fromJson(core.Map _json) { + if (_json.containsKey('customSans')) { + customSans = (_json['customSans'] as core.List) + .map<X509Extension>((value) => X509Extension.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('dnsNames')) { + dnsNames = (_json['dnsNames'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('emailAddresses')) { + emailAddresses = (_json['emailAddresses'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('ipAddresses')) { + ipAddresses = (_json['ipAddresses'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('uris')) { + uris = (_json['uris'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (customSans != null) { + _json['customSans'] = customSans.map((value) => value.toJson()).toList(); + } + if (dnsNames != null) { + _json['dnsNames'] = dnsNames; + } + if (emailAddresses != null) { + _json['emailAddresses'] = emailAddresses; + } + if (ipAddresses != null) { + _json['ipAddresses'] = ipAddresses; + } + if (uris != null) { + _json['uris'] = uris; + } + return _json; + } +} + +/// These values are used to create the distinguished name and subject +/// alternative name fields in an X.509 certificate. +class SubjectConfig { + /// The "common name" of the distinguished name. + /// + /// Optional. + core.String commonName; + + /// Contains distinguished name fields such as the location and organization. + /// + /// Required. + Subject subject; + + /// The subject alternative name fields. + /// + /// Optional. + SubjectAltNames subjectAltName; + + SubjectConfig(); + + SubjectConfig.fromJson(core.Map _json) { + if (_json.containsKey('commonName')) { + commonName = _json['commonName'] as core.String; + } + if (_json.containsKey('subject')) { + subject = Subject.fromJson( + _json['subject'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('subjectAltName')) { + subjectAltName = SubjectAltNames.fromJson( + _json['subjectAltName'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonName != null) { + _json['commonName'] = commonName; + } + if (subject != null) { + _json['subject'] = subject.toJson(); + } + if (subjectAltName != null) { + _json['subjectAltName'] = subjectAltName.toJson(); + } + return _json; + } +} + +/// These values describe fields in an issued X.509 certificate such as the +/// distinguished name, subject alternative names, serial number, and lifetime. +class SubjectDescription { + /// The "common name" of the distinguished name. + core.String commonName; + + /// The serial number encoded in lowercase hexadecimal. + core.String hexSerialNumber; + + /// For convenience, the actual lifetime of an issued certificate. + /// + /// Corresponds to 'not_after_time' - 'not_before_time'. + core.String lifetime; + + /// The time at which the certificate expires. + core.String notAfterTime; + + /// The time at which the certificate becomes valid. + core.String notBeforeTime; + + /// Contains distinguished name fields such as the location and organization. + Subject subject; + + /// The subject alternative name fields. + SubjectAltNames subjectAltName; + + SubjectDescription(); + + SubjectDescription.fromJson(core.Map _json) { + if (_json.containsKey('commonName')) { + commonName = _json['commonName'] as core.String; + } + if (_json.containsKey('hexSerialNumber')) { + hexSerialNumber = _json['hexSerialNumber'] as core.String; + } + if (_json.containsKey('lifetime')) { + lifetime = _json['lifetime'] as core.String; + } + if (_json.containsKey('notAfterTime')) { + notAfterTime = _json['notAfterTime'] as core.String; + } + if (_json.containsKey('notBeforeTime')) { + notBeforeTime = _json['notBeforeTime'] as core.String; + } + if (_json.containsKey('subject')) { + subject = Subject.fromJson( + _json['subject'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('subjectAltName')) { + subjectAltName = SubjectAltNames.fromJson( + _json['subjectAltName'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (commonName != null) { + _json['commonName'] = commonName; + } + if (hexSerialNumber != null) { + _json['hexSerialNumber'] = hexSerialNumber; + } + if (lifetime != null) { + _json['lifetime'] = lifetime; + } + if (notAfterTime != null) { + _json['notAfterTime'] = notAfterTime; + } + if (notBeforeTime != null) { + _json['notBeforeTime'] = notBeforeTime; + } + if (subject != null) { + _json['subject'] = subject.toJson(); + } + if (subjectAltName != null) { + _json['subjectAltName'] = subjectAltName.toJson(); + } + return _json; + } +} + +/// Describes a subordinate CA's issuers. +/// +/// This is either a resource path to a known issuing CertificateAuthority, or a +/// PEM issuer certificate chain. +class SubordinateConfig { + /// This can refer to a CertificateAuthority in the same project that was used + /// to create a subordinate CertificateAuthority. + /// + /// This field is used for information and usability purposes only. The + /// resource name is in the format `projects / * /locations / * + /// /certificateAuthorities / * `. + /// + /// Required. + core.String certificateAuthority; + + /// Contains the PEM certificate chain for the issuers of this + /// CertificateAuthority, but not pem certificate for this CA itself. + /// + /// Required. + SubordinateConfigChain pemIssuerChain; + + SubordinateConfig(); + + SubordinateConfig.fromJson(core.Map _json) { + if (_json.containsKey('certificateAuthority')) { + certificateAuthority = _json['certificateAuthority'] as core.String; + } + if (_json.containsKey('pemIssuerChain')) { + pemIssuerChain = SubordinateConfigChain.fromJson( + _json['pemIssuerChain'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (certificateAuthority != null) { + _json['certificateAuthority'] = certificateAuthority; + } + if (pemIssuerChain != null) { + _json['pemIssuerChain'] = pemIssuerChain.toJson(); + } + return _json; + } +} + +/// This message describes a subordinate CA's issuer certificate chain. +/// +/// This wrapper exists for compatibility reasons. +class SubordinateConfigChain { + /// Expected to be in leaf-to-root order according to RFC 5246. + /// + /// Required. + core.List<core.String> pemCertificates; + + SubordinateConfigChain(); + + SubordinateConfigChain.fromJson(core.Map _json) { + if (_json.containsKey('pemCertificates')) { + pemCertificates = (_json['pemCertificates'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (pemCertificates != null) { + _json['pemCertificates'] = pemCertificates; + } + return _json; + } +} + +/// Request message for `TestIamPermissions` method. +class TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. + /// + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// For more information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + core.List<core.String> permissions; + + TestIamPermissionsRequest(); + + TestIamPermissionsRequest.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// Response message for `TestIamPermissions` method. +class TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + core.List<core.String> permissions; + + TestIamPermissionsResponse(); + + TestIamPermissionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('permissions')) { + permissions = (_json['permissions'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (permissions != null) { + _json['permissions'] = permissions; + } + return _json; + } +} + +/// An X509Extension specifies an X.509 extension, which may be used in +/// different parts of X.509 objects like certificates, CSRs, and CRLs. +class X509Extension { + /// Indicates whether or not this extension is critical (i.e., if the client + /// does not know how to handle this extension, the client should consider + /// this to be an error). + /// + /// Required. + core.bool critical; + + /// The OID for this X.509 extension. + /// + /// Required. + ObjectId objectId; + + /// The value of this X.509 extension. + /// + /// Required. + core.String value; + core.List<core.int> get valueAsBytes => convert.base64.decode(value); + + set valueAsBytes(core.List<core.int> _bytes) { + value = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + X509Extension(); + + X509Extension.fromJson(core.Map _json) { + if (_json.containsKey('critical')) { + critical = _json['critical'] as core.bool; + } + if (_json.containsKey('objectId')) { + objectId = ObjectId.fromJson( + _json['objectId'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('value')) { + value = _json['value'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (critical != null) { + _json['critical'] = critical; + } + if (objectId != null) { + _json['objectId'] = objectId.toJson(); + } + if (value != null) { + _json['value'] = value; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/prod_tt_sasportal/v1alpha1.dart b/generated/googleapis_beta/lib/prod_tt_sasportal/v1alpha1.dart index 7e16e20..bd6a137 100644 --- a/generated/googleapis_beta/lib/prod_tt_sasportal/v1alpha1.dart +++ b/generated/googleapis_beta/lib/prod_tt_sasportal/v1alpha1.dart
@@ -27,6 +27,8 @@ /// - [CustomersDeploymentsDevicesResource] /// - [CustomersDevicesResource] /// - [CustomersNodesResource] +/// - [CustomersNodesDeploymentsResource] +/// - [CustomersNodesDevicesResource] /// - [CustomersNodesNodesResource] /// - [DeploymentsResource] /// - [DeploymentsDevicesResource] @@ -36,6 +38,7 @@ /// - [NodesDeploymentsDevicesResource] /// - [NodesDevicesResource] /// - [NodesNodesResource] +/// - [NodesNodesDeploymentsResource] /// - [NodesNodesDevicesResource] /// - [NodesNodesNodesResource] /// - [PoliciesResource] @@ -142,8 +145,7 @@ /// [pageSize] - The maximum number of customers to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListCustomers method that indicates where this listing should continue - /// from. + /// ListCustomers that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -268,6 +270,247 @@ CustomersDeploymentsResource(commons.ApiRequester client) : _requester = client; + /// Creates a new deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. + /// Value must have pattern `^customers/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalEmpty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^customers/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + /// Moves a deployment under another node or customer. /// /// [request] - The metadata request object. @@ -326,6 +569,70 @@ data as core.Map<core.String, core.dynamic>), ); } + + /// Updates an existing deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [updateMask] - Fields to be updated. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> patch( + SasPortalDeployment request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class CustomersDeploymentsDevicesResource { @@ -463,7 +770,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -539,68 +846,6 @@ /// Creates a device under a node or customer. /// - /// Returned devices are unordered. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the parent resource. - /// Value must have pattern `^customers/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a device under a node or customer. - /// /// [request] - The metadata request object. /// /// Request parameters: @@ -832,7 +1077,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -1147,6 +1392,10 @@ class CustomersNodesResource { final commons.ApiRequester _requester; + CustomersNodesDeploymentsResource get deployments => + CustomersNodesDeploymentsResource(_requester); + CustomersNodesDevicesResource get devices => + CustomersNodesDevicesResource(_requester); CustomersNodesNodesResource get nodes => CustomersNodesNodesResource(_requester); @@ -1324,10 +1573,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^customers/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -1341,6 +1594,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -1355,6 +1609,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -1508,6 +1765,354 @@ } } +class CustomersNodesDeploymentsResource { + final commons.ApiRequester _requester; + + CustomersNodesDeploymentsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class CustomersNodesDevicesResource { + final commons.ApiRequester _requester; + + CustomersNodesDevicesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a device under a node or customer. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDevice]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDevice> create( + SasPortalDevice request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalDevice.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a signed device under a node or customer. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDevice]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDevice> createSigned( + SasPortalCreateSignedDeviceRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices:createSigned'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalDevice.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists devices under a node or customer. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have one of the + /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds + /// to serial number of the device. The filter is case insensitive. + /// + /// [pageSize] - The maximum number of devices to return in the response. If + /// empty or zero, all devices will be listed. Must be in the range \[0, + /// 1000\]. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDevices that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDevicesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDevicesResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDevicesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + class CustomersNodesNodesResource { final commons.ApiRequester _requester; @@ -1582,10 +2187,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -1599,6 +2208,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -1613,6 +2223,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -1650,6 +2263,58 @@ DeploymentsDevicesResource(_requester); DeploymentsResource(commons.ApiRequester client) : _requester = client; + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class DeploymentsDevicesResource { @@ -2010,7 +2675,7 @@ InstallerResource(commons.ApiRequester client) : _requester = client; - /// Generates a secret to be used with the ValidateInstaller method + /// Generates a secret to be used with the ValidateInstaller. /// /// [request] - The metadata request object. /// @@ -2184,6 +2849,186 @@ NodesDeploymentsResource(commons.ApiRequester client) : _requester = client; + /// Deletes a deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalEmpty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + /// Moves a deployment under another node or customer. /// /// [request] - The metadata request object. @@ -2242,6 +3087,70 @@ data as core.Map<core.String, core.dynamic>), ); } + + /// Updates an existing deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [updateMask] - Fields to be updated. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> patch( + SasPortalDeployment request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class NodesDeploymentsDevicesResource { @@ -2379,7 +3288,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -2455,68 +3364,6 @@ /// Creates a device under a node or customer. /// - /// Returned devices are unordered. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the parent resource. - /// Value must have pattern `^nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a device under a node or customer. - /// /// [request] - The metadata request object. /// /// Request parameters: @@ -2748,7 +3595,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -3063,6 +3910,8 @@ class NodesNodesResource { final commons.ApiRequester _requester; + NodesNodesDeploymentsResource get deployments => + NodesNodesDeploymentsResource(_requester); NodesNodesDevicesResource get devices => NodesNodesDevicesResource(_requester); NodesNodesNodesResource get nodes => NodesNodesNodesResource(_requester); @@ -3241,10 +4090,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -3258,6 +4111,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -3272,6 +4126,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -3425,34 +4282,34 @@ } } -class NodesNodesDevicesResource { +class NodesNodesDeploymentsResource { final commons.ApiRequester _requester; - NodesNodesDevicesResource(commons.ApiRequester client) : _requester = client; + NodesNodesDeploymentsResource(commons.ApiRequester client) + : _requester = client; - /// Creates a device under a node or customer. - /// - /// Returned devices are unordered. + /// Creates a new deployment. /// /// [request] - The metadata request object. /// /// Request parameters: /// - /// [parent] - Required. The name of the parent resource. + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. + /// Completes with a [SasPortalDeployment]. /// /// Completes with a [commons.ApiRequestError] if the API endpoint returned an /// error. /// /// If the used [http.Client] completes with an error when making a REST call, /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, core.String parent, { core.String $fields, }) { @@ -3475,7 +4332,7 @@ _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; + '/deployments'; final _response = _requester.request( _url, @@ -3487,11 +4344,93 @@ downloadOptions: _downloadOptions, ); return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( + (data) => SasPortalDeployment.fromJson( data as core.Map<core.String, core.dynamic>), ); } + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class NodesNodesDevicesResource { + final commons.ApiRequester _requester; + + NodesNodesDevicesResource(commons.ApiRequester client) : _requester = client; + /// Creates a device under a node or customer. /// /// [request] - The metadata request object. @@ -3621,7 +4560,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -3763,10 +4702,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -3780,6 +4723,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -3794,6 +4738,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -4028,66 +4975,12 @@ } } -/// Request for BulkCreateDevice method. -class SasPortalBulkCreateDeviceRequest { - /// A csv with each row representing a \[device\]. - /// - /// Each row must conform to the regulations described on - /// CreateDeviceRequest's device field. - /// - /// Required. - core.String csv; - - SasPortalBulkCreateDeviceRequest(); - - SasPortalBulkCreateDeviceRequest.fromJson(core.Map _json) { - if (_json.containsKey('csv')) { - csv = _json['csv'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (csv != null) { - _json['csv'] = csv; - } - return _json; - } -} - -/// Response for BulkCreateDevice method. -class SasPortalBulkCreateDeviceResponse { - /// The devices that were imported. - /// - /// Required. - core.List<SasPortalDevice> devices; - - SasPortalBulkCreateDeviceResponse(); - - SasPortalBulkCreateDeviceResponse.fromJson(core.Map _json) { - if (_json.containsKey('devices')) { - devices = (_json['devices'] as core.List) - .map<SasPortalDevice>((value) => SasPortalDevice.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (devices != null) { - _json['devices'] = devices.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Request for CreateSignedDevice method. +/// Request for CreateSignedDevice. class SasPortalCreateSignedDeviceRequest { /// JSON Web Token signed using a CPI private key. /// - /// Payload must be the JSON encoding of the \[Device\]. The user_id field - /// must be set. + /// Payload must be the JSON encoding of the device. The user_id field must be + /// set. /// /// Required. core.String encodedDevice; @@ -4099,7 +4992,7 @@ convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); } - /// Unique installer id (cpiId) from the Certified Professional Installers + /// Unique installer id (CPI ID) from the Certified Professional Installers /// database. /// /// Required. @@ -4174,6 +5067,77 @@ } } +/// The Deployment. +class SasPortalDeployment { + /// The allowed billing modes under this deployment. + core.List<core.String> allowedBillingModes; + + /// Default billing mode for the deployment and devices under it. + /// Possible string values are: + /// - "BILLING_MODE_UNSPECIFIED" : Billing mode has not been specified. + /// - "MOBILE" : Price is based on category of CBSD: Category A, Category B + /// registered with SAS. + /// - "FIXED_WIRELESS" : Price is based on type of CBSD: Base station or CPE. + core.String defaultBillingMode; + + /// The deployment's display name. + core.String displayName; + + /// Resource name. + /// + /// Output only. + core.String name; + + /// User ID used by the devices belonging to this deployment. + /// + /// Each deployment should be associated with one unique user ID. + core.List<core.String> sasUserIds; + + SasPortalDeployment(); + + SasPortalDeployment.fromJson(core.Map _json) { + if (_json.containsKey('allowedBillingModes')) { + allowedBillingModes = (_json['allowedBillingModes'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('defaultBillingMode')) { + defaultBillingMode = _json['defaultBillingMode'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('sasUserIds')) { + sasUserIds = (_json['sasUserIds'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowedBillingModes != null) { + _json['allowedBillingModes'] = allowedBillingModes; + } + if (defaultBillingMode != null) { + _json['defaultBillingMode'] = defaultBillingMode; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (sasUserIds != null) { + _json['sasUserIds'] = sasUserIds; + } + return _json; + } +} + class SasPortalDevice { /// Current configuration of the device as registered to the SAS. /// @@ -4290,10 +5254,10 @@ /// Information about the device's air interface. class SasPortalDeviceAirInterface { + /// Conditional. + /// /// This field specifies the radio access technology that is used for the /// CBSD. - /// - /// Conditional /// Possible string values are: /// - "RADIO_TECHNOLOGY_UNSPECIFIED" /// - "E_UTRA" @@ -4306,11 +5270,11 @@ /// - "TARANA_WIRELESS" core.String radioTechnology; - /// This field is related to the radioTechnology field and provides the air + /// This field is related to the `radioTechnology` and provides the air /// interface specification that the CBSD is compliant with at the time of /// registration. /// - /// Optional + /// Optional. core.String supportedSpec; SasPortalDeviceAirInterface(); @@ -4354,9 +5318,9 @@ /// Installation parameters for the device. SasPortalInstallationParams installationParams; - /// Output-only. - /// /// Whether the configuration has been signed by a CPI. + /// + /// Output only. core.bool isSigned; /// Measurement reporting capabilities of the device. @@ -4372,9 +5336,9 @@ /// - "FINAL" core.String state; - /// Output-only. - /// /// The last time the device configuration was edited. + /// + /// Output only. core.String updateTime; /// The identifier of a device user. @@ -4481,7 +5445,7 @@ /// Maximum Equivalent Isotropically Radiated Power (EIRP) permitted by the /// grant. /// - /// The maximum EIRP is in units of dBm/MHz. The value of maxEirp represents + /// The maximum EIRP is in units of dBm/MHz. The value of `maxEirp` represents /// the average (RMS) EIRP that would be measured by the procedure defined in /// FCC part 96.41(e)(3). core.double maxEirp; @@ -4723,8 +5687,7 @@ } } -/// Request for GenerateSecret method\] -/// \[spectrum.sas.portal.v1alpha1.DeviceManager.GenerateSecret\]. +/// Request for GenerateSecret. class SasPortalGenerateSecretRequest { SasPortalGenerateSecretRequest(); @@ -4738,10 +5701,9 @@ } } -/// Response for GenerateSecret method. +/// Response for GenerateSecret. class SasPortalGenerateSecretResponse { - /// The secret generated by the string and used by \[ValidateInstaller\] - /// method. + /// The secret generated by the string and used by ValidateInstaller. core.String secret; SasPortalGenerateSecretResponse(); @@ -4836,9 +5798,9 @@ /// Device antenna height in meters. /// - /// When the heightType parameter value is "AGL", the antenna height should be - /// given relative to ground level. When the heightType parameter value is - /// "AMSL", it is given with respect to WGS84 datum. + /// When the `heightType` parameter value is "AGL", the antenna height should + /// be given relative to ground level. When the `heightType` parameter value + /// is "AMSL", it is given with respect to WGS84 datum. core.double height; /// Specifies how the height is measured. @@ -4858,7 +5820,7 @@ /// Whether the device antenna is indoor or not. /// - /// True: indoor. False: outdoor. + /// `true`: indoor. `false`: outdoor. core.bool indoorDeployment; /// Latitude of the device antenna location in degrees relative to the WGS 84 @@ -4869,11 +5831,12 @@ /// equator. core.double latitude; - /// Longitude of the device antenna location. + /// Longitude of the device antenna location in degrees relative to the WGS 84 + /// datum. /// - /// in degrees relative to the WGS 84 datum. The allowed range is from - /// -180.000000 to +180.000000. Positive values represent longitudes east of - /// the prime meridian; negative values west of the prime meridian. + /// The allowed range is from -180.000000 to +180.000000. Positive values + /// represent longitudes east of the prime meridian; negative values west of + /// the prime meridian. core.double longitude; /// A positive number in meters to indicate accuracy of the device antenna @@ -4983,8 +5946,8 @@ /// The list of customers that match the request. core.List<SasPortalCustomer> customers; - /// A pagination token returned from a previous call to ListCustomers method - /// that indicates from where listing should continue. + /// A pagination token returned from a previous call to ListCustomers that + /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there are no more customers. core.String nextPageToken; @@ -5015,13 +5978,51 @@ } } -/// Response for ListDevices method. +/// Response for ListDeployments. +class SasPortalListDeploymentsResponse { + /// The deployments that match the request. + core.List<SasPortalDeployment> deployments; + + /// A pagination token returned from a previous call to ListDeployments that + /// indicates from where listing should continue. + /// + /// If the field is missing or empty, it means there are no more deployments. + core.String nextPageToken; + + SasPortalListDeploymentsResponse(); + + SasPortalListDeploymentsResponse.fromJson(core.Map _json) { + if (_json.containsKey('deployments')) { + deployments = (_json['deployments'] as core.List) + .map<SasPortalDeployment>((value) => SasPortalDeployment.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (deployments != null) { + _json['deployments'] = + deployments.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response for ListDevices. class SasPortalListDevicesResponse { /// The devices that match the request. core.List<SasPortalDevice> devices; - /// A pagination token returned from a previous call to ListDevices method - /// that indicates from where listing should continue. + /// A pagination token returned from a previous call to ListDevices that + /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there is no more devices. core.String nextPageToken; @@ -5052,9 +6053,9 @@ } } -/// Response for ListNodes method. +/// Response for ListNodes. class SasPortalListNodesResponse { - /// A pagination token returned from a previous call to ListNodes method that + /// A pagination token returned from a previous call to ListNodes that /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there is no more nodes. @@ -5089,9 +6090,9 @@ } } -/// Request for MoveDeployment method. +/// Request for MoveDeployment. class SasPortalMoveDeploymentRequest { - /// The name of the new parent resource Node or Customer to reparent the + /// The name of the new parent resource node or customer to reparent the /// deployment under. /// /// Required. @@ -5114,9 +6115,9 @@ } } -/// Request for MoveDevice method. +/// Request for MoveDevice. class SasPortalMoveDeviceRequest { - /// The name of the new parent resource (Node or Customer) to reparent the + /// The name of the new parent resource node or customer to reparent the /// device under. /// /// Required. @@ -5139,9 +6140,9 @@ } } -/// Request for MoveNode method. +/// Request for MoveNode. class SasPortalMoveNodeRequest { - /// The name of the new parent resource node or Customer) to reparent the node + /// The name of the new parent resource node or customer to reparent the node /// under. /// /// Required. @@ -5307,18 +6308,19 @@ /// Defines an access control policy to the resources. class SasPortalPolicy { + /// List of assignments core.List<SasPortalAssignment> assignments; - /// The \[etag\] is used for optimistic concurrency control as a way to help + /// The etag is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// - /// It is strongly suggested that systems make use of the \[etag\] in the + /// It is strongly suggested that systems make use of the etag in the /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An \[etag\] is returned in the response to \[GetPolicy\], and - /// systems are expected to put that etag in the request to \[SetPolicy\] to - /// ensure that their change will be applied to the same version of the - /// policy. If no \[etag\] is provided in the call to \[SetPolicy\], then the - /// existing policy is overwritten blindly. + /// conditions: An etag is returned in the response to GetPolicy, and systems + /// are expected to put that etag in the request to SetPolicy to ensure that + /// their change will be applied to the same version of the policy. If no etag + /// is provided in the call to GetPolicy, then the existing policy is + /// overwritten blindly. core.String etag; core.List<core.int> get etagAsBytes => convert.base64.decode(etag); @@ -5392,7 +6394,7 @@ } } -/// Request for SignDevice method. +/// Request for SignDevice. class SasPortalSignDeviceRequest { /// The device to sign. /// @@ -5541,7 +6543,7 @@ } } -/// Request for UpdateSignedDevice method. +/// Request for UpdateSignedDevice. class SasPortalUpdateSignedDeviceRequest { /// The JSON Web Token signed using a CPI private key. /// @@ -5587,7 +6589,7 @@ } } -/// Request for ValidateInstaller method. +/// Request for ValidateInstaller. class SasPortalValidateInstallerRequest { /// JSON Web Token signed using a CPI private key. /// @@ -5596,13 +6598,13 @@ /// Required. core.String encodedSecret; - /// Unique installer id (cpiId) from the Certified Professional Installers + /// Unique installer id (CPI ID) from the Certified Professional Installers /// database. /// /// Required. core.String installerId; - /// Secret returned by the GenerateSecret method. + /// Secret returned by the GenerateSecret. /// /// Required. core.String secret; @@ -5636,8 +6638,7 @@ } } -/// Response for ValidateInstaller method\] -/// \[spectrum.sas.portal.v1alpha1.DeviceManager.ValidateInstaller\]. +/// Response for ValidateInstaller. class SasPortalValidateInstallerResponse { SasPortalValidateInstallerResponse();
diff --git a/generated/googleapis_beta/lib/pubsub/v1beta2.dart b/generated/googleapis_beta/lib/pubsub/v1beta2.dart deleted file mode 100644 index 5521fb2..0000000 --- a/generated/googleapis_beta/lib/pubsub/v1beta2.dart +++ /dev/null
@@ -1,2417 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Pub/Sub API - v1beta2 -/// -/// Provides reliable, many-to-many, asynchronous messaging between -/// applications. -/// -/// For more information, see <https://cloud.google.com/pubsub/docs> -/// -/// Create an instance of [PubsubApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsSubscriptionsResource] -/// - [ProjectsTopicsResource] -/// - [ProjectsTopicsSubscriptionsResource] -library pubsub.v1beta2; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Provides reliable, many-to-many, asynchronous messaging between -/// applications. -class PubsubApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// View and manage Pub/Sub topics and subscriptions - static const pubsubScope = 'https://www.googleapis.com/auth/pubsub'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - PubsubApi(http.Client client, - {core.String rootUrl = 'https://pubsub.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsSubscriptionsResource get subscriptions => - ProjectsSubscriptionsResource(_requester); - ProjectsTopicsResource get topics => ProjectsTopicsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsSubscriptionsResource { - final commons.ApiRequester _requester; - - ProjectsSubscriptionsResource(commons.ApiRequester client) - : _requester = client; - - /// Acknowledges the messages associated with the `ack_ids` in the - /// `AcknowledgeRequest`. - /// - /// The Pub/Sub system can remove the relevant messages from the subscription. - /// Acknowledging a message whose ack deadline has expired may succeed, but - /// such a message may be redelivered later. Acknowledging a message more than - /// once will not result in an error. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [subscription] - The subscription whose message is being acknowledged. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> acknowledge( - AcknowledgeRequest request, - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$subscription') + - ':acknowledge'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a subscription to a given topic. - /// - /// If the subscription already exists, returns `ALREADY_EXISTS`. If the - /// corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not - /// provided in the request, the server will assign a random name for this - /// subscription on the same project as the topic. Note that for REST API - /// requests, you must specify a name. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the subscription. It must have the format - /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - /// start with a letter, and contain only letters (`[A-Za-z]`), numbers - /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - /// in length, and it must not start with `"goog"`. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Subscription]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Subscription> create( - Subscription request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Subscription.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes an existing subscription. - /// - /// All pending messages in the subscription are immediately dropped. Calls to - /// `Pull` after deletion will return `NOT_FOUND`. After a subscription is - /// deleted, a new one may be created with the same name, but the new one has - /// no association with the old subscription, or its topic unless the same - /// topic is specified. - /// - /// Request parameters: - /// - /// [subscription] - The subscription to delete. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$subscription'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the configuration details of a subscription. - /// - /// Request parameters: - /// - /// [subscription] - The name of the subscription to get. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Subscription]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Subscription> get( - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$subscription'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - Subscription.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for a resource. - /// - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists matching subscriptions. - /// - /// Request parameters: - /// - /// [project] - The name of the cloud project that subscriptions belong to. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [pageSize] - Maximum number of subscriptions to return. - /// - /// [pageToken] - The value returned by the last `ListSubscriptionsResponse`; - /// indicates that this is a continuation of a prior `ListSubscriptions` call, - /// and that the system should return the next page of data. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListSubscriptionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListSubscriptionsResponse> list( - core.String project, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (project == null) { - throw core.ArgumentError('Parameter project is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$project') + - '/subscriptions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListSubscriptionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Modifies the ack deadline for a specific message. - /// - /// This method is useful to indicate that more time is needed to process a - /// message by the subscriber, or to make the message available for redelivery - /// if the processing was interrupted. Note that this does not modify the - /// subscription-level `ackDeadlineSeconds` used for subsequent messages. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [subscription] - The name of the subscription. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> modifyAckDeadline( - ModifyAckDeadlineRequest request, - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$subscription') + - ':modifyAckDeadline'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Modifies the `PushConfig` for a specified subscription. - /// - /// This may be used to change a push subscription to a pull one (signified by - /// an empty `PushConfig`) or vice versa, or change the endpoint URL and other - /// attributes of a push subscription. Messages will accumulate for delivery - /// continuously through the call regardless of changes to the `PushConfig`. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [subscription] - The name of the subscription. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> modifyPushConfig( - ModifyPushConfigRequest request, - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$subscription') + - ':modifyPushConfig'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Pulls messages from the server. - /// - /// Returns an empty list if there are no messages available in the backlog. - /// The server may return `UNAVAILABLE` if there are too many concurrent pull - /// requests pending for the given subscription. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [subscription] - The subscription from which messages should be pulled. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PullResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PullResponse> pull( - PullRequest request, - core.String subscription, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (subscription == null) { - throw core.ArgumentError('Parameter subscription is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$subscription') + - ':pull'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - PullResponse.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on the specified resource. - /// - /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, - /// and `PERMISSION_DENIED` errors. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/subscriptions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsTopicsResource { - final commons.ApiRequester _requester; - - ProjectsTopicsSubscriptionsResource get subscriptions => - ProjectsTopicsSubscriptionsResource(_requester); - - ProjectsTopicsResource(commons.ApiRequester client) : _requester = client; - - /// Creates the given topic with the given name. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the topic. It must have the format - /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - /// signs (`%`). It must be between 3 and 255 characters in length, and it - /// must not start with `"goog"`. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Topic]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Topic> create( - Topic request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Topic.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the topic with the given name. - /// - /// Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, - /// a new topic may be created with the same name; this is an entirely new - /// topic with none of the old configuration or subscriptions. Existing - /// subscriptions to this topic are not deleted, but their `topic` field is - /// set to `_deleted-topic_`. - /// - /// Request parameters: - /// - /// [topic] - Name of the topic to delete. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String topic, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (topic == null) { - throw core.ArgumentError('Parameter topic is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$topic'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the configuration of a topic. - /// - /// Request parameters: - /// - /// [topic] - The name of the topic to get. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Topic]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Topic> get( - core.String topic, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (topic == null) { - throw core.ArgumentError('Parameter topic is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + commons.Escaper.ecapeVariableReserved('$topic'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Topic.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for a resource. - /// - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists matching topics. - /// - /// Request parameters: - /// - /// [project] - The name of the cloud project that topics belong to. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [pageSize] - Maximum number of topics to return. - /// - /// [pageToken] - The value returned by the last `ListTopicsResponse`; - /// indicates that this is a continuation of a prior `ListTopics` call, and - /// that the system should return the next page of data. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListTopicsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListTopicsResponse> list( - core.String project, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (project == null) { - throw core.ArgumentError('Parameter project is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$project') + - '/topics'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListTopicsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Adds one or more messages to the topic. - /// - /// Returns `NOT_FOUND` if the topic does not exist. The message payload must - /// not be empty; it must contain either a non-empty data field, or at least - /// one attribute. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [topic] - The messages in the request will be published on this topic. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [PublishResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<PublishResponse> publish( - PublishRequest request, - core.String topic, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (topic == null) { - throw core.ArgumentError('Parameter topic is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$topic') + - ':publish'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - PublishResponse.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on the specified resource. - /// - /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, - /// and `PERMISSION_DENIED` errors. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsTopicsSubscriptionsResource { - final commons.ApiRequester _requester; - - ProjectsTopicsSubscriptionsResource(commons.ApiRequester client) - : _requester = client; - - /// Lists the name of the subscriptions for this topic. - /// - /// Request parameters: - /// - /// [topic] - The name of the topic that subscriptions are attached to. - /// Value must have pattern `^projects/\[^/\]+/topics/\[^/\]+$`. - /// - /// [pageSize] - Maximum number of subscription names to return. - /// - /// [pageToken] - The value returned by the last - /// `ListTopicSubscriptionsResponse`; indicates that this is a continuation of - /// a prior `ListTopicSubscriptions` call, and that the system should return - /// the next page of data. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListTopicSubscriptionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListTopicSubscriptionsResponse> list( - core.String topic, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (topic == null) { - throw core.ArgumentError('Parameter topic is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta2/' + - commons.Escaper.ecapeVariableReserved('$topic') + - '/subscriptions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListTopicSubscriptionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Request for the Acknowledge method. -class AcknowledgeRequest { - /// The acknowledgment ID for the messages being acknowledged that was - /// returned by the Pub/Sub system in the `Pull` response. - /// - /// Must not be empty. - core.List<core.String> ackIds; - - AcknowledgeRequest(); - - AcknowledgeRequest.fromJson(core.Map _json) { - if (_json.containsKey('ackIds')) { - ackIds = (_json['ackIds'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ackIds != null) { - _json['ackIds'] = ackIds; - } - return _json; - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Response for the `ListSubscriptions` method. -class ListSubscriptionsResponse { - /// If not empty, indicates that there may be more subscriptions that match - /// the request; this value should be passed in a new - /// `ListSubscriptionsRequest` to get more subscriptions. - core.String nextPageToken; - - /// The subscriptions that match the request. - core.List<Subscription> subscriptions; - - ListSubscriptionsResponse(); - - ListSubscriptionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('subscriptions')) { - subscriptions = (_json['subscriptions'] as core.List) - .map<Subscription>((value) => Subscription.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (subscriptions != null) { - _json['subscriptions'] = - subscriptions.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response for the `ListTopicSubscriptions` method. -class ListTopicSubscriptionsResponse { - /// If not empty, indicates that there may be more subscriptions that match - /// the request; this value should be passed in a new - /// `ListTopicSubscriptionsRequest` to get more subscriptions. - core.String nextPageToken; - - /// The names of the subscriptions that match the request. - core.List<core.String> subscriptions; - - ListTopicSubscriptionsResponse(); - - ListTopicSubscriptionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('subscriptions')) { - subscriptions = (_json['subscriptions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (subscriptions != null) { - _json['subscriptions'] = subscriptions; - } - return _json; - } -} - -/// Response for the `ListTopics` method. -class ListTopicsResponse { - /// If not empty, indicates that there may be more topics that match the - /// request; this value should be passed in a new `ListTopicsRequest`. - core.String nextPageToken; - - /// The resulting topics. - core.List<Topic> topics; - - ListTopicsResponse(); - - ListTopicsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('topics')) { - topics = (_json['topics'] as core.List) - .map<Topic>((value) => - Topic.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (topics != null) { - _json['topics'] = topics.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Request for the ModifyAckDeadline method. -class ModifyAckDeadlineRequest { - /// The new ack deadline with respect to the time this request was sent to the - /// Pub/Sub system. - /// - /// Must be >= 0. For example, if the value is 10, the new ack deadline will - /// expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying - /// zero may immediately make the message available for another pull request. - core.int ackDeadlineSeconds; - - /// The acknowledgment ID. - /// - /// Either this or ack_ids must be populated, but not both. - core.String ackId; - - /// List of acknowledgment IDs. - core.List<core.String> ackIds; - - ModifyAckDeadlineRequest(); - - ModifyAckDeadlineRequest.fromJson(core.Map _json) { - if (_json.containsKey('ackDeadlineSeconds')) { - ackDeadlineSeconds = _json['ackDeadlineSeconds'] as core.int; - } - if (_json.containsKey('ackId')) { - ackId = _json['ackId'] as core.String; - } - if (_json.containsKey('ackIds')) { - ackIds = (_json['ackIds'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ackDeadlineSeconds != null) { - _json['ackDeadlineSeconds'] = ackDeadlineSeconds; - } - if (ackId != null) { - _json['ackId'] = ackId; - } - if (ackIds != null) { - _json['ackIds'] = ackIds; - } - return _json; - } -} - -/// Request for the ModifyPushConfig method. -class ModifyPushConfigRequest { - /// The push configuration for future deliveries. - /// - /// An empty `pushConfig` indicates that the Pub/Sub system should stop - /// pushing messages from the given subscription and allow messages to be - /// pulled and acknowledged - effectively pausing the subscription if `Pull` - /// is not called. - PushConfig pushConfig; - - ModifyPushConfigRequest(); - - ModifyPushConfigRequest.fromJson(core.Map _json) { - if (_json.containsKey('pushConfig')) { - pushConfig = PushConfig.fromJson( - _json['pushConfig'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (pushConfig != null) { - _json['pushConfig'] = pushConfig.toJson(); - } - return _json; - } -} - -/// Contains information needed for generating an -/// [OpenID Connect token](https://developers.google.com/identity/protocols/OpenIDConnect). -class OidcToken { - /// Audience to be used when generating OIDC token. - /// - /// The audience claim identifies the recipients that the JWT is intended for. - /// The audience value is a single case-sensitive string. Having multiple - /// values (array) for the audience field is not supported. More info about - /// the OIDC JWT token audience here: - /// https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - /// the Push endpoint URL will be used. - core.String audience; - - /// [Service account email](https://cloud.google.com/iam/docs/service-accounts) - /// to be used for generating the OIDC token. - /// - /// The caller (for CreateSubscription, UpdateSubscription, and - /// ModifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission - /// for the service account. - core.String serviceAccountEmail; - - OidcToken(); - - OidcToken.fromJson(core.Map _json) { - if (_json.containsKey('audience')) { - audience = _json['audience'] as core.String; - } - if (_json.containsKey('serviceAccountEmail')) { - serviceAccountEmail = _json['serviceAccountEmail'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (audience != null) { - _json['audience'] = audience; - } - if (serviceAccountEmail != null) { - _json['serviceAccountEmail'] = serviceAccountEmail; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// Request for the Publish method. -class PublishRequest { - /// The messages to publish. - core.List<PubsubMessage> messages; - - PublishRequest(); - - PublishRequest.fromJson(core.Map _json) { - if (_json.containsKey('messages')) { - messages = (_json['messages'] as core.List) - .map<PubsubMessage>((value) => PubsubMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (messages != null) { - _json['messages'] = messages.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response for the `Publish` method. -class PublishResponse { - /// The server-assigned ID of each published message, in the same order as the - /// messages in the request. - /// - /// IDs are guaranteed to be unique within the topic. - core.List<core.String> messageIds; - - PublishResponse(); - - PublishResponse.fromJson(core.Map _json) { - if (_json.containsKey('messageIds')) { - messageIds = (_json['messageIds'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (messageIds != null) { - _json['messageIds'] = messageIds; - } - return _json; - } -} - -/// A message data and its attributes. -/// -/// The message payload must not be empty; it must contain either a non-empty -/// data field, or at least one attribute. -class PubsubMessage { - /// Optional attributes for this message. - core.Map<core.String, core.String> attributes; - - /// The message payload. - /// - /// For JSON requests, the value of this field must be - /// \[base64-encoded\](https://tools.ietf.org/html/rfc4648). - core.String data; - core.List<core.int> get dataAsBytes => convert.base64.decode(data); - - set dataAsBytes(core.List<core.int> _bytes) { - data = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// ID of this message, assigned by the server when the message is published. - /// - /// Guaranteed to be unique within the topic. This value may be read by a - /// subscriber that receives a `PubsubMessage` via a `Pull` call or a push - /// delivery. It must not be populated by the publisher in a `Publish` call. - core.String messageId; - - /// The time at which the message was published, populated by the server when - /// it receives the `Publish` call. - /// - /// It must not be populated by the publisher in a `Publish` call. - core.String publishTime; - - PubsubMessage(); - - PubsubMessage.fromJson(core.Map _json) { - if (_json.containsKey('attributes')) { - attributes = (_json['attributes'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('data')) { - data = _json['data'] as core.String; - } - if (_json.containsKey('messageId')) { - messageId = _json['messageId'] as core.String; - } - if (_json.containsKey('publishTime')) { - publishTime = _json['publishTime'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (attributes != null) { - _json['attributes'] = attributes; - } - if (data != null) { - _json['data'] = data; - } - if (messageId != null) { - _json['messageId'] = messageId; - } - if (publishTime != null) { - _json['publishTime'] = publishTime; - } - return _json; - } -} - -/// Request for the `Pull` method. -class PullRequest { - /// The maximum number of messages returned for this request. - /// - /// The Pub/Sub system may return fewer than the number specified. - core.int maxMessages; - - /// If this is specified as true the system will respond immediately even if - /// it is not able to return a message in the `Pull` response. - /// - /// Otherwise the system is allowed to wait until at least one message is - /// available rather than returning no messages. The client may cancel the - /// request if it does not wish to wait any longer for the response. Warning: - /// setting this field to `true` is discouraged because it adversely impacts - /// the performance of `Pull` operations. We recommend that users do not set - /// this field. - /// - /// Optional. - core.bool returnImmediately; - - PullRequest(); - - PullRequest.fromJson(core.Map _json) { - if (_json.containsKey('maxMessages')) { - maxMessages = _json['maxMessages'] as core.int; - } - if (_json.containsKey('returnImmediately')) { - returnImmediately = _json['returnImmediately'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (maxMessages != null) { - _json['maxMessages'] = maxMessages; - } - if (returnImmediately != null) { - _json['returnImmediately'] = returnImmediately; - } - return _json; - } -} - -/// Response for the `Pull` method. -class PullResponse { - /// Received Pub/Sub messages. - /// - /// The Pub/Sub system will return zero messages if there are no more - /// available in the backlog. The Pub/Sub system may return fewer than the - /// `maxMessages` requested even if there are more messages available in the - /// backlog. - core.List<ReceivedMessage> receivedMessages; - - PullResponse(); - - PullResponse.fromJson(core.Map _json) { - if (_json.containsKey('receivedMessages')) { - receivedMessages = (_json['receivedMessages'] as core.List) - .map<ReceivedMessage>((value) => ReceivedMessage.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (receivedMessages != null) { - _json['receivedMessages'] = - receivedMessages.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Configuration for a push delivery endpoint. -class PushConfig { - /// Endpoint configuration attributes. - /// - /// Every endpoint has a set of API supported attributes that can be used to - /// control different aspects of the message delivery. The currently supported - /// attribute is `x-goog-version`, which you can use to change the format of - /// the push message. This attribute indicates the version of the data - /// expected by the endpoint. This controls the shape of the envelope (i.e. - /// its fields and metadata). The endpoint version is based on the version of - /// the Pub/Sub API. If not present during the `CreateSubscription` call, it - /// will default to the version of the API used to make such call. If not - /// present during a `ModifyPushConfig` call, its value will not be changed. - /// `GetSubscription` calls will always return a valid version, even if the - /// subscription was created without this attribute. The possible values for - /// this attribute are: * `v1beta1`: uses the push format defined in the - /// v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in - /// the v1 Pub/Sub API. - core.Map<core.String, core.String> attributes; - - /// If specified, Pub/Sub will generate and attach an OIDC JWT token as an - /// `Authorization` header in the HTTP request for every pushed message. - OidcToken oidcToken; - - /// A URL locating the endpoint to which messages should be pushed. - /// - /// For example, a Webhook endpoint might use "https://example.com/push". - core.String pushEndpoint; - - PushConfig(); - - PushConfig.fromJson(core.Map _json) { - if (_json.containsKey('attributes')) { - attributes = (_json['attributes'] as core.Map) - .cast<core.String, core.String>() - .map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('oidcToken')) { - oidcToken = OidcToken.fromJson( - _json['oidcToken'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('pushEndpoint')) { - pushEndpoint = _json['pushEndpoint'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (attributes != null) { - _json['attributes'] = attributes; - } - if (oidcToken != null) { - _json['oidcToken'] = oidcToken.toJson(); - } - if (pushEndpoint != null) { - _json['pushEndpoint'] = pushEndpoint; - } - return _json; - } -} - -/// A message and its corresponding acknowledgment ID. -class ReceivedMessage { - /// This ID can be used to acknowledge the received message. - core.String ackId; - - /// The message. - PubsubMessage message; - - ReceivedMessage(); - - ReceivedMessage.fromJson(core.Map _json) { - if (_json.containsKey('ackId')) { - ackId = _json['ackId'] as core.String; - } - if (_json.containsKey('message')) { - message = PubsubMessage.fromJson( - _json['message'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ackId != null) { - _json['ackId'] = ackId; - } - if (message != null) { - _json['message'] = message.toJson(); - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - return _json; - } -} - -/// A subscription resource. -class Subscription { - /// This value is the maximum time after a subscriber receives a message - /// before the subscriber should acknowledge the message. - /// - /// After message delivery but before the ack deadline expires and before the - /// message is acknowledged, it is an outstanding message and will not be - /// delivered again during that time (on a best-effort basis). For pull - /// subscriptions, this value is used as the initial value for the ack - /// deadline. To override this value for a given message, call - /// `ModifyAckDeadline` with the corresponding `ack_id` if using pull. The - /// maximum custom deadline you can specify is 600 seconds (10 minutes). For - /// push delivery, this value is also used to set the request timeout for the - /// call to the push endpoint. If the subscriber never acknowledges the - /// message, the Pub/Sub system will eventually redeliver the message. If this - /// parameter is 0, a default value of 10 seconds is used. - core.int ackDeadlineSeconds; - - /// The name of the subscription. - /// - /// It must have the format - /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - /// start with a letter, and contain only letters (`[A-Za-z]`), numbers - /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - /// in length, and it must not start with `"goog"`. - core.String name; - - /// If push delivery is used with this subscription, this field is used to - /// configure it. - /// - /// An empty `pushConfig` signifies that the subscriber will pull and ack - /// messages using API methods. - PushConfig pushConfig; - - /// The name of the topic from which this subscription is receiving messages. - /// - /// The value of this field will be `_deleted-topic_` if the topic has been - /// deleted. - core.String topic; - - Subscription(); - - Subscription.fromJson(core.Map _json) { - if (_json.containsKey('ackDeadlineSeconds')) { - ackDeadlineSeconds = _json['ackDeadlineSeconds'] as core.int; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('pushConfig')) { - pushConfig = PushConfig.fromJson( - _json['pushConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('topic')) { - topic = _json['topic'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ackDeadlineSeconds != null) { - _json['ackDeadlineSeconds'] = ackDeadlineSeconds; - } - if (name != null) { - _json['name'] = name; - } - if (pushConfig != null) { - _json['pushConfig'] = pushConfig.toJson(); - } - if (topic != null) { - _json['topic'] = topic; - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// A topic resource. -class Topic { - /// The name of the topic. - /// - /// It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` - /// must start with a letter, and contain only letters (`[A-Za-z]`), numbers - /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - /// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - /// in length, and it must not start with `"goog"`. - core.String name; - - Topic(); - - Topic.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/recommendationengine/v1beta1.dart b/generated/googleapis_beta/lib/recommendationengine/v1beta1.dart new file mode 100644 index 0000000..6dcb2ef --- /dev/null +++ b/generated/googleapis_beta/lib/recommendationengine/v1beta1.dart
@@ -0,0 +1,4752 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Recommendations AI (Beta) - v1beta1 +/// +/// Note that we now highly recommend new customers to use Retail API, which +/// incorporates the GA version of the Recommendations AI funtionalities. To +/// enable Retail API, please visit +/// https://console.cloud.google.com/apis/library/retail.googleapis.com. The +/// Recommendations AI service enables customers to build end-to-end +/// personalized recommendation systems without requiring a high level of +/// expertise in machine learning, recommendation system, or Google Cloud. +/// +/// For more information, see <https://cloud.google.com/recommendations-ai/docs> +/// +/// Create an instance of [RecommendationsAIApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsCatalogsResource] +/// - [ProjectsLocationsCatalogsCatalogItemsResource] +/// - [ProjectsLocationsCatalogsEventStoresResource] +/// - [ProjectsLocationsCatalogsEventStoresOperationsResource] +/// - [ProjectsLocationsCatalogsEventStoresPlacementsResource] +/// - +/// [ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsResource] +/// - [ProjectsLocationsCatalogsEventStoresUserEventsResource] +/// - [ProjectsLocationsCatalogsOperationsResource] +library recommendationengine.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Note that we now highly recommend new customers to use Retail API, which +/// incorporates the GA version of the Recommendations AI funtionalities. +/// +/// To enable Retail API, please visit +/// https://console.cloud.google.com/apis/library/retail.googleapis.com. The +/// Recommendations AI service enables customers to build end-to-end +/// personalized recommendation systems without requiring a high level of +/// expertise in machine learning, recommendation system, or Google Cloud. +class RecommendationsAIApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + RecommendationsAIApi(http.Client client, + {core.String rootUrl = 'https://recommendationengine.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsResource get catalogs => + ProjectsLocationsCatalogsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsCatalogsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsCatalogItemsResource get catalogItems => + ProjectsLocationsCatalogsCatalogItemsResource(_requester); + ProjectsLocationsCatalogsEventStoresResource get eventStores => + ProjectsLocationsCatalogsEventStoresResource(_requester); + ProjectsLocationsCatalogsOperationsResource get operations => + ProjectsLocationsCatalogsOperationsResource(_requester); + + ProjectsLocationsCatalogsResource(commons.ApiRequester client) + : _requester = client; + + /// Lists all the catalog configurations associated with the project. + /// + /// Request parameters: + /// + /// [parent] - Required. The account resource name with an associated + /// location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [pageSize] - Optional. Maximum number of results to return. If + /// unspecified, defaults to 50. Max allowed value is 1000. + /// + /// [pageToken] - Optional. A page token, received from a previous + /// `ListCatalogs` call. Provide this to retrieve the subsequent page. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudRecommendationengineV1beta1ListCatalogsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1ListCatalogsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/catalogs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudRecommendationengineV1beta1ListCatalogsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates the catalog configuration. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The fully qualified resource name of the catalog. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+$`. + /// + /// [updateMask] - Optional. Indicates which fields in the provided 'catalog' + /// to update. If not set, will only update the catalog_item_level_config + /// field. Currently only fields that can be updated are + /// catalog_item_level_config. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1Catalog]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1Catalog> patch( + GoogleCloudRecommendationengineV1beta1Catalog request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1Catalog.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsCatalogItemsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsCatalogItemsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a catalog item. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent catalog resource name, such as "projects / + /// * /locations/global/catalogs/default_catalog". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1CatalogItem]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1CatalogItem> create( + GoogleCloudRecommendationengineV1beta1CatalogItem request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/catalogItems'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a catalog item. + /// + /// Request parameters: + /// + /// [name] - Required. Full resource name of catalog item, such as "projects / + /// * + /// /locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/catalogItems/.*$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets a specific catalog item. + /// + /// Request parameters: + /// + /// [name] - Required. Full resource name of catalog item, such as "projects / + /// * + /// /locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/catalogItems/.*$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1CatalogItem]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1CatalogItem> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Bulk import of multiple catalog items. + /// + /// Request processing may be synchronous. No partial updating supported. + /// Non-existing items will be created. Operation.response is of type + /// ImportResponse. Note that it is possible for a subset of the items to be + /// successfully updated. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. + /// "projects/1234/locations/global/catalogs/default_catalog" If no updateMask + /// is specified, requires catalogItems.create permission. If updateMask is + /// specified, requires catalogItems.update permission. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> import( + GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/catalogItems:import'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets a list of catalog items. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent catalog resource name, such as "projects / + /// * /locations/global/catalogs/default_catalog". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+$`. + /// + /// [filter] - Optional. A filter to apply on the list results. + /// + /// [pageSize] - Optional. Maximum number of results to return per page. If + /// zero, the service will choose a reasonable default. + /// + /// [pageToken] - Optional. The previous + /// ListCatalogItemsResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse> + list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/catalogItems'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse + .fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates a catalog item. + /// + /// Partial updating is supported. Non-existing items will be created. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Full resource name of catalog item, such as "projects / + /// * + /// /locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/catalogItems/.*$`. + /// + /// [updateMask] - Optional. Indicates which fields in the provided 'item' to + /// update. If not set, will by default update all fields. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1CatalogItem]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1CatalogItem> patch( + GoogleCloudRecommendationengineV1beta1CatalogItem request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsEventStoresResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsEventStoresOperationsResource get operations => + ProjectsLocationsCatalogsEventStoresOperationsResource(_requester); + ProjectsLocationsCatalogsEventStoresPlacementsResource get placements => + ProjectsLocationsCatalogsEventStoresPlacementsResource(_requester); + ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsResource + get predictionApiKeyRegistrations => + ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsResource( + _requester); + ProjectsLocationsCatalogsEventStoresUserEventsResource get userEvents => + ProjectsLocationsCatalogsEventStoresUserEventsResource(_requester); + + ProjectsLocationsCatalogsEventStoresResource(commons.ApiRequester client) + : _requester = client; +} + +class ProjectsLocationsCatalogsEventStoresOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsEventStoresOperationsResource( + commons.ApiRequester client) + : _requester = client; + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsEventStoresPlacementsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsEventStoresPlacementsResource( + commons.ApiRequester client) + : _requester = client; + + /// Makes a recommendation prediction. + /// + /// If using API Key based authentication, the API Key must be registered + /// using the PredictionApiKeyRegistry service. + /// [Learn more](https://cloud.google.com/recommendations-ai/docs/setting-up#register-key). + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Full resource name of the format: {name=projects / * + /// /locations/global/catalogs/default_catalog/eventStores/default_event_store/placements + /// / * } The id of the recommendation engine placement. This id is used to + /// identify the set of models that will be used to make the prediction. We + /// currently support three placements with the following IDs by default: * + /// `shopping_cart`: Predicts items frequently bought together with one or + /// more catalog items in the same shopping session. Commonly displayed after + /// `add-to-cart` events, on product detail pages, or on the shopping cart + /// page. * `home_page`: Predicts the next product that a user will most + /// likely engage with or purchase based on the shopping or viewing history of + /// the specified `userId` or `visitorId`. For example - Recommendations for + /// you. * `product_detail`: Predicts the next product that a user will most + /// likely engage with or purchase. The prediction is based on the shopping or + /// viewing history of the specified `userId` or `visitorId` and its relevance + /// to a specified `CatalogItem`. Typically used on product detail pages. For + /// example - More items like this. * `recently_viewed_default`: Returns up to + /// 75 items recently viewed by the specified `userId` or `visitorId`, most + /// recent ones first. Returns nothing if neither of them has viewed any items + /// yet. For example - Recently viewed. The full list of available placements + /// can be seen at + /// https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+/placements/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1PredictResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1PredictResponse> predict( + GoogleCloudRecommendationengineV1beta1PredictRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + ':predict'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1PredictResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrationsResource( + commons.ApiRequester client) + : _requester = client; + + /// Register an API key for use with predict method. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource path. "projects / * + /// /locations/global/catalogs/default_catalog/eventStores/default_event_store". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future< + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration> + create( + GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest + request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/predictionApiKeyRegistrations'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration + .fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Unregister an apiKey from using for predict method. + /// + /// Request parameters: + /// + /// [name] - Required. The API key to unregister including full resource path. + /// "projects / * + /// /locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/" + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+/predictionApiKeyRegistrations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleProtobufEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleProtobufEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleProtobufEmpty.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// List the registered apiKeys for use with predict method. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent placement resource name such as + /// "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [pageSize] - Optional. Maximum number of results to return per page. If + /// unset, the service will choose a reasonable default. + /// + /// [pageToken] - Optional. The previous + /// `ListPredictionApiKeyRegistration.nextPageToken`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future< + GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse> + list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/predictionApiKeyRegistrations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse + .fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsEventStoresUserEventsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsEventStoresUserEventsResource( + commons.ApiRequester client) + : _requester = client; + + /// Writes a single user event from the browser. + /// + /// This uses a GET request to due to browser restriction of POST-ing to a 3rd + /// party domain. This method is used only by the Recommendations AI + /// JavaScript pixel. Users should not call this method directly. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent eventStore name, such as + /// "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [ets] - Optional. The event timestamp in milliseconds. This prevents + /// browser caching of otherwise identical get requests. The name is + /// abbreviated to reduce the payload bytes. + /// + /// [uri] - Optional. The url including cgi-parameters but excluding the hash + /// fragment. The URL must be truncated to 1.5K bytes to conservatively be + /// under the 2K bytes. This is often more useful than the referer url, + /// because many browsers only send the domain for 3rd party requests. + /// + /// [userEvent] - Required. URL encoded UserEvent proto. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleApiHttpBody]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleApiHttpBody> collect( + core.String parent, { + core.String ets, + core.String uri, + core.String userEvent, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (ets != null) { + _queryParams['ets'] = [ets]; + } + if (uri != null) { + _queryParams['uri'] = [uri]; + } + if (userEvent != null) { + _queryParams['userEvent'] = [userEvent]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents:collect'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleApiHttpBody.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Bulk import of User events. + /// + /// Request processing might be synchronous. Events that already exist are + /// skipped. Use this method for backfilling historical user events. + /// Operation.response is of type ImportResponse. Note that it is possible for + /// a subset of the items to be successfully inserted. Operation.metadata is + /// of type ImportMetadata. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. + /// "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store" + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> import( + GoogleCloudRecommendationengineV1beta1ImportUserEventsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents:import'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets a list of user events within a time range, with potential filtering. + /// + /// The method does not list unjoined user events. Unjoined user event + /// definition: when a user event is ingested from Recommendations AI User + /// Event APIs, the catalog item included in the user event is connected with + /// the current catalog. If a catalog item of the ingested event is not in the + /// current catalog, it could lead to degraded model quality. This is called + /// an unjoined event. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent eventStore resource name, such as + /// "projects / * /locations / * + /// /catalogs/default_catalog/eventStores/default_event_store". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [filter] - Optional. Filtering expression to specify restrictions over + /// returned events. This is a sequence of terms, where each term applies some + /// kind of a restriction to the returned user events. Use this expression to + /// restrict results to a specific time range, or filter events by eventType. + /// eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + /// eventTime<"2012-04-23T18:25:43.511Z" eventType=search We expect only 3 + /// types of fields: * eventTime: this can be specified a maximum of 2 times, + /// once with a less than operator and once with a greater than operator. The + /// eventTime restrict should result in one contiguous valid eventTime range. + /// * eventType: only 1 eventType restriction can be specified. * + /// eventsMissingCatalogItems: specififying this will restrict results to + /// events for which catalog items were not found in the catalog. The default + /// behavior is to return only those events for which catalog items were + /// found. Some examples of valid filters expressions: * Example 1: eventTime + /// > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" * + /// Example 2: eventTime > "2012-04-23T18:25:43.511Z" eventType = + /// detail-page-view * Example 3: eventsMissingCatalogItems eventType = search + /// eventTime < "2018-04-23T18:30:43.511Z" * Example 4: eventTime > + /// "2012-04-23T18:25:43.511Z" * Example 5: eventType = search * Example 6: + /// eventsMissingCatalogItems + /// + /// [pageSize] - Optional. Maximum number of results to return per page. If + /// zero, the service will choose a reasonable default. + /// + /// [pageToken] - Optional. The previous + /// ListUserEventsResponse.next_page_token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a + /// [GoogleCloudRecommendationengineV1beta1ListUserEventsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1ListUserEventsResponse> + list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + GoogleCloudRecommendationengineV1beta1ListUserEventsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes permanently all user events specified by the filter provided. + /// + /// Depending on the number of events specified by the filter, this operation + /// could take hours or days to complete. To test a filter, use the list + /// command first. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The resource name of the event_store under which the + /// events are created. The format is + /// "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}" + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> purge( + GoogleCloudRecommendationengineV1beta1PurgeUserEventsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents:purge'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Triggers a user event rejoin operation with latest catalog data. + /// + /// Events will not be annotated with detailed catalog information if catalog + /// item is missing at the time the user event is ingested, and these events + /// are stored as unjoined events with a limited usage on training and + /// serving. This API can be used to trigger a 'join' operation on specified + /// events with latest version of catalog items. It can also be used to + /// correct events joined with wrong catalog items. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Full resource name of user event, such as "projects / + /// * /locations / * + /// /catalogs/default_catalog/eventStores/default_event_store". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> rejoin( + GoogleCloudRecommendationengineV1beta1RejoinUserEventsRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents:rejoin'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Writes a single user event. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent eventStore resource name, such as + /// "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store". + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/eventStores/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleCloudRecommendationengineV1beta1UserEvent]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleCloudRecommendationengineV1beta1UserEvent> write( + GoogleCloudRecommendationengineV1beta1UserEvent request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/userEvents:write'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleCloudRecommendationengineV1beta1UserEvent.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsCatalogsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsCatalogsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningOperation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningOperation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningOperation.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [GoogleLongrunningListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<GoogleLongrunningListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => GoogleLongrunningListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Message that represents an arbitrary HTTP body. +/// +/// It should only be used for payload formats that can't be represented as +/// JSON, such as raw binary or an HTML page. This message can be used both in +/// streaming and non-streaming API methods in the request as well as the +/// response. It can be used as a top-level request field, which is convenient +/// if one wants to extract parameters from either the URL or HTTP template into +/// the request fields and also want access to the raw HTTP body. Example: +/// message GetResourceRequest { // A unique request id. string request_id = 1; +/// // The raw HTTP body is bound to this field. google.api.HttpBody http_body = +/// 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns +/// (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns +/// (google.protobuf.Empty); } Example with streaming methods: service +/// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream +/// google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns +/// (stream google.api.HttpBody); } Use of this type only changes how the +/// request and response bodies are handled, all other features will continue to +/// work unchanged. +class GoogleApiHttpBody { + /// The HTTP Content-Type header value specifying the content type of the + /// body. + core.String contentType; + + /// The HTTP request/response body as raw binary. + core.String data; + core.List<core.int> get dataAsBytes => convert.base64.decode(data); + + set dataAsBytes(core.List<core.int> _bytes) { + data = + convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); + } + + /// Application specific response metadata. + /// + /// Must be set in the first response for streaming APIs. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> extensions; + + GoogleApiHttpBody(); + + GoogleApiHttpBody.fromJson(core.Map _json) { + if (_json.containsKey('contentType')) { + contentType = _json['contentType'] as core.String; + } + if (_json.containsKey('data')) { + data = _json['data'] as core.String; + } + if (_json.containsKey('extensions')) { + extensions = (_json['extensions'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (contentType != null) { + _json['contentType'] = contentType; + } + if (data != null) { + _json['data'] = data; + } + if (extensions != null) { + _json['extensions'] = extensions; + } + return _json; + } +} + +/// Metadata for TriggerCatalogRejoin method. +class GoogleCloudRecommendationengineV1alphaRejoinCatalogMetadata { + GoogleCloudRecommendationengineV1alphaRejoinCatalogMetadata(); + + GoogleCloudRecommendationengineV1alphaRejoinCatalogMetadata.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Response message for TriggerCatalogRejoin method. +class GoogleCloudRecommendationengineV1alphaRejoinCatalogResponse { + /// Number of user events that were joined with latest catalog items. + core.String rejoinedUserEventsCount; + + GoogleCloudRecommendationengineV1alphaRejoinCatalogResponse(); + + GoogleCloudRecommendationengineV1alphaRejoinCatalogResponse.fromJson( + core.Map _json) { + if (_json.containsKey('rejoinedUserEventsCount')) { + rejoinedUserEventsCount = _json['rejoinedUserEventsCount'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (rejoinedUserEventsCount != null) { + _json['rejoinedUserEventsCount'] = rejoinedUserEventsCount; + } + return _json; + } +} + +/// Metadata associated with a tune operation. +class GoogleCloudRecommendationengineV1alphaTuningMetadata { + /// The resource name of the recommendation model that this tune applies to. + /// + /// Format: + /// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/eventStores/{event_store_id}/recommendationModels/{recommendation_model_id} + core.String recommendationModel; + + GoogleCloudRecommendationengineV1alphaTuningMetadata(); + + GoogleCloudRecommendationengineV1alphaTuningMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('recommendationModel')) { + recommendationModel = _json['recommendationModel'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (recommendationModel != null) { + _json['recommendationModel'] = recommendationModel; + } + return _json; + } +} + +/// Response associated with a tune operation. +class GoogleCloudRecommendationengineV1alphaTuningResponse { + GoogleCloudRecommendationengineV1alphaTuningResponse(); + + GoogleCloudRecommendationengineV1alphaTuningResponse.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// BigQuery source import data from. +class GoogleCloudRecommendationengineV1beta1BigQuerySource { + /// The schema to use when parsing the data from the source. + /// + /// Supported values for catalog imports: 1: "catalog_recommendations_ai" + /// using https://cloud.google.com/recommendations-ai/docs/upload-catalog#json + /// (Default for catalogItems.import) 2: "catalog_merchant_center" using + /// https://cloud.google.com/recommendations-ai/docs/upload-catalog#mc + /// Supported values for user event imports: 1: + /// "user_events_recommendations_ai" using + /// https://cloud.google.com/recommendations-ai/docs/manage-user-events#import + /// (Default for userEvents.import) 2. "user_events_ga360" using + /// https://support.google.com/analytics/answer/3437719?hl=en + /// + /// Optional. + core.String dataSchema; + + /// The BigQuery data set to copy the data from. + /// + /// Required. + core.String datasetId; + + /// Intermediate Cloud Storage directory used for the import. + /// + /// Can be specified if one wants to have the BigQuery export to a specific + /// Cloud Storage directory. + /// + /// Optional. + core.String gcsStagingDir; + + /// The project id (can be project # or id) that the BigQuery source is in. + /// + /// If not specified, inherits the project id from the parent request. + /// + /// Optional. + core.String projectId; + + /// The BigQuery table to copy the data from. + /// + /// Required. + core.String tableId; + + GoogleCloudRecommendationengineV1beta1BigQuerySource(); + + GoogleCloudRecommendationengineV1beta1BigQuerySource.fromJson( + core.Map _json) { + if (_json.containsKey('dataSchema')) { + dataSchema = _json['dataSchema'] as core.String; + } + if (_json.containsKey('datasetId')) { + datasetId = _json['datasetId'] as core.String; + } + if (_json.containsKey('gcsStagingDir')) { + gcsStagingDir = _json['gcsStagingDir'] as core.String; + } + if (_json.containsKey('projectId')) { + projectId = _json['projectId'] as core.String; + } + if (_json.containsKey('tableId')) { + tableId = _json['tableId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dataSchema != null) { + _json['dataSchema'] = dataSchema; + } + if (datasetId != null) { + _json['datasetId'] = datasetId; + } + if (gcsStagingDir != null) { + _json['gcsStagingDir'] = gcsStagingDir; + } + if (projectId != null) { + _json['projectId'] = projectId; + } + if (tableId != null) { + _json['tableId'] = tableId; + } + return _json; + } +} + +/// The catalog configuration. +/// +/// Next ID: 5. +class GoogleCloudRecommendationengineV1beta1Catalog { + /// The catalog item level configuration. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1CatalogItemLevelConfig + catalogItemLevelConfig; + + /// The ID of the default event store. + /// + /// Required. + core.String defaultEventStoreId; + + /// The catalog display name. + /// + /// Required. + core.String displayName; + + /// The fully qualified resource name of the catalog. + core.String name; + + GoogleCloudRecommendationengineV1beta1Catalog(); + + GoogleCloudRecommendationengineV1beta1Catalog.fromJson(core.Map _json) { + if (_json.containsKey('catalogItemLevelConfig')) { + catalogItemLevelConfig = + GoogleCloudRecommendationengineV1beta1CatalogItemLevelConfig.fromJson( + _json['catalogItemLevelConfig'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('defaultEventStoreId')) { + defaultEventStoreId = _json['defaultEventStoreId'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (catalogItemLevelConfig != null) { + _json['catalogItemLevelConfig'] = catalogItemLevelConfig.toJson(); + } + if (defaultEventStoreId != null) { + _json['defaultEventStoreId'] = defaultEventStoreId; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// The inline source for the input config for ImportCatalogItems method. +class GoogleCloudRecommendationengineV1beta1CatalogInlineSource { + /// A list of catalog items to update/create. + /// + /// Recommended max of 10k items. + /// + /// Optional. + core.List<GoogleCloudRecommendationengineV1beta1CatalogItem> catalogItems; + + GoogleCloudRecommendationengineV1beta1CatalogInlineSource(); + + GoogleCloudRecommendationengineV1beta1CatalogInlineSource.fromJson( + core.Map _json) { + if (_json.containsKey('catalogItems')) { + catalogItems = (_json['catalogItems'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1CatalogItem>((value) => + GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (catalogItems != null) { + _json['catalogItems'] = + catalogItems.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// CatalogItem captures all metadata information of items to be recommended. +class GoogleCloudRecommendationengineV1beta1CatalogItem { + /// Catalog item categories. + /// + /// This field is repeated for supporting one catalog item belonging to + /// several parallel category hierarchies. For example, if a shoes product + /// belongs to both \["Shoes & Accessories" -> "Shoes"\] and \["Sports & + /// Fitness" -> "Athletic Clothing" -> "Shoes"\], it could be represented as: + /// "categoryHierarchies": \[ { "categories": \["Shoes & Accessories", + /// "Shoes"\]}, { "categories": \["Sports & Fitness", "Athletic Clothing", + /// "Shoes"\] } \] + /// + /// Required. + core.List<GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy> + categoryHierarchies; + + /// Catalog item description. + /// + /// UTF-8 encoded string with a length limit of 5 KiB. + /// + /// Optional. + core.String description; + + /// Catalog item identifier. + /// + /// UTF-8 encoded string with a length limit of 128 bytes. This id must be + /// unique among all catalog items within the same catalog. It should also be + /// used when logging user events in order for the user events to be joined + /// with the Catalog. + /// + /// Required. + core.String id; + + /// Highly encouraged. + /// + /// Extra catalog item attributes to be included in the recommendation model. + /// For example, for retail products, this could include the store name, + /// vendor, style, color, etc. These are very strong signals for + /// recommendation model, thus we highly recommend providing the item + /// attributes here. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1FeatureMap itemAttributes; + + /// Variant group identifier for prediction results. + /// + /// UTF-8 encoded string with a length limit of 128 bytes. This field must be + /// enabled before it can be used. \[Learn + /// more\](/recommendations-ai/docs/catalog#item-group-id). + /// + /// Optional. + core.String itemGroupId; + + /// The model automatically detects the text language. + /// + /// Your catalog can include text in different languages, but duplicating + /// catalog items to provide text in multiple languages can result in degraded + /// model performance. + /// + /// Optional. Deprecated. + core.String languageCode; + + /// Metadata specific to retail products. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ProductCatalogItem productMetadata; + + /// Filtering tags associated with the catalog item. + /// + /// Each tag should be a UTF-8 encoded string with a length limit of 1 KiB. + /// This tag can be used for filtering recommendation results by passing the + /// tag as part of the predict request filter. + /// + /// Optional. + core.List<core.String> tags; + + /// Catalog item title. + /// + /// UTF-8 encoded string with a length limit of 1 KiB. + /// + /// Required. + core.String title; + + GoogleCloudRecommendationengineV1beta1CatalogItem(); + + GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson(core.Map _json) { + if (_json.containsKey('categoryHierarchies')) { + categoryHierarchies = (_json['categoryHierarchies'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy>( + (value) => + GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('itemAttributes')) { + itemAttributes = + GoogleCloudRecommendationengineV1beta1FeatureMap.fromJson( + _json['itemAttributes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('itemGroupId')) { + itemGroupId = _json['itemGroupId'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('productMetadata')) { + productMetadata = + GoogleCloudRecommendationengineV1beta1ProductCatalogItem.fromJson( + _json['productMetadata'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('tags')) { + tags = (_json['tags'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('title')) { + title = _json['title'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (categoryHierarchies != null) { + _json['categoryHierarchies'] = + categoryHierarchies.map((value) => value.toJson()).toList(); + } + if (description != null) { + _json['description'] = description; + } + if (id != null) { + _json['id'] = id; + } + if (itemAttributes != null) { + _json['itemAttributes'] = itemAttributes.toJson(); + } + if (itemGroupId != null) { + _json['itemGroupId'] = itemGroupId; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (productMetadata != null) { + _json['productMetadata'] = productMetadata.toJson(); + } + if (tags != null) { + _json['tags'] = tags; + } + if (title != null) { + _json['title'] = title; + } + return _json; + } +} + +/// Category represents catalog item category hierarchy. +class GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy { + /// Catalog item categories. + /// + /// Each category should be a UTF-8 encoded string with a length limit of 2 + /// KiB. Note that the order in the list denotes the specificity (from least + /// to most specific). + /// + /// Required. + core.List<core.String> categories; + + GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy(); + + GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy.fromJson( + core.Map _json) { + if (_json.containsKey('categories')) { + categories = (_json['categories'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (categories != null) { + _json['categories'] = categories; + } + return _json; + } +} + +/// Configures the catalog level that users send events to, and the level at +/// which predictions are made. +class GoogleCloudRecommendationengineV1beta1CatalogItemLevelConfig { + /// Level of the catalog at which events are uploaded. + /// + /// See + /// https://cloud.google.com/recommendations-ai/docs/catalog#catalog-levels + /// for more details. + /// + /// Optional. + /// Possible string values are: + /// - "CATALOG_ITEM_LEVEL_UNSPECIFIED" : Unknown value - should never be used. + /// - "VARIANT" : Catalog items are at variant level. + /// - "MASTER" : Catalog items are at master level. + core.String eventItemLevel; + + /// Level of the catalog at which predictions are made. + /// + /// See + /// https://cloud.google.com/recommendations-ai/docs/catalog#catalog-levels + /// for more details. + /// + /// Optional. + /// Possible string values are: + /// - "CATALOG_ITEM_LEVEL_UNSPECIFIED" : Unknown value - should never be used. + /// - "VARIANT" : Catalog items are at variant level. + /// - "MASTER" : Catalog items are at master level. + core.String predictItemLevel; + + GoogleCloudRecommendationengineV1beta1CatalogItemLevelConfig(); + + GoogleCloudRecommendationengineV1beta1CatalogItemLevelConfig.fromJson( + core.Map _json) { + if (_json.containsKey('eventItemLevel')) { + eventItemLevel = _json['eventItemLevel'] as core.String; + } + if (_json.containsKey('predictItemLevel')) { + predictItemLevel = _json['predictItemLevel'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (eventItemLevel != null) { + _json['eventItemLevel'] = eventItemLevel; + } + if (predictItemLevel != null) { + _json['predictItemLevel'] = predictItemLevel; + } + return _json; + } +} + +/// Request message for the `CreatePredictionApiKeyRegistration` method. +class GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest { + /// The prediction API key registration. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration + predictionApiKeyRegistration; + + GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest(); + + GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest.fromJson( + core.Map _json) { + if (_json.containsKey('predictionApiKeyRegistration')) { + predictionApiKeyRegistration = + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration + .fromJson(_json['predictionApiKeyRegistration'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (predictionApiKeyRegistration != null) { + _json['predictionApiKeyRegistration'] = + predictionApiKeyRegistration.toJson(); + } + return _json; + } +} + +/// User event details shared by all recommendation types. +class GoogleCloudRecommendationengineV1beta1EventDetail { + /// Extra user event features to include in the recommendation model. + /// + /// For product recommendation, an example of extra user information is + /// traffic_channel, i.e. how user arrives at the site. Users can arrive at + /// the site by coming to the site directly, or coming through Google search, + /// and etc. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1FeatureMap eventAttributes; + + /// A list of identifiers for the independent experiment groups this user + /// event belongs to. + /// + /// This is used to distinguish between user events associated with different + /// experiment setups (e.g. using Recommendation Engine system, using + /// different recommendation models). + /// + /// Optional. + core.List<core.String> experimentIds; + + /// A unique id of a web page view. + /// + /// This should be kept the same for all user events triggered from the same + /// pageview. For example, an item detail page view could trigger multiple + /// events as the user is browsing the page. The `pageViewId` property should + /// be kept the same for all these events so that they can be grouped together + /// properly. This `pageViewId` will be automatically generated if using the + /// JavaScript pixel. + /// + /// Optional. + core.String pageViewId; + + /// Recommendation token included in the recommendation prediction response. + /// + /// This field enables accurate attribution of recommendation model + /// performance. This token enables us to accurately attribute page view or + /// purchase back to the event and the particular predict response containing + /// this clicked/purchased item. If user clicks on product K in the + /// recommendation results, pass the `PredictResponse.recommendationToken` + /// property as a url parameter to product K's page. When recording events on + /// product K's page, log the PredictResponse.recommendation_token to this + /// field. Optional, but highly encouraged for user events that are the result + /// of a recommendation prediction query. + /// + /// Optional. + core.String recommendationToken; + + /// The referrer url of the current page. + /// + /// When using the JavaScript pixel, this value is filled in automatically. + /// + /// Optional. + core.String referrerUri; + + /// Complete url (window.location.href) of the user's current page. + /// + /// When using the JavaScript pixel, this value is filled in automatically. + /// Maximum length 5KB. + /// + /// Optional. + core.String uri; + + GoogleCloudRecommendationengineV1beta1EventDetail(); + + GoogleCloudRecommendationengineV1beta1EventDetail.fromJson(core.Map _json) { + if (_json.containsKey('eventAttributes')) { + eventAttributes = + GoogleCloudRecommendationengineV1beta1FeatureMap.fromJson( + _json['eventAttributes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('experimentIds')) { + experimentIds = (_json['experimentIds'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('pageViewId')) { + pageViewId = _json['pageViewId'] as core.String; + } + if (_json.containsKey('recommendationToken')) { + recommendationToken = _json['recommendationToken'] as core.String; + } + if (_json.containsKey('referrerUri')) { + referrerUri = _json['referrerUri'] as core.String; + } + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (eventAttributes != null) { + _json['eventAttributes'] = eventAttributes.toJson(); + } + if (experimentIds != null) { + _json['experimentIds'] = experimentIds; + } + if (pageViewId != null) { + _json['pageViewId'] = pageViewId; + } + if (recommendationToken != null) { + _json['recommendationToken'] = recommendationToken; + } + if (referrerUri != null) { + _json['referrerUri'] = referrerUri; + } + if (uri != null) { + _json['uri'] = uri; + } + return _json; + } +} + +/// FeatureMap represents extra features that customers want to include in the +/// recommendation model for catalogs/user events as categorical/numerical +/// features. +class GoogleCloudRecommendationengineV1beta1FeatureMap { + /// Categorical features that can take on one of a limited number of possible + /// values. + /// + /// Some examples would be the brand/maker of a product, or country of a + /// customer. Feature names and values must be UTF-8 encoded strings. For + /// example: `{ "colors": {"value": ["yellow", "green"]}, "sizes": + /// {"value":["S", "M"]}` + core.Map<core.String, + GoogleCloudRecommendationengineV1beta1FeatureMapStringList> + categoricalFeatures; + + /// Numerical features. + /// + /// Some examples would be the height/weight of a product, or age of a + /// customer. Feature names must be UTF-8 encoded strings. For example: `{ + /// "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }` + core.Map<core.String, + GoogleCloudRecommendationengineV1beta1FeatureMapFloatList> + numericalFeatures; + + GoogleCloudRecommendationengineV1beta1FeatureMap(); + + GoogleCloudRecommendationengineV1beta1FeatureMap.fromJson(core.Map _json) { + if (_json.containsKey('categoricalFeatures')) { + categoricalFeatures = (_json['categoricalFeatures'] as core.Map) + .cast<core.String, core.Map>() + .map( + (key, item) => core.MapEntry( + key, + GoogleCloudRecommendationengineV1beta1FeatureMapStringList + .fromJson(item as core.Map<core.String, core.dynamic>), + ), + ); + } + if (_json.containsKey('numericalFeatures')) { + numericalFeatures = (_json['numericalFeatures'] as core.Map) + .cast<core.String, core.Map>() + .map( + (key, item) => core.MapEntry( + key, + GoogleCloudRecommendationengineV1beta1FeatureMapFloatList + .fromJson(item as core.Map<core.String, core.dynamic>), + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (categoricalFeatures != null) { + _json['categoricalFeatures'] = categoricalFeatures + .map((key, item) => core.MapEntry(key, item.toJson())); + } + if (numericalFeatures != null) { + _json['numericalFeatures'] = numericalFeatures + .map((key, item) => core.MapEntry(key, item.toJson())); + } + return _json; + } +} + +/// A list of float features. +class GoogleCloudRecommendationengineV1beta1FeatureMapFloatList { + /// Float feature value. + core.List<core.double> value; + + GoogleCloudRecommendationengineV1beta1FeatureMapFloatList(); + + GoogleCloudRecommendationengineV1beta1FeatureMapFloatList.fromJson( + core.Map _json) { + if (_json.containsKey('value')) { + value = (_json['value'] as core.List) + .map<core.double>((value) => (value as core.num).toDouble()) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// A list of string features. +class GoogleCloudRecommendationengineV1beta1FeatureMapStringList { + /// String feature value with a length limit of 128 bytes. + core.List<core.String> value; + + GoogleCloudRecommendationengineV1beta1FeatureMapStringList(); + + GoogleCloudRecommendationengineV1beta1FeatureMapStringList.fromJson( + core.Map _json) { + if (_json.containsKey('value')) { + value = (_json['value'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (value != null) { + _json['value'] = value; + } + return _json; + } +} + +/// Google Cloud Storage location for input content. +/// +/// format. +class GoogleCloudRecommendationengineV1beta1GcsSource { + /// Google Cloud Storage URIs to input files. + /// + /// URI can be up to 2000 characters long. URIs can match the full object path + /// (for example, gs://bucket/directory/object.json) or a pattern matching one + /// or more files, such as gs://bucket/directory / * .json. A request can + /// contain at most 100 files, and each file can be up to 2 GB. See + /// \[Importing catalog information\](/recommendations-ai/docs/upload-catalog) + /// for the expected file format and setup instructions. + /// + /// Required. + core.List<core.String> inputUris; + + /// The schema to use when parsing the data from the source. + /// + /// Supported values for catalog imports: 1: "catalog_recommendations_ai" + /// using https://cloud.google.com/recommendations-ai/docs/upload-catalog#json + /// (Default for catalogItems.import) 2: "catalog_merchant_center" using + /// https://cloud.google.com/recommendations-ai/docs/upload-catalog#mc + /// Supported values for user events imports: 1: + /// "user_events_recommendations_ai" using + /// https://cloud.google.com/recommendations-ai/docs/manage-user-events#import + /// (Default for userEvents.import) 2. "user_events_ga360" using + /// https://support.google.com/analytics/answer/3437719?hl=en + /// + /// Optional. + core.String jsonSchema; + + GoogleCloudRecommendationengineV1beta1GcsSource(); + + GoogleCloudRecommendationengineV1beta1GcsSource.fromJson(core.Map _json) { + if (_json.containsKey('inputUris')) { + inputUris = (_json['inputUris'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('jsonSchema')) { + jsonSchema = _json['jsonSchema'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputUris != null) { + _json['inputUris'] = inputUris; + } + if (jsonSchema != null) { + _json['jsonSchema'] = jsonSchema; + } + return _json; + } +} + +/// Catalog item thumbnail/detail image. +class GoogleCloudRecommendationengineV1beta1Image { + /// Height of the image in number of pixels. + /// + /// Optional. + core.int height; + + /// URL of the image with a length limit of 5 KiB. + /// + /// Required. + core.String uri; + + /// Width of the image in number of pixels. + /// + /// Optional. + core.int width; + + GoogleCloudRecommendationengineV1beta1Image(); + + GoogleCloudRecommendationengineV1beta1Image.fromJson(core.Map _json) { + if (_json.containsKey('height')) { + height = _json['height'] as core.int; + } + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + if (_json.containsKey('width')) { + width = _json['width'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (height != null) { + _json['height'] = height; + } + if (uri != null) { + _json['uri'] = uri; + } + if (width != null) { + _json['width'] = width; + } + return _json; + } +} + +/// Request message for Import methods. +class GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest { + /// The desired location of errors incurred during the Import. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig errorsConfig; + + /// The desired input location of the data. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1InputConfig inputConfig; + + /// Unique identifier provided by client, within the ancestor dataset scope. + /// + /// Ensures idempotency and used for request deduplication. Server-generated + /// if unspecified. Up to 128 characters long. This is returned as + /// google.longrunning.Operation.name in the response. + /// + /// Optional. + core.String requestId; + + /// Indicates which fields in the provided imported 'items' to update. + /// + /// If not set, will by default update all fields. + /// + /// Optional. + core.String updateMask; + + GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest(); + + GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest.fromJson( + core.Map _json) { + if (_json.containsKey('errorsConfig')) { + errorsConfig = + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig.fromJson( + _json['errorsConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inputConfig')) { + inputConfig = GoogleCloudRecommendationengineV1beta1InputConfig.fromJson( + _json['inputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + if (_json.containsKey('updateMask')) { + updateMask = _json['updateMask'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (errorsConfig != null) { + _json['errorsConfig'] = errorsConfig.toJson(); + } + if (inputConfig != null) { + _json['inputConfig'] = inputConfig.toJson(); + } + if (requestId != null) { + _json['requestId'] = requestId; + } + if (updateMask != null) { + _json['updateMask'] = updateMask; + } + return _json; + } +} + +/// Response of the ImportCatalogItemsRequest. +/// +/// If the long running operation is done, then this message is returned by the +/// google.longrunning.Operations.response field if the operation was +/// successful. +class GoogleCloudRecommendationengineV1beta1ImportCatalogItemsResponse { + /// A sample of errors encountered while processing the request. + core.List<GoogleRpcStatus> errorSamples; + + /// Echoes the destination for the complete errors in the request if set. + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig errorsConfig; + + GoogleCloudRecommendationengineV1beta1ImportCatalogItemsResponse(); + + GoogleCloudRecommendationengineV1beta1ImportCatalogItemsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('errorSamples')) { + errorSamples = (_json['errorSamples'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('errorsConfig')) { + errorsConfig = + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig.fromJson( + _json['errorsConfig'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (errorSamples != null) { + _json['errorSamples'] = + errorSamples.map((value) => value.toJson()).toList(); + } + if (errorsConfig != null) { + _json['errorsConfig'] = errorsConfig.toJson(); + } + return _json; + } +} + +/// Configuration of destination for Import related errors. +class GoogleCloudRecommendationengineV1beta1ImportErrorsConfig { + /// Google Cloud Storage path for import errors. + /// + /// This must be an empty, existing Cloud Storage bucket. Import errors will + /// be written to a file in this bucket, one per line, as a JSON-encoded + /// `google.rpc.Status` message. + core.String gcsPrefix; + + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig(); + + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig.fromJson( + core.Map _json) { + if (_json.containsKey('gcsPrefix')) { + gcsPrefix = _json['gcsPrefix'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (gcsPrefix != null) { + _json['gcsPrefix'] = gcsPrefix; + } + return _json; + } +} + +/// Metadata related to the progress of the Import operation. +/// +/// This will be returned by the google.longrunning.Operation.metadata field. +class GoogleCloudRecommendationengineV1beta1ImportMetadata { + /// Operation create time. + core.String createTime; + + /// Count of entries that encountered errors while processing. + core.String failureCount; + + /// Name of the operation. + core.String operationName; + + /// Id of the request / operation. + /// + /// This is parroting back the requestId that was passed in the request. + core.String requestId; + + /// Count of entries that were processed successfully. + core.String successCount; + + /// Operation last update time. + /// + /// If the operation is done, this is also the finish time. + core.String updateTime; + + GoogleCloudRecommendationengineV1beta1ImportMetadata(); + + GoogleCloudRecommendationengineV1beta1ImportMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('failureCount')) { + failureCount = _json['failureCount'] as core.String; + } + if (_json.containsKey('operationName')) { + operationName = _json['operationName'] as core.String; + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + if (_json.containsKey('successCount')) { + successCount = _json['successCount'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (failureCount != null) { + _json['failureCount'] = failureCount; + } + if (operationName != null) { + _json['operationName'] = operationName; + } + if (requestId != null) { + _json['requestId'] = requestId; + } + if (successCount != null) { + _json['successCount'] = successCount; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +} + +/// Request message for the ImportUserEvents request. +class GoogleCloudRecommendationengineV1beta1ImportUserEventsRequest { + /// The desired location of errors incurred during the Import. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig errorsConfig; + + /// The desired input location of the data. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1InputConfig inputConfig; + + /// Unique identifier provided by client, within the ancestor dataset scope. + /// + /// Ensures idempotency for expensive long running operations. + /// Server-generated if unspecified. Up to 128 characters long. This is + /// returned as google.longrunning.Operation.name in the response. Note that + /// this field must not be set if the desired input config is + /// catalog_inline_source. + /// + /// Optional. + core.String requestId; + + GoogleCloudRecommendationengineV1beta1ImportUserEventsRequest(); + + GoogleCloudRecommendationengineV1beta1ImportUserEventsRequest.fromJson( + core.Map _json) { + if (_json.containsKey('errorsConfig')) { + errorsConfig = + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig.fromJson( + _json['errorsConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('inputConfig')) { + inputConfig = GoogleCloudRecommendationengineV1beta1InputConfig.fromJson( + _json['inputConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('requestId')) { + requestId = _json['requestId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (errorsConfig != null) { + _json['errorsConfig'] = errorsConfig.toJson(); + } + if (inputConfig != null) { + _json['inputConfig'] = inputConfig.toJson(); + } + if (requestId != null) { + _json['requestId'] = requestId; + } + return _json; + } +} + +/// Response of the ImportUserEventsRequest. +/// +/// If the long running operation was successful, then this message is returned +/// by the google.longrunning.Operations.response field if the operation was +/// successful. +class GoogleCloudRecommendationengineV1beta1ImportUserEventsResponse { + /// A sample of errors encountered while processing the request. + core.List<GoogleRpcStatus> errorSamples; + + /// Echoes the destination for the complete errors if this field was set in + /// the request. + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig errorsConfig; + + /// Aggregated statistics of user event import status. + GoogleCloudRecommendationengineV1beta1UserEventImportSummary importSummary; + + GoogleCloudRecommendationengineV1beta1ImportUserEventsResponse(); + + GoogleCloudRecommendationengineV1beta1ImportUserEventsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('errorSamples')) { + errorSamples = (_json['errorSamples'] as core.List) + .map<GoogleRpcStatus>((value) => GoogleRpcStatus.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('errorsConfig')) { + errorsConfig = + GoogleCloudRecommendationengineV1beta1ImportErrorsConfig.fromJson( + _json['errorsConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('importSummary')) { + importSummary = + GoogleCloudRecommendationengineV1beta1UserEventImportSummary.fromJson( + _json['importSummary'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (errorSamples != null) { + _json['errorSamples'] = + errorSamples.map((value) => value.toJson()).toList(); + } + if (errorsConfig != null) { + _json['errorsConfig'] = errorsConfig.toJson(); + } + if (importSummary != null) { + _json['importSummary'] = importSummary.toJson(); + } + return _json; + } +} + +/// The input config source. +class GoogleCloudRecommendationengineV1beta1InputConfig { + /// BigQuery input source. + GoogleCloudRecommendationengineV1beta1BigQuerySource bigQuerySource; + + /// The Inline source for the input content for Catalog items. + GoogleCloudRecommendationengineV1beta1CatalogInlineSource catalogInlineSource; + + /// Google Cloud Storage location for the input content. + GoogleCloudRecommendationengineV1beta1GcsSource gcsSource; + + /// The Inline source for the input content for UserEvents. + GoogleCloudRecommendationengineV1beta1UserEventInlineSource + userEventInlineSource; + + GoogleCloudRecommendationengineV1beta1InputConfig(); + + GoogleCloudRecommendationengineV1beta1InputConfig.fromJson(core.Map _json) { + if (_json.containsKey('bigQuerySource')) { + bigQuerySource = + GoogleCloudRecommendationengineV1beta1BigQuerySource.fromJson( + _json['bigQuerySource'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('catalogInlineSource')) { + catalogInlineSource = + GoogleCloudRecommendationengineV1beta1CatalogInlineSource.fromJson( + _json['catalogInlineSource'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('gcsSource')) { + gcsSource = GoogleCloudRecommendationengineV1beta1GcsSource.fromJson( + _json['gcsSource'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('userEventInlineSource')) { + userEventInlineSource = + GoogleCloudRecommendationengineV1beta1UserEventInlineSource.fromJson( + _json['userEventInlineSource'] + as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bigQuerySource != null) { + _json['bigQuerySource'] = bigQuerySource.toJson(); + } + if (catalogInlineSource != null) { + _json['catalogInlineSource'] = catalogInlineSource.toJson(); + } + if (gcsSource != null) { + _json['gcsSource'] = gcsSource.toJson(); + } + if (userEventInlineSource != null) { + _json['userEventInlineSource'] = userEventInlineSource.toJson(); + } + return _json; + } +} + +/// Response message for ListCatalogItems method. +class GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse { + /// The catalog items. + core.List<GoogleCloudRecommendationengineV1beta1CatalogItem> catalogItems; + + /// If empty, the list is complete. + /// + /// If nonempty, the token to pass to the next request's + /// ListCatalogItemRequest.page_token. + core.String nextPageToken; + + GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse(); + + GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('catalogItems')) { + catalogItems = (_json['catalogItems'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1CatalogItem>((value) => + GoogleCloudRecommendationengineV1beta1CatalogItem.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (catalogItems != null) { + _json['catalogItems'] = + catalogItems.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response for ListCatalogs method. +class GoogleCloudRecommendationengineV1beta1ListCatalogsResponse { + /// All the customer's catalogs. + /// + /// Output only. + core.List<GoogleCloudRecommendationengineV1beta1Catalog> catalogs; + + /// Pagination token, if not returned indicates the last page. + core.String nextPageToken; + + GoogleCloudRecommendationengineV1beta1ListCatalogsResponse(); + + GoogleCloudRecommendationengineV1beta1ListCatalogsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('catalogs')) { + catalogs = (_json['catalogs'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1Catalog>((value) => + GoogleCloudRecommendationengineV1beta1Catalog.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (catalogs != null) { + _json['catalogs'] = catalogs.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for the `ListPredictionApiKeyRegistrations`. +class GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse { + /// If empty, the list is complete. + /// + /// If nonempty, pass the token to the next request's + /// `ListPredictionApiKeysRegistrationsRequest.pageToken`. + core.String nextPageToken; + + /// The list of registered API keys. + core.List<GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration> + predictionApiKeyRegistrations; + + GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse(); + + GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('predictionApiKeyRegistrations')) { + predictionApiKeyRegistrations = (_json['predictionApiKeyRegistrations'] + as core.List) + .map<GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration>( + (value) => + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (predictionApiKeyRegistrations != null) { + _json['predictionApiKeyRegistrations'] = + predictionApiKeyRegistrations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response message for ListUserEvents method. +class GoogleCloudRecommendationengineV1beta1ListUserEventsResponse { + /// If empty, the list is complete. + /// + /// If nonempty, the token to pass to the next request's + /// ListUserEvents.page_token. + core.String nextPageToken; + + /// The user events. + core.List<GoogleCloudRecommendationengineV1beta1UserEvent> userEvents; + + GoogleCloudRecommendationengineV1beta1ListUserEventsResponse(); + + GoogleCloudRecommendationengineV1beta1ListUserEventsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('userEvents')) { + userEvents = (_json['userEvents'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1UserEvent>((value) => + GoogleCloudRecommendationengineV1beta1UserEvent.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (userEvents != null) { + _json['userEvents'] = userEvents.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Request message for Predict method. +class GoogleCloudRecommendationengineV1beta1PredictRequest { + /// Use dryRun mode for this prediction query. + /// + /// If set to true, a dummy model will be used that returns arbitrary catalog + /// items. Note that the dryRun mode should only be used for testing the API, + /// or if the model is not ready. + /// + /// Optional. + core.bool dryRun; + + /// Filter for restricting prediction results. + /// + /// Accepts values for tags and the `filterOutOfStockItems` flag. * Tag + /// expressions. Restricts predictions to items that match all of the + /// specified tags. Boolean operators `OR` and `NOT` are supported if the + /// expression is enclosed in parentheses, and must be separated from the tag + /// values by a space. `-"tagA"` is also supported and is equivalent to `NOT + /// "tagA"`. Tag values must be double quoted UTF-8 encoded strings with a + /// size limit of 1 KiB. * filterOutOfStockItems. Restricts predictions to + /// items that do not have a stockState value of OUT_OF_STOCK. Examples: * + /// tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") * + /// filterOutOfStockItems tag=(-"promotional") * filterOutOfStockItems If your + /// filter blocks all prediction results, nothing will be returned. If you + /// want generic (unfiltered) popular items to be returned instead, set + /// `strictFiltering` to false in `PredictRequest.params`. + /// + /// Optional. + core.String filter; + + /// The labels for the predict request. + /// + /// * Label keys can contain lowercase letters, digits and hyphens, must start + /// with a letter, and must end with a letter or digit. * Non-zero label + /// values can contain lowercase letters, digits and hyphens, must start with + /// a letter, and must end with a letter or digit. * No more than 64 labels + /// can be associated with a given request. See https://goo.gl/xmQnxf for more + /// information on and examples of labels. + /// + /// Optional. + core.Map<core.String, core.String> labels; + + /// Maximum number of results to return per page. + /// + /// Set this property to the number of prediction results required. If zero, + /// the service will choose a reasonable default. + /// + /// Optional. + core.int pageSize; + + /// The previous PredictResponse.next_page_token. + /// + /// Optional. + core.String pageToken; + + /// Additional domain specific parameters for the predictions. + /// + /// Allowed values: * `returnCatalogItem`: Boolean. If set to true, the + /// associated catalogItem object will be returned in the + /// `PredictResponse.PredictionResult.itemMetadata` object in the method + /// response. * `returnItemScore`: Boolean. If set to true, the prediction + /// 'score' corresponding to each returned item will be set in the `metadata` + /// field in the prediction response. The given 'score' indicates the + /// probability of an item being clicked/purchased given the user's context + /// and history. * `strictFiltering`: Boolean. True by default. If set to + /// false, the service will return generic (unfiltered) popular items instead + /// of empty if your filter blocks all prediction results. + /// + /// Optional. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> params; + + /// Context about the user, what they are looking at and what action they took + /// to trigger the predict request. + /// + /// Note that this user event detail won't be ingested to userEvent logs. + /// Thus, a separate userEvent write request is required for event logging. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1UserEvent userEvent; + + GoogleCloudRecommendationengineV1beta1PredictRequest(); + + GoogleCloudRecommendationengineV1beta1PredictRequest.fromJson( + core.Map _json) { + if (_json.containsKey('dryRun')) { + dryRun = _json['dryRun'] as core.bool; + } + if (_json.containsKey('filter')) { + filter = _json['filter'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('pageSize')) { + pageSize = _json['pageSize'] as core.int; + } + if (_json.containsKey('pageToken')) { + pageToken = _json['pageToken'] as core.String; + } + if (_json.containsKey('params')) { + params = + (_json['params'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('userEvent')) { + userEvent = GoogleCloudRecommendationengineV1beta1UserEvent.fromJson( + _json['userEvent'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dryRun != null) { + _json['dryRun'] = dryRun; + } + if (filter != null) { + _json['filter'] = filter; + } + if (labels != null) { + _json['labels'] = labels; + } + if (pageSize != null) { + _json['pageSize'] = pageSize; + } + if (pageToken != null) { + _json['pageToken'] = pageToken; + } + if (params != null) { + _json['params'] = params; + } + if (userEvent != null) { + _json['userEvent'] = userEvent.toJson(); + } + return _json; + } +} + +/// Response message for predict method. +class GoogleCloudRecommendationengineV1beta1PredictResponse { + /// True if the dryRun property was set in the request. + core.bool dryRun; + + /// IDs of items in the request that were missing from the catalog. + core.List<core.String> itemsMissingInCatalog; + + /// Additional domain specific prediction response metadata. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// If empty, the list is complete. + /// + /// If nonempty, the token to pass to the next request's + /// PredictRequest.page_token. + core.String nextPageToken; + + /// A unique recommendation token. + /// + /// This should be included in the user event logs resulting from this + /// recommendation, which enables accurate attribution of recommendation model + /// performance. + core.String recommendationToken; + + /// A list of recommended items. + /// + /// The order represents the ranking (from the most relevant item to the + /// least). + core.List< + GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult> + results; + + GoogleCloudRecommendationengineV1beta1PredictResponse(); + + GoogleCloudRecommendationengineV1beta1PredictResponse.fromJson( + core.Map _json) { + if (_json.containsKey('dryRun')) { + dryRun = _json['dryRun'] as core.bool; + } + if (_json.containsKey('itemsMissingInCatalog')) { + itemsMissingInCatalog = (_json['itemsMissingInCatalog'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('recommendationToken')) { + recommendationToken = _json['recommendationToken'] as core.String; + } + if (_json.containsKey('results')) { + results = (_json['results'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult>( + (value) => + GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dryRun != null) { + _json['dryRun'] = dryRun; + } + if (itemsMissingInCatalog != null) { + _json['itemsMissingInCatalog'] = itemsMissingInCatalog; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (recommendationToken != null) { + _json['recommendationToken'] = recommendationToken; + } + if (results != null) { + _json['results'] = results.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// PredictionResult represents the recommendation prediction results. +class GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult { + /// ID of the recommended catalog item + core.String id; + + /// Additional item metadata / annotations. + /// + /// Possible values: * `catalogItem`: JSON representation of the catalogItem. + /// Will be set if `returnCatalogItem` is set to true in + /// `PredictRequest.params`. * `score`: Prediction score in double value. Will + /// be set if `returnItemScore` is set to true in `PredictRequest.params`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> itemMetadata; + + GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult(); + + GoogleCloudRecommendationengineV1beta1PredictResponsePredictionResult.fromJson( + core.Map _json) { + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('itemMetadata')) { + itemMetadata = (_json['itemMetadata'] as core.Map) + .cast<core.String, core.Object>() + .map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (id != null) { + _json['id'] = id; + } + if (itemMetadata != null) { + _json['itemMetadata'] = itemMetadata; + } + return _json; + } +} + +/// Registered Api Key. +class GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration { + /// The API key. + core.String apiKey; + + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration(); + + GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration.fromJson( + core.Map _json) { + if (_json.containsKey('apiKey')) { + apiKey = _json['apiKey'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiKey != null) { + _json['apiKey'] = apiKey; + } + return _json; + } +} + +/// ProductCatalogItem captures item metadata specific to retail products. +class GoogleCloudRecommendationengineV1beta1ProductCatalogItem { + /// The available quantity of the item. + /// + /// Optional. + core.String availableQuantity; + + /// Canonical URL directly linking to the item detail page with a length limit + /// of 5 KiB.. + /// + /// Optional. + core.String canonicalProductUri; + + /// A map to pass the costs associated with the product. + /// + /// For example: {"manufacturing": 45.5} The profit of selling this item is + /// computed like so: * If 'exactPrice' is provided, profit = displayPrice - + /// sum(costs) * If 'priceRange' is provided, profit = minPrice - sum(costs) + /// + /// Optional. + core.Map<core.String, core.double> costs; + + /// Only required if the price is set. + /// + /// Currency code for price/costs. Use three-character ISO-4217 code. + /// + /// Optional. + core.String currencyCode; + + /// The exact product price. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice exactPrice; + + /// Product images for the catalog item. + /// + /// Optional. + core.List<GoogleCloudRecommendationengineV1beta1Image> images; + + /// The product price range. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange priceRange; + + /// Online stock state of the catalog item. + /// + /// Default is `IN_STOCK`. + /// + /// Optional. + /// Possible string values are: + /// - "STOCK_STATE_UNSPECIFIED" : Default item stock status. Should never be + /// used. + /// - "IN_STOCK" : Item in stock. + /// - "OUT_OF_STOCK" : Item out of stock. + /// - "PREORDER" : Item that is in pre-order state. + /// - "BACKORDER" : Item that is back-ordered (i.e. temporarily out of stock). + core.String stockState; + + GoogleCloudRecommendationengineV1beta1ProductCatalogItem(); + + GoogleCloudRecommendationengineV1beta1ProductCatalogItem.fromJson( + core.Map _json) { + if (_json.containsKey('availableQuantity')) { + availableQuantity = _json['availableQuantity'] as core.String; + } + if (_json.containsKey('canonicalProductUri')) { + canonicalProductUri = _json['canonicalProductUri'] as core.String; + } + if (_json.containsKey('costs')) { + costs = (_json['costs'] as core.Map).cast<core.String, core.num>().map( + (key, item) => core.MapEntry( + key, + (item as core.num).toDouble(), + ), + ); + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('exactPrice')) { + exactPrice = + GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice + .fromJson( + _json['exactPrice'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('images')) { + images = (_json['images'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1Image>((value) => + GoogleCloudRecommendationengineV1beta1Image.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('priceRange')) { + priceRange = + GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange + .fromJson( + _json['priceRange'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('stockState')) { + stockState = _json['stockState'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (availableQuantity != null) { + _json['availableQuantity'] = availableQuantity; + } + if (canonicalProductUri != null) { + _json['canonicalProductUri'] = canonicalProductUri; + } + if (costs != null) { + _json['costs'] = costs; + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (exactPrice != null) { + _json['exactPrice'] = exactPrice.toJson(); + } + if (images != null) { + _json['images'] = images.map((value) => value.toJson()).toList(); + } + if (priceRange != null) { + _json['priceRange'] = priceRange.toJson(); + } + if (stockState != null) { + _json['stockState'] = stockState; + } + return _json; + } +} + +/// Exact product price. +class GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice { + /// Display price of the product. + /// + /// Optional. + core.double displayPrice; + + /// Price of the product without any discount. + /// + /// If zero, by default set to be the 'displayPrice'. + /// + /// Optional. + core.double originalPrice; + + GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice(); + + GoogleCloudRecommendationengineV1beta1ProductCatalogItemExactPrice.fromJson( + core.Map _json) { + if (_json.containsKey('displayPrice')) { + displayPrice = (_json['displayPrice'] as core.num).toDouble(); + } + if (_json.containsKey('originalPrice')) { + originalPrice = (_json['originalPrice'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayPrice != null) { + _json['displayPrice'] = displayPrice; + } + if (originalPrice != null) { + _json['originalPrice'] = originalPrice; + } + return _json; + } +} + +/// Product price range when there are a range of prices for different +/// variations of the same product. +class GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange { + /// The maximum product price. + /// + /// Required. + core.double max; + + /// The minimum product price. + /// + /// Required. + core.double min; + + GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange(); + + GoogleCloudRecommendationengineV1beta1ProductCatalogItemPriceRange.fromJson( + core.Map _json) { + if (_json.containsKey('max')) { + max = (_json['max'] as core.num).toDouble(); + } + if (_json.containsKey('min')) { + min = (_json['min'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (max != null) { + _json['max'] = max; + } + if (min != null) { + _json['min'] = min; + } + return _json; + } +} + +/// Detailed product information associated with a user event. +class GoogleCloudRecommendationengineV1beta1ProductDetail { + /// Quantity of the products in stock when a user event happens. + /// + /// Optional. If provided, this overrides the available quantity in Catalog + /// for this event. and can only be set if `stock_status` is set to + /// `IN_STOCK`. Note that if an item is out of stock, you must set the + /// `stock_state` field to be `OUT_OF_STOCK`. Leaving this field unspecified / + /// as zero is not sufficient to mark the item out of stock. + /// + /// Optional. + core.int availableQuantity; + + /// Currency code for price/costs. + /// + /// Use three-character ISO-4217 code. Required only if originalPrice or + /// displayPrice is set. + /// + /// Optional. + core.String currencyCode; + + /// Display price of the product (e.g. discounted price). + /// + /// If provided, this will override the display price in Catalog for this + /// product. + /// + /// Optional. + core.double displayPrice; + + /// Catalog item ID. + /// + /// UTF-8 encoded string with a length limit of 128 characters. + /// + /// Required. + core.String id; + + /// Extra features associated with a product in the user event. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1FeatureMap itemAttributes; + + /// Original price of the product. + /// + /// If provided, this will override the original price in Catalog for this + /// product. + /// + /// Optional. + core.double originalPrice; + + /// Quantity of the product associated with the user event. + /// + /// For example, this field will be 2 if two products are added to the + /// shopping cart for `add-to-cart` event. Required for `add-to-cart`, + /// `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, + /// `refund` event types. + /// + /// Optional. + core.int quantity; + + /// Item stock state. + /// + /// If provided, this overrides the stock state in Catalog for items in this + /// event. + /// + /// Optional. + /// Possible string values are: + /// - "STOCK_STATE_UNSPECIFIED" : Default item stock status. Should never be + /// used. + /// - "IN_STOCK" : Item in stock. + /// - "OUT_OF_STOCK" : Item out of stock. + /// - "PREORDER" : Item that is in pre-order state. + /// - "BACKORDER" : Item that is back-ordered (i.e. temporarily out of stock). + core.String stockState; + + GoogleCloudRecommendationengineV1beta1ProductDetail(); + + GoogleCloudRecommendationengineV1beta1ProductDetail.fromJson(core.Map _json) { + if (_json.containsKey('availableQuantity')) { + availableQuantity = _json['availableQuantity'] as core.int; + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('displayPrice')) { + displayPrice = (_json['displayPrice'] as core.num).toDouble(); + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('itemAttributes')) { + itemAttributes = + GoogleCloudRecommendationengineV1beta1FeatureMap.fromJson( + _json['itemAttributes'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('originalPrice')) { + originalPrice = (_json['originalPrice'] as core.num).toDouble(); + } + if (_json.containsKey('quantity')) { + quantity = _json['quantity'] as core.int; + } + if (_json.containsKey('stockState')) { + stockState = _json['stockState'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (availableQuantity != null) { + _json['availableQuantity'] = availableQuantity; + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (displayPrice != null) { + _json['displayPrice'] = displayPrice; + } + if (id != null) { + _json['id'] = id; + } + if (itemAttributes != null) { + _json['itemAttributes'] = itemAttributes.toJson(); + } + if (originalPrice != null) { + _json['originalPrice'] = originalPrice; + } + if (quantity != null) { + _json['quantity'] = quantity; + } + if (stockState != null) { + _json['stockState'] = stockState; + } + return _json; + } +} + +/// ProductEventDetail captures user event information specific to retail +/// products. +class GoogleCloudRecommendationengineV1beta1ProductEventDetail { + /// The id or name of the associated shopping cart. + /// + /// This id is used to associate multiple items added or present in the cart + /// before purchase. This can only be set for `add-to-cart`, + /// `remove-from-cart`, `checkout-start`, `purchase-complete`, or + /// `shopping-cart-page-view` events. + /// + /// Optional. + core.String cartId; + + /// Required for `add-to-list` and `remove-from-list` events. + /// + /// The id or name of the list that the item is being added to or removed + /// from. Other event types should not set this field. + core.String listId; + + /// Required for `category-page-view` events. + /// + /// Other event types should not set this field. The categories associated + /// with a category page. Category pages include special pages such as sales + /// or promotions. For instance, a special sale page may have the category + /// hierarchy: categories : \["Sales", "2017 Black Friday Deals"\]. + core.List<GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy> + pageCategories; + + /// The main product details related to the event. + /// + /// This field is required for the following event types: * `add-to-cart` * + /// `add-to-list` * `checkout-start` * `detail-page-view` * + /// `purchase-complete` * `refund` * `remove-from-cart` * `remove-from-list` + /// This field is optional for the following event types: * `page-visit` * + /// `shopping-cart-page-view` - note that 'product_details' should be set for + /// this unless the shopping cart is empty. * `search` (highly encouraged) In + /// a `search` event, this field represents the products returned to the end + /// user on the current page (the end user may have not finished broswing the + /// whole page yet). When a new page is returned to the end user, after + /// pagination/filtering/ordering even for the same query, a new SEARCH event + /// with different product_details is desired. The end user may have not + /// finished broswing the whole page yet. This field is not allowed for the + /// following event types: * `category-page-view` * `home-page-view` + core.List<GoogleCloudRecommendationengineV1beta1ProductDetail> productDetails; + + /// A transaction represents the entire purchase transaction. + /// + /// Required for `purchase-complete` events. Optional for `checkout-start` + /// events. Other event types should not set this field. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1PurchaseTransaction purchaseTransaction; + + /// Required for `search` events. + /// + /// Other event types should not set this field. The user's search query as + /// UTF-8 encoded text with a length limit of 5 KiB. + core.String searchQuery; + + GoogleCloudRecommendationengineV1beta1ProductEventDetail(); + + GoogleCloudRecommendationengineV1beta1ProductEventDetail.fromJson( + core.Map _json) { + if (_json.containsKey('cartId')) { + cartId = _json['cartId'] as core.String; + } + if (_json.containsKey('listId')) { + listId = _json['listId'] as core.String; + } + if (_json.containsKey('pageCategories')) { + pageCategories = (_json['pageCategories'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy>( + (value) => + GoogleCloudRecommendationengineV1beta1CatalogItemCategoryHierarchy + .fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('productDetails')) { + productDetails = (_json['productDetails'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1ProductDetail>((value) => + GoogleCloudRecommendationengineV1beta1ProductDetail.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('purchaseTransaction')) { + purchaseTransaction = + GoogleCloudRecommendationengineV1beta1PurchaseTransaction.fromJson( + _json['purchaseTransaction'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('searchQuery')) { + searchQuery = _json['searchQuery'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (cartId != null) { + _json['cartId'] = cartId; + } + if (listId != null) { + _json['listId'] = listId; + } + if (pageCategories != null) { + _json['pageCategories'] = + pageCategories.map((value) => value.toJson()).toList(); + } + if (productDetails != null) { + _json['productDetails'] = + productDetails.map((value) => value.toJson()).toList(); + } + if (purchaseTransaction != null) { + _json['purchaseTransaction'] = purchaseTransaction.toJson(); + } + if (searchQuery != null) { + _json['searchQuery'] = searchQuery; + } + return _json; + } +} + +/// A transaction represents the entire purchase transaction. +class GoogleCloudRecommendationengineV1beta1PurchaseTransaction { + /// All the costs associated with the product. + /// + /// These can be manufacturing costs, shipping expenses not borne by the end + /// user, or any other costs. Total product cost such that profit = revenue - + /// (sum(taxes) + sum(costs)) If product_cost is not set, then profit = + /// revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is + /// not specified for one of the items, CatalogItem.cost based profit *cannot* + /// be calculated for this Transaction. + /// + /// Optional. + core.Map<core.String, core.double> costs; + + /// Currency code. + /// + /// Use three-character ISO-4217 code. This field is not required if the event + /// type is `refund`. + /// + /// Required. + core.String currencyCode; + + /// The transaction ID with a length limit of 128 bytes. + /// + /// Optional. + core.String id; + + /// Total revenue or grand total associated with the transaction. + /// + /// This value include shipping, tax, or other adjustments to total revenue + /// that you want to include as part of your revenue calculations. This field + /// is not required if the event type is `refund`. + /// + /// Required. + core.double revenue; + + /// All the taxes associated with the transaction. + /// + /// Optional. + core.Map<core.String, core.double> taxes; + + GoogleCloudRecommendationengineV1beta1PurchaseTransaction(); + + GoogleCloudRecommendationengineV1beta1PurchaseTransaction.fromJson( + core.Map _json) { + if (_json.containsKey('costs')) { + costs = (_json['costs'] as core.Map).cast<core.String, core.num>().map( + (key, item) => core.MapEntry( + key, + (item as core.num).toDouble(), + ), + ); + } + if (_json.containsKey('currencyCode')) { + currencyCode = _json['currencyCode'] as core.String; + } + if (_json.containsKey('id')) { + id = _json['id'] as core.String; + } + if (_json.containsKey('revenue')) { + revenue = (_json['revenue'] as core.num).toDouble(); + } + if (_json.containsKey('taxes')) { + taxes = (_json['taxes'] as core.Map).cast<core.String, core.num>().map( + (key, item) => core.MapEntry( + key, + (item as core.num).toDouble(), + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (costs != null) { + _json['costs'] = costs; + } + if (currencyCode != null) { + _json['currencyCode'] = currencyCode; + } + if (id != null) { + _json['id'] = id; + } + if (revenue != null) { + _json['revenue'] = revenue; + } + if (taxes != null) { + _json['taxes'] = taxes; + } + return _json; + } +} + +/// Metadata related to the progress of the PurgeUserEvents operation. +/// +/// This will be returned by the google.longrunning.Operation.metadata field. +class GoogleCloudRecommendationengineV1beta1PurgeUserEventsMetadata { + /// Operation create time. + core.String createTime; + + /// The ID of the request / operation. + core.String operationName; + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsMetadata(); + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsMetadata.fromJson( + core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('operationName')) { + operationName = _json['operationName'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (operationName != null) { + _json['operationName'] = operationName; + } + return _json; + } +} + +/// Request message for PurgeUserEvents method. +class GoogleCloudRecommendationengineV1beta1PurgeUserEventsRequest { + /// The filter string to specify the events to be deleted. + /// + /// Empty string filter is not allowed. The eligible fields for filtering are: + /// * `eventType`: UserEvent.eventType field of type string. * `eventTime`: in + /// ISO 8601 "zulu" format. * `visitorId`: field of type string. Specifying + /// this will delete all events associated with a visitor. * `userId`: field + /// of type string. Specifying this will delete all events associated with a + /// user. Examples: * Deleting all events in a time range: `eventTime > + /// "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` * + /// Deleting specific eventType in time range: `eventTime > + /// "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` * Deleting all + /// events for a specific visitor: `visitorId = "visitor1024"` The filtering + /// fields are assumed to have an implicit AND. + /// + /// Required. + core.String filter; + + /// The default value is false. + /// + /// Override this flag to true to actually perform the purge. If the field is + /// not set to true, a sampling of events to be deleted will be returned. + /// + /// Optional. + core.bool force; + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsRequest(); + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsRequest.fromJson( + core.Map _json) { + if (_json.containsKey('filter')) { + filter = _json['filter'] as core.String; + } + if (_json.containsKey('force')) { + force = _json['force'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (filter != null) { + _json['filter'] = filter; + } + if (force != null) { + _json['force'] = force; + } + return _json; + } +} + +/// Response of the PurgeUserEventsRequest. +/// +/// If the long running operation is successfully done, then this message is +/// returned by the google.longrunning.Operations.response field. +class GoogleCloudRecommendationengineV1beta1PurgeUserEventsResponse { + /// The total count of events purged as a result of the operation. + core.String purgedEventsCount; + + /// A sampling of events deleted (or will be deleted) depending on the `force` + /// property in the request. + /// + /// Max of 500 items will be returned. + core.List<GoogleCloudRecommendationengineV1beta1UserEvent> userEventsSample; + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsResponse(); + + GoogleCloudRecommendationengineV1beta1PurgeUserEventsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('purgedEventsCount')) { + purgedEventsCount = _json['purgedEventsCount'] as core.String; + } + if (_json.containsKey('userEventsSample')) { + userEventsSample = (_json['userEventsSample'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1UserEvent>((value) => + GoogleCloudRecommendationengineV1beta1UserEvent.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (purgedEventsCount != null) { + _json['purgedEventsCount'] = purgedEventsCount; + } + if (userEventsSample != null) { + _json['userEventsSample'] = + userEventsSample.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Metadata for RejoinUserEvents method. +class GoogleCloudRecommendationengineV1beta1RejoinUserEventsMetadata { + GoogleCloudRecommendationengineV1beta1RejoinUserEventsMetadata(); + + GoogleCloudRecommendationengineV1beta1RejoinUserEventsMetadata.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Request message for CatalogRejoin method. +class GoogleCloudRecommendationengineV1beta1RejoinUserEventsRequest { + /// The type of the catalog rejoin to define the scope and range of the user + /// events to be rejoined with catalog items. + /// + /// Required. + /// Possible string values are: + /// - "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" : Rejoin catalogs with all events + /// including both joined events and unjoined events. + /// - "JOINED_EVENTS" : Only rejoin catalogs with joined events. + /// - "UNJOINED_EVENTS" : Only rejoin catalogs with unjoined events. + core.String userEventRejoinScope; + + GoogleCloudRecommendationengineV1beta1RejoinUserEventsRequest(); + + GoogleCloudRecommendationengineV1beta1RejoinUserEventsRequest.fromJson( + core.Map _json) { + if (_json.containsKey('userEventRejoinScope')) { + userEventRejoinScope = _json['userEventRejoinScope'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userEventRejoinScope != null) { + _json['userEventRejoinScope'] = userEventRejoinScope; + } + return _json; + } +} + +/// Response message for RejoinUserEvents method. +class GoogleCloudRecommendationengineV1beta1RejoinUserEventsResponse { + /// Number of user events that were joined with latest catalog items. + core.String rejoinedUserEventsCount; + + GoogleCloudRecommendationengineV1beta1RejoinUserEventsResponse(); + + GoogleCloudRecommendationengineV1beta1RejoinUserEventsResponse.fromJson( + core.Map _json) { + if (_json.containsKey('rejoinedUserEventsCount')) { + rejoinedUserEventsCount = _json['rejoinedUserEventsCount'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (rejoinedUserEventsCount != null) { + _json['rejoinedUserEventsCount'] = rejoinedUserEventsCount; + } + return _json; + } +} + +/// UserEvent captures all metadata information recommendation engine needs to +/// know about how end users interact with customers' website. +class GoogleCloudRecommendationengineV1beta1UserEvent { + /// User event detailed information common across different recommendation + /// types. + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1EventDetail eventDetail; + + /// This field should *not* be set when using JavaScript pixel or the + /// Recommendations AI Tag. + /// + /// Defaults to `EVENT_SOURCE_UNSPECIFIED`. + /// + /// Optional. + /// Possible string values are: + /// - "EVENT_SOURCE_UNSPECIFIED" : Unspecified event source. + /// - "AUTOML" : The event is ingested via a javascript pixel or + /// Recommendations AI Tag through automl datalayer or JS Macros. + /// - "ECOMMERCE" : The event is ingested via Recommendations AI Tag through + /// Enhanced Ecommerce datalayer. + /// - "BATCH_UPLOAD" : The event is ingested via Import user events API. + core.String eventSource; + + /// Only required for ImportUserEvents method. + /// + /// Timestamp of user event created. + /// + /// Optional. + core.String eventTime; + + /// User event type. + /// + /// Allowed values are: * `add-to-cart` Products being added to cart. * + /// `add-to-list` Items being added to a list (shopping list, favorites etc). + /// * `category-page-view` Special pages such as sale or promotion pages + /// viewed. * `checkout-start` User starting a checkout process. * + /// `detail-page-view` Products detail page viewed. * `home-page-view` + /// Homepage viewed. * `page-visit` Generic page visits not included in the + /// event types above. * `purchase-complete` User finishing a purchase. * + /// `refund` Purchased items being refunded or returned. * `remove-from-cart` + /// Products being removed from cart. * `remove-from-list` Items being removed + /// from a list. * `search` Product search. * `shopping-cart-page-view` User + /// viewing a shopping cart. * `impression` List of items displayed. Used by + /// Google Tag Manager. + /// + /// Required. + core.String eventType; + + /// Retail product specific user event metadata. + /// + /// This field is required for the following event types: * `add-to-cart` * + /// `add-to-list` * `category-page-view` * `checkout-start` * + /// `detail-page-view` * `purchase-complete` * `refund` * `remove-from-cart` * + /// `remove-from-list` * `search` This field is optional for the following + /// event types: * `page-visit` * `shopping-cart-page-view` - note that + /// 'product_event_detail' should be set for this unless the shopping cart is + /// empty. This field is not allowed for the following event types: * + /// `home-page-view` + /// + /// Optional. + GoogleCloudRecommendationengineV1beta1ProductEventDetail productEventDetail; + + /// User information. + /// + /// Required. + GoogleCloudRecommendationengineV1beta1UserInfo userInfo; + + GoogleCloudRecommendationengineV1beta1UserEvent(); + + GoogleCloudRecommendationengineV1beta1UserEvent.fromJson(core.Map _json) { + if (_json.containsKey('eventDetail')) { + eventDetail = GoogleCloudRecommendationengineV1beta1EventDetail.fromJson( + _json['eventDetail'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('eventSource')) { + eventSource = _json['eventSource'] as core.String; + } + if (_json.containsKey('eventTime')) { + eventTime = _json['eventTime'] as core.String; + } + if (_json.containsKey('eventType')) { + eventType = _json['eventType'] as core.String; + } + if (_json.containsKey('productEventDetail')) { + productEventDetail = + GoogleCloudRecommendationengineV1beta1ProductEventDetail.fromJson( + _json['productEventDetail'] + as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('userInfo')) { + userInfo = GoogleCloudRecommendationengineV1beta1UserInfo.fromJson( + _json['userInfo'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (eventDetail != null) { + _json['eventDetail'] = eventDetail.toJson(); + } + if (eventSource != null) { + _json['eventSource'] = eventSource; + } + if (eventTime != null) { + _json['eventTime'] = eventTime; + } + if (eventType != null) { + _json['eventType'] = eventType; + } + if (productEventDetail != null) { + _json['productEventDetail'] = productEventDetail.toJson(); + } + if (userInfo != null) { + _json['userInfo'] = userInfo.toJson(); + } + return _json; + } +} + +/// A summary of import result. +/// +/// The UserEventImportSummary summarizes the import status for user events. +class GoogleCloudRecommendationengineV1beta1UserEventImportSummary { + /// Count of user events imported with complete existing catalog information. + core.String joinedEventsCount; + + /// Count of user events imported, but with catalog information not found in + /// the imported catalog. + core.String unjoinedEventsCount; + + GoogleCloudRecommendationengineV1beta1UserEventImportSummary(); + + GoogleCloudRecommendationengineV1beta1UserEventImportSummary.fromJson( + core.Map _json) { + if (_json.containsKey('joinedEventsCount')) { + joinedEventsCount = _json['joinedEventsCount'] as core.String; + } + if (_json.containsKey('unjoinedEventsCount')) { + unjoinedEventsCount = _json['unjoinedEventsCount'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (joinedEventsCount != null) { + _json['joinedEventsCount'] = joinedEventsCount; + } + if (unjoinedEventsCount != null) { + _json['unjoinedEventsCount'] = unjoinedEventsCount; + } + return _json; + } +} + +/// The inline source for the input config for ImportUserEvents method. +class GoogleCloudRecommendationengineV1beta1UserEventInlineSource { + /// A list of user events to import. + /// + /// Recommended max of 10k items. + /// + /// Optional. + core.List<GoogleCloudRecommendationengineV1beta1UserEvent> userEvents; + + GoogleCloudRecommendationengineV1beta1UserEventInlineSource(); + + GoogleCloudRecommendationengineV1beta1UserEventInlineSource.fromJson( + core.Map _json) { + if (_json.containsKey('userEvents')) { + userEvents = (_json['userEvents'] as core.List) + .map<GoogleCloudRecommendationengineV1beta1UserEvent>((value) => + GoogleCloudRecommendationengineV1beta1UserEvent.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (userEvents != null) { + _json['userEvents'] = userEvents.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Information of end users. +class GoogleCloudRecommendationengineV1beta1UserInfo { + /// Indicates if the request is made directly from the end user in which case + /// the user_agent and ip_address fields can be populated from the HTTP + /// request. + /// + /// This should *not* be set when using the javascript pixel. This flag should + /// be set only if the API request is made directly from the end user such as + /// a mobile app (and not if a gateway or a server is processing and pushing + /// the user events). + /// + /// Optional. + core.bool directUserRequest; + + /// IP address of the user. + /// + /// This could be either IPv4 (e.g. 104.133.9.80) or IPv6 (e.g. + /// 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be set when + /// using the javascript pixel or if `direct_user_request` is set. Used to + /// extract location information for personalization. + /// + /// Optional. + core.String ipAddress; + + /// User agent as included in the HTTP header. + /// + /// UTF-8 encoded string with a length limit of 1 KiB. This should *not* be + /// set when using the JavaScript pixel or if `directUserRequest` is set. + /// + /// Optional. + core.String userAgent; + + /// Unique identifier for logged-in user with a length limit of 128 bytes. + /// + /// Required only for logged-in users. + /// + /// Optional. + core.String userId; + + /// A unique identifier for tracking visitors with a length limit of 128 + /// bytes. + /// + /// For example, this could be implemented with a http cookie, which should be + /// able to uniquely identify a visitor on a single device. This unique + /// identifier should not change if the visitor log in/out of the website. + /// Maximum length 128 bytes. Cannot be empty. + /// + /// Required. + core.String visitorId; + + GoogleCloudRecommendationengineV1beta1UserInfo(); + + GoogleCloudRecommendationengineV1beta1UserInfo.fromJson(core.Map _json) { + if (_json.containsKey('directUserRequest')) { + directUserRequest = _json['directUserRequest'] as core.bool; + } + if (_json.containsKey('ipAddress')) { + ipAddress = _json['ipAddress'] as core.String; + } + if (_json.containsKey('userAgent')) { + userAgent = _json['userAgent'] as core.String; + } + if (_json.containsKey('userId')) { + userId = _json['userId'] as core.String; + } + if (_json.containsKey('visitorId')) { + visitorId = _json['visitorId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (directUserRequest != null) { + _json['directUserRequest'] = directUserRequest; + } + if (ipAddress != null) { + _json['ipAddress'] = ipAddress; + } + if (userAgent != null) { + _json['userAgent'] = userAgent; + } + if (userId != null) { + _json['userId'] = userId; + } + if (visitorId != null) { + _json['visitorId'] = visitorId; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<GoogleLongrunningOperation> operations; + + GoogleLongrunningListOperationsResponse(); + + GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<GoogleLongrunningOperation>((value) => + GoogleLongrunningOperation.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class GoogleLongrunningOperation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + GoogleRpcStatus error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + GoogleLongrunningOperation(); + + GoogleLongrunningOperation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = GoogleRpcStatus.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class GoogleProtobufEmpty { + GoogleProtobufEmpty(); + + GoogleProtobufEmpty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class GoogleRpcStatus { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + GoogleRpcStatus(); + + GoogleRpcStatus.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/runtimeconfig/v1beta1.dart b/generated/googleapis_beta/lib/runtimeconfig/v1beta1.dart deleted file mode 100644 index 566d7a7..0000000 --- a/generated/googleapis_beta/lib/runtimeconfig/v1beta1.dart +++ /dev/null
@@ -1,2601 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Runtime Configuration API - v1beta1 -/// -/// The Runtime Configurator allows you to dynamically configure and expose -/// variables through Google Cloud Platform. In addition, you can also set -/// Watchers and Waiters that will watch for changes to your data and return -/// based on certain conditions. -/// -/// For more information, see -/// <https://cloud.google.com/deployment-manager/runtime-configurator/> -/// -/// Create an instance of [CloudRuntimeConfigApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsConfigsResource] -/// - [ProjectsConfigsOperationsResource] -/// - [ProjectsConfigsVariablesResource] -/// - [ProjectsConfigsWaitersResource] -library runtimeconfig.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// The Runtime Configurator allows you to dynamically configure and expose -/// variables through Google Cloud Platform. -/// -/// In addition, you can also set Watchers and Waiters that will watch for -/// changes to your data and return based on certain conditions. -class CloudRuntimeConfigApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - /// Manage your Google Cloud Platform services' runtime configuration - static const cloudruntimeconfigScope = - 'https://www.googleapis.com/auth/cloudruntimeconfig'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - CloudRuntimeConfigApi(http.Client client, - {core.String rootUrl = 'https://runtimeconfig.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsConfigsResource get configs => ProjectsConfigsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsConfigsResource { - final commons.ApiRequester _requester; - - ProjectsConfigsOperationsResource get operations => - ProjectsConfigsOperationsResource(_requester); - ProjectsConfigsVariablesResource get variables => - ProjectsConfigsVariablesResource(_requester); - ProjectsConfigsWaitersResource get waiters => - ProjectsConfigsWaitersResource(_requester); - - ProjectsConfigsResource(commons.ApiRequester client) : _requester = client; - - /// Creates a new RuntimeConfig resource. - /// - /// The configuration name must be unique within project. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The - /// [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) - /// for this request, in the format `projects/[PROJECT_ID]`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [requestId] - An optional but recommended unique `request_id`. If the - /// server receives two `create()` requests with the same `request_id`, then - /// the second request will be ignored and the first resource created and - /// stored in the backend is returned. Empty `request_id` fields are ignored. - /// It is responsibility of the client to ensure uniqueness of the - /// `request_id` strings. `request_id` strings are limited to 64 characters. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [RuntimeConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<RuntimeConfig> create( - RuntimeConfig request, - core.String parent, { - core.String requestId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (requestId != null) { - _queryParams['requestId'] = [requestId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/configs'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - RuntimeConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a RuntimeConfig resource. - /// - /// Request parameters: - /// - /// [name] - The RuntimeConfig resource to delete, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets information about a RuntimeConfig resource. - /// - /// Request parameters: - /// - /// [name] - The name of the RuntimeConfig resource to retrieve, in the - /// format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [RuntimeConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<RuntimeConfig> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - RuntimeConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the access control policy for a resource. - /// - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [options_requestedPolicyVersion] - Optional. The policy format version to - /// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid - /// value will be rejected. Requests for policies with any conditional - /// bindings must specify version 3. Policies without any conditional bindings - /// may specify any valid value or leave the field unset. To learn which - /// resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - core.String resource, { - core.int options_requestedPolicyVersion, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if (options_requestedPolicyVersion != null) { - _queryParams['options.requestedPolicyVersion'] = [ - '${options_requestedPolicyVersion}' - ]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all the RuntimeConfig resources within project. - /// - /// Request parameters: - /// - /// [parent] - The - /// [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) - /// for this request, in the format `projects/[PROJECT_ID]`. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [pageSize] - Specifies the number of results to return per page. If there - /// are fewer elements than the specified number, returns all elements. - /// - /// [pageToken] - Specifies a page token to use. Set `pageToken` to a - /// `nextPageToken` returned by a previous list request to get the next page - /// of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListConfigsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListConfigsResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/configs'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListConfigsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the access control policy on the specified resource. - /// - /// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, - /// and `PERMISSION_DENIED` errors. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a RuntimeConfig resource. - /// - /// The configuration must exist beforehand. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the RuntimeConfig resource to update, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [RuntimeConfig]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<RuntimeConfig> update( - RuntimeConfig request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - RuntimeConfig.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsConfigsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsConfigsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/configs/\[^/\]+/operations/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/configs/\[^/\]+/operations/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsConfigsVariablesResource { - final commons.ApiRequester _requester; - - ProjectsConfigsVariablesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a variable within the given configuration. - /// - /// You cannot create a variable with a name that is a prefix of an existing - /// variable name, or a name that has an existing variable name as a prefix. - /// To learn more about creating a variable, read the \[Setting and Getting - /// Data\](/deployment-manager/runtime-configurator/set-and-get-variables) - /// documentation. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The path to the RutimeConfig resource that this variable should - /// belong to. The configuration must exist beforehand; the path must be in - /// the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [requestId] - An optional but recommended unique `request_id`. If the - /// server receives two `create()` requests with the same `request_id`, then - /// the second request will be ignored and the first resource created and - /// stored in the backend is returned. Empty `request_id` fields are ignored. - /// It is responsibility of the client to ensure uniqueness of the - /// `request_id` strings. `request_id` strings are limited to 64 characters. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Variable]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Variable> create( - Variable request, - core.String parent, { - core.String requestId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (requestId != null) { - _queryParams['requestId'] = [requestId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/variables'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Variable.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a variable or multiple variables. - /// - /// If you specify a variable name, then that variable is deleted. If you - /// specify a prefix and `recursive` is true, then all variables with that - /// prefix are deleted. You must set a `recursive` to true if you delete - /// variables by prefix. - /// - /// Request parameters: - /// - /// [name] - The name of the variable to delete, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+/variables/.*$`. - /// - /// [recursive] - Set to `true` to recursively delete multiple variables with - /// the same prefix. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.bool recursive, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (recursive != null) { - _queryParams['recursive'] = ['${recursive}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets information about a single variable. - /// - /// Request parameters: - /// - /// [name] - The name of the variable to return, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+/variables/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Variable]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Variable> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Variable.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists variables within given a configuration, matching any provided - /// filters. - /// - /// This only lists variable names, not the values, unless `return_values` is - /// true, in which case only variables that user has IAM permission to - /// GetVariable will be returned. - /// - /// Request parameters: - /// - /// [parent] - The path to the RuntimeConfig resource for which you want to - /// list variables. The configuration must exist beforehand; the path must be - /// in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [filter] - Filters variables by matching the specified filter. For - /// example: - /// `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. - /// - /// [pageSize] - Specifies the number of results to return per page. If there - /// are fewer elements than the specified number, returns all elements. - /// - /// [pageToken] - Specifies a page token to use. Set `pageToken` to a - /// `nextPageToken` returned by a previous list request to get the next page - /// of results. - /// - /// [returnValues] - The flag indicates whether the user wants to return - /// values of variables. If true, then only those variables that user has IAM - /// GetVariable permission will be returned along with their values. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListVariablesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListVariablesResponse> list( - core.String parent, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.bool returnValues, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if (returnValues != null) { - _queryParams['returnValues'] = ['${returnValues}']; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/variables'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListVariablesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+/variables/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates an existing variable with a new value. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the variable to update, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+/variables/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Variable]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Variable> update( - Variable request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PUT', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Variable.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Watches a specific variable and waits for a change in the variable's - /// value. - /// - /// When there is a change, this method returns the new value or times out. If - /// a variable is deleted while being watched, the `variableState` state is - /// set to `DELETED` and the method returns the last known variable `value`. - /// If you set the deadline for watching to a larger value than internal - /// timeout (60 seconds), the current variable value is returned and the - /// `variableState` will be `VARIABLE_STATE_UNSPECIFIED`. To learn more about - /// creating a watcher, read the \[Watching a Variable for - /// Changes\](/deployment-manager/runtime-configurator/watching-a-variable) - /// documentation. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The name of the variable to watch, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+/variables/.*$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Variable]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Variable> watch( - WatchVariableRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':watch'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Variable.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsConfigsWaitersResource { - final commons.ApiRequester _requester; - - ProjectsConfigsWaitersResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a Waiter resource. - /// - /// This operation returns a long-running Operation resource which can be - /// polled for completion. However, a waiter with the given name will exist - /// (and can be retrieved) prior to the operation completing. If the operation - /// fails, the failed Waiter resource will still exist and must be deleted - /// prior to subsequent creation attempts. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The path to the configuration that will own the waiter. The - /// configuration must exist beforehand; the path must be in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [requestId] - An optional but recommended unique `request_id`. If the - /// server receives two `create()` requests with the same `request_id`, then - /// the second request will be ignored and the first resource created and - /// stored in the backend is returned. Empty `request_id` fields are ignored. - /// It is responsibility of the client to ensure uniqueness of the - /// `request_id` strings. `request_id` strings are limited to 64 characters. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Waiter request, - core.String parent, { - core.String requestId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (requestId != null) { - _queryParams['requestId'] = [requestId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/waiters'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes the waiter with the specified name. - /// - /// Request parameters: - /// - /// [name] - The Waiter resource to delete, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - /// Value must have pattern - /// `^projects/\[^/\]+/configs/\[^/\]+/waiters/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets information about a single waiter. - /// - /// Request parameters: - /// - /// [name] - The fully-qualified name of the Waiter resource object to - /// retrieve, in the format: - /// `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - /// Value must have pattern - /// `^projects/\[^/\]+/configs/\[^/\]+/waiters/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Waiter]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Waiter> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Waiter.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// List waiters within the given configuration. - /// - /// Request parameters: - /// - /// [parent] - The path to the configuration for which you want to get a list - /// of waiters. The configuration must exist beforehand; the path must be in - /// the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - /// Value must have pattern `^projects/\[^/\]+/configs/\[^/\]+$`. - /// - /// [pageSize] - Specifies the number of results to return per page. If there - /// are fewer elements than the specified number, returns all elements. - /// - /// [pageToken] - Specifies a page token to use. Set `pageToken` to a - /// `nextPageToken` returned by a previous list request to get the next page - /// of results. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListWaitersResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListWaitersResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/waiters'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListWaitersResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns permissions that a caller has on the specified resource. - /// - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. Note: This operation is designed to - /// be used for building permission-aware UIs and command-line tools, not for - /// authorization checking. This operation may "fail open" without warning. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/configs/\[^/\]+/waiters/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// A Cardinality condition for the Waiter resource. -/// -/// A cardinality condition is met when the number of variables under a -/// specified path prefix reaches a predefined number. For example, if you set a -/// Cardinality condition where the `path` is set to `/foo` and the number of -/// paths is set to `2`, the following variables would meet the condition in a -/// RuntimeConfig resource: + `/foo/variable1 = "value1"` + `/foo/variable2 = -/// "value2"` + `/bar/variable3 = "value3"` It would not satisfy the same -/// condition with the `number` set to `3`, however, because there is only 2 -/// paths that start with `/foo`. Cardinality conditions are recursive; all -/// subtrees under the specific path prefix are counted. -class Cardinality { - /// The number variables under the `path` that must exist to meet this - /// condition. - /// - /// Defaults to 1 if not specified. - core.int number; - - /// The root of the variable subtree to monitor. - /// - /// For example, `/foo`. - core.String path; - - Cardinality(); - - Cardinality.fromJson(core.Map _json) { - if (_json.containsKey('number')) { - number = _json['number'] as core.int; - } - if (_json.containsKey('path')) { - path = _json['path'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (number != null) { - _json['number'] = number; - } - if (path != null) { - _json['path'] = path; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The condition that a Waiter resource is waiting for. -class EndCondition { - /// The cardinality of the `EndCondition`. - Cardinality cardinality; - - EndCondition(); - - EndCondition.fromJson(core.Map _json) { - if (_json.containsKey('cardinality')) { - cardinality = Cardinality.fromJson( - _json['cardinality'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (cardinality != null) { - _json['cardinality'] = cardinality.toJson(); - } - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// `ListConfigs()` returns the following response. -/// -/// The order of returned objects is arbitrary; that is, it is not ordered in -/// any particular way. -class ListConfigsResponse { - /// A list of the configurations in the project. - /// - /// The order of returned objects is arbitrary; that is, it is not ordered in - /// any particular way. - core.List<RuntimeConfig> configs; - - /// This token allows you to get the next page of results for list requests. - /// - /// If the number of results is larger than `pageSize`, use the - /// `nextPageToken` as a value for the query parameter `pageToken` in the next - /// list request. Subsequent list requests will have their own `nextPageToken` - /// to continue paging through the results - core.String nextPageToken; - - ListConfigsResponse(); - - ListConfigsResponse.fromJson(core.Map _json) { - if (_json.containsKey('configs')) { - configs = (_json['configs'] as core.List) - .map<RuntimeConfig>((value) => RuntimeConfig.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (configs != null) { - _json['configs'] = configs.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response for the `ListVariables()` method. -class ListVariablesResponse { - /// This token allows you to get the next page of results for list requests. - /// - /// If the number of results is larger than `pageSize`, use the - /// `nextPageToken` as a value for the query parameter `pageToken` in the next - /// list request. Subsequent list requests will have their own `nextPageToken` - /// to continue paging through the results - core.String nextPageToken; - - /// A list of variables and their values. - /// - /// The order of returned variable objects is arbitrary. - core.List<Variable> variables; - - ListVariablesResponse(); - - ListVariablesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('variables')) { - variables = (_json['variables'] as core.List) - .map<Variable>((value) => - Variable.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (variables != null) { - _json['variables'] = variables.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response for the `ListWaiters()` method. -/// -/// Order of returned waiter objects is arbitrary. -class ListWaitersResponse { - /// This token allows you to get the next page of results for list requests. - /// - /// If the number of results is larger than `pageSize`, use the - /// `nextPageToken` as a value for the query parameter `pageToken` in the next - /// list request. Subsequent list requests will have their own `nextPageToken` - /// to continue paging through the results - core.String nextPageToken; - - /// Found waiters in the project. - core.List<Waiter> waiters; - - ListWaitersResponse(); - - ListWaitersResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('waiters')) { - waiters = (_json['waiters'] as core.List) - .map<Waiter>((value) => - Waiter.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (waiters != null) { - _json['waiters'] = waiters.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig -/// service. -/// -/// A RuntimeConfig resource consists of metadata and a hierarchy of variables. -class RuntimeConfig { - /// An optional description of the RuntimeConfig object. - core.String description; - - /// The resource name of a runtime config. - /// - /// The name must have the format: - /// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\] The `[PROJECT_ID]` must be - /// a valid project ID, and `[CONFIG_NAME]` is an arbitrary name that matches - /// the `[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])?` regular - /// expression. The length of `[CONFIG_NAME]` must be less than 64 characters. - /// You pick the RuntimeConfig resource name, but the server will validate - /// that the name adheres to this format. After you create the resource, you - /// cannot change the resource's name. - core.String name; - - RuntimeConfig(); - - RuntimeConfig.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Describes a single variable within a RuntimeConfig resource. -/// -/// The name denotes the hierarchical variable name. For example, -/// `ports/serving_port` is a valid variable name. The variable value is an -/// opaque string and only leaf variables can have values (that is, variables -/// that do not have any child variables). -class Variable { - /// The name of the variable resource, in the format: - /// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/variables/\[VARIABLE_NAME\] - /// The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a - /// valid RuntimeConfig resource and `[VARIABLE_NAME]` follows Unix file - /// system file path naming. - /// - /// The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and - /// dashes. Slashes are used as path element separators and are not part of - /// the `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least - /// one non-slash character. Multiple slashes are coalesced into single slash - /// character. Each path segment should match - /// \[0-9A-Za-z\](?:\[_.A-Za-z0-9-\]{0,62}\[_.A-Za-z0-9\])? regular - /// expression. The length of a `[VARIABLE_NAME]` must be less than 256 - /// characters. Once you create a variable, you cannot change the variable - /// name. - core.String name; - - /// The current state of the variable. - /// - /// The variable state indicates the outcome of the `variables().watch` call - /// and is visible through the `get` and `list` calls. - /// - /// Output only. - /// Possible string values are: - /// - "VARIABLE_STATE_UNSPECIFIED" : Default variable state. - /// - "UPDATED" : The variable was updated, while `variables().watch` was - /// executing. - /// - "DELETED" : The variable was deleted, while `variables().watch` was - /// executing. - core.String state; - - /// The string value of the variable. - /// - /// The length of the value must be less than 4096 bytes. Empty values are - /// also accepted. For example, `text: "my text value"`. The string must be - /// valid UTF-8. - core.String text; - - /// The time of the last variable update. - /// - /// Timestamp will be UTC timestamp. - /// - /// Output only. - core.String updateTime; - - /// The binary value of the variable. - /// - /// The length of the value must be less than 4096 bytes. Empty values are - /// also accepted. The value must be base64 encoded, and must comply with IETF - /// RFC4648 (https://www.ietf.org/rfc/rfc4648.txt). Only one of `value` or - /// `text` can be set. - core.String value; - core.List<core.int> get valueAsBytes => convert.base64.decode(value); - - set valueAsBytes(core.List<core.int> _bytes) { - value = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - Variable(); - - Variable.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('text')) { - text = _json['text'] as core.String; - } - if (_json.containsKey('updateTime')) { - updateTime = _json['updateTime'] as core.String; - } - if (_json.containsKey('value')) { - value = _json['value'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (state != null) { - _json['state'] = state; - } - if (text != null) { - _json['text'] = text; - } - if (updateTime != null) { - _json['updateTime'] = updateTime; - } - if (value != null) { - _json['value'] = value; - } - return _json; - } -} - -/// A Waiter resource waits for some end condition within a RuntimeConfig -/// resource to be met before it returns. -/// -/// For example, assume you have a distributed system where each node writes to -/// a Variable resource indicating the node's readiness as part of the startup -/// process. You then configure a Waiter resource with the success condition set -/// to wait until some number of nodes have checked in. Afterwards, your -/// application runs some arbitrary code after the condition has been met and -/// the waiter returns successfully. Once created, a Waiter resource is -/// immutable. To learn more about using waiters, read the \[Creating a -/// Waiter\](/deployment-manager/runtime-configurator/creating-a-waiter) -/// documentation. -class Waiter { - /// The instant at which this Waiter resource was created. - /// - /// Adding the value of `timeout` to this instant yields the timeout deadline - /// for the waiter. - /// - /// Output only. - core.String createTime; - - /// If the value is `false`, it means the waiter is still waiting for one of - /// its conditions to be met. - /// - /// If true, the waiter has finished. If the waiter finished due to a timeout - /// or failure, `error` will be set. - /// - /// Output only. - core.bool done; - - /// If the waiter ended due to a failure or timeout, this value will be set. - /// - /// Output only. - Status error; - - /// The failure condition of this waiter. - /// - /// If this condition is met, `done` will be set to `true` and the `error` - /// code will be set to `ABORTED`. The failure condition takes precedence over - /// the success condition. If both conditions are met, a failure will be - /// indicated. This value is optional; if no failure condition is set, the - /// only failure scenario will be a timeout. - /// - /// Optional. - EndCondition failure; - - /// The name of the Waiter resource, in the format: - /// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/waiters/\[WAITER_NAME\] - /// The `[PROJECT_ID]` must be a valid Google Cloud project ID, the - /// `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the - /// `[WAITER_NAME]` must match RFC 1035 segment specification, and the length - /// of `[WAITER_NAME]` must be less than 64 bytes. - /// - /// After you create a Waiter resource, you cannot change the resource name. - core.String name; - - /// The success condition. - /// - /// If this condition is met, `done` will be set to `true` and the `error` - /// value will remain unset. The failure condition takes precedence over the - /// success condition. If both conditions are met, a failure will be - /// indicated. - /// - /// Required. - EndCondition success; - - /// Specifies the timeout of the waiter in seconds, beginning from the instant - /// that `waiters().create` method is called. - /// - /// If this time elapses before the success or failure conditions are met, the - /// waiter fails and sets the `error` code to `DEADLINE_EXCEEDED`. - /// - /// Required. - core.String timeout; - - Waiter(); - - Waiter.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('failure')) { - failure = EndCondition.fromJson( - _json['failure'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('success')) { - success = EndCondition.fromJson( - _json['success'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('timeout')) { - timeout = _json['timeout'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (failure != null) { - _json['failure'] = failure.toJson(); - } - if (name != null) { - _json['name'] = name; - } - if (success != null) { - _json['success'] = success.toJson(); - } - if (timeout != null) { - _json['timeout'] = timeout; - } - return _json; - } -} - -/// Request for the `WatchVariable()` method. -class WatchVariableRequest { - /// If specified, checks the current timestamp of the variable and if the - /// current timestamp is newer than `newerThan` timestamp, the method returns - /// immediately. - /// - /// If not specified or the variable has an older timestamp, the watcher waits - /// for a the value to change before returning. - core.String newerThan; - - WatchVariableRequest(); - - WatchVariableRequest.fromJson(core.Map _json) { - if (_json.containsKey('newerThan')) { - newerThan = _json['newerThan'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (newerThan != null) { - _json['newerThan'] = newerThan; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/sasportal/v1alpha1.dart b/generated/googleapis_beta/lib/sasportal/v1alpha1.dart index c305117..3f0af1b 100644 --- a/generated/googleapis_beta/lib/sasportal/v1alpha1.dart +++ b/generated/googleapis_beta/lib/sasportal/v1alpha1.dart
@@ -27,6 +27,8 @@ /// - [CustomersDeploymentsDevicesResource] /// - [CustomersDevicesResource] /// - [CustomersNodesResource] +/// - [CustomersNodesDeploymentsResource] +/// - [CustomersNodesDevicesResource] /// - [CustomersNodesNodesResource] /// - [DeploymentsResource] /// - [DeploymentsDevicesResource] @@ -36,6 +38,7 @@ /// - [NodesDeploymentsDevicesResource] /// - [NodesDevicesResource] /// - [NodesNodesResource] +/// - [NodesNodesDeploymentsResource] /// - [NodesNodesDevicesResource] /// - [NodesNodesNodesResource] /// - [PoliciesResource] @@ -142,8 +145,7 @@ /// [pageSize] - The maximum number of customers to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListCustomers method that indicates where this listing should continue - /// from. + /// ListCustomers that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -268,6 +270,247 @@ CustomersDeploymentsResource(commons.ApiRequester client) : _requester = client; + /// Creates a new deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. + /// Value must have pattern `^customers/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalEmpty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^customers/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + /// Moves a deployment under another node or customer. /// /// [request] - The metadata request object. @@ -326,6 +569,70 @@ data as core.Map<core.String, core.dynamic>), ); } + + /// Updates an existing deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name. + /// Value must have pattern `^customers/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [updateMask] - Fields to be updated. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> patch( + SasPortalDeployment request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class CustomersDeploymentsDevicesResource { @@ -463,7 +770,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -539,68 +846,6 @@ /// Creates a device under a node or customer. /// - /// Returned devices are unordered. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the parent resource. - /// Value must have pattern `^customers/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a device under a node or customer. - /// /// [request] - The metadata request object. /// /// Request parameters: @@ -832,7 +1077,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -1147,6 +1392,10 @@ class CustomersNodesResource { final commons.ApiRequester _requester; + CustomersNodesDeploymentsResource get deployments => + CustomersNodesDeploymentsResource(_requester); + CustomersNodesDevicesResource get devices => + CustomersNodesDevicesResource(_requester); CustomersNodesNodesResource get nodes => CustomersNodesNodesResource(_requester); @@ -1324,10 +1573,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^customers/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -1341,6 +1594,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -1355,6 +1609,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -1508,6 +1765,354 @@ } } +class CustomersNodesDeploymentsResource { + final commons.ApiRequester _requester; + + CustomersNodesDeploymentsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class CustomersNodesDevicesResource { + final commons.ApiRequester _requester; + + CustomersNodesDevicesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a device under a node or customer. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDevice]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDevice> create( + SasPortalDevice request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalDevice.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a signed device under a node or customer. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDevice]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDevice> createSigned( + SasPortalCreateSignedDeviceRequest request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices:createSigned'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalDevice.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists devices under a node or customer. + /// + /// Request parameters: + /// + /// [parent] - Required. The name of the parent resource. + /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have one of the + /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds + /// to serial number of the device. The filter is case insensitive. + /// + /// [pageSize] - The maximum number of devices to return in the response. If + /// empty or zero, all devices will be listed. Must be in the range \[0, + /// 1000\]. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDevices that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDevicesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDevicesResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/devices'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDevicesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + class CustomersNodesNodesResource { final commons.ApiRequester _requester; @@ -1582,10 +2187,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^customers/\[^/\]+/nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -1599,6 +2208,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -1613,6 +2223,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -1650,6 +2263,58 @@ DeploymentsDevicesResource(_requester); DeploymentsResource(commons.ApiRequester client) : _requester = client; + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class DeploymentsDevicesResource { @@ -2010,7 +2675,7 @@ InstallerResource(commons.ApiRequester client) : _requester = client; - /// Generates a secret to be used with the ValidateInstaller method + /// Generates a secret to be used with the ValidateInstaller. /// /// [request] - The metadata request object. /// @@ -2184,6 +2849,186 @@ NodesDeploymentsResource(commons.ApiRequester client) : _requester = client; + /// Deletes a deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalEmpty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalEmpty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + SasPortalEmpty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a requested deployment. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the deployment. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + /// Moves a deployment under another node or customer. /// /// [request] - The metadata request object. @@ -2242,6 +3087,70 @@ data as core.Map<core.String, core.dynamic>), ); } + + /// Updates an existing deployment. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Output only. Resource name. + /// Value must have pattern `^nodes/\[^/\]+/deployments/\[^/\]+$`. + /// + /// [updateMask] - Fields to be updated. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalDeployment]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalDeployment> patch( + SasPortalDeployment request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalDeployment.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } } class NodesDeploymentsDevicesResource { @@ -2379,7 +3288,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -2455,68 +3364,6 @@ /// Creates a device under a node or customer. /// - /// Returned devices are unordered. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The name of the parent resource. - /// Value must have pattern `^nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, - core.String parent, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Creates a device under a node or customer. - /// /// [request] - The metadata request object. /// /// Request parameters: @@ -2748,7 +3595,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -3063,6 +3910,8 @@ class NodesNodesResource { final commons.ApiRequester _requester; + NodesNodesDeploymentsResource get deployments => + NodesNodesDeploymentsResource(_requester); NodesNodesDevicesResource get devices => NodesNodesDevicesResource(_requester); NodesNodesNodesResource get nodes => NodesNodesNodesResource(_requester); @@ -3241,10 +4090,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -3258,6 +4111,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -3272,6 +4126,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -3425,34 +4282,34 @@ } } -class NodesNodesDevicesResource { +class NodesNodesDeploymentsResource { final commons.ApiRequester _requester; - NodesNodesDevicesResource(commons.ApiRequester client) : _requester = client; + NodesNodesDeploymentsResource(commons.ApiRequester client) + : _requester = client; - /// Creates a device under a node or customer. - /// - /// Returned devices are unordered. + /// Creates a new deployment. /// /// [request] - The metadata request object. /// /// Request parameters: /// - /// [parent] - Required. The name of the parent resource. + /// [parent] - Required. The parent resource name where the deployment is to + /// be created. /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. /// - /// Completes with a [SasPortalBulkCreateDeviceResponse]. + /// Completes with a [SasPortalDeployment]. /// /// Completes with a [commons.ApiRequestError] if the API endpoint returned an /// error. /// /// If the used [http.Client] completes with an error when making a REST call, /// this method will complete with the same error. - async.Future<SasPortalBulkCreateDeviceResponse> bulk( - SasPortalBulkCreateDeviceRequest request, + async.Future<SasPortalDeployment> create( + SasPortalDeployment request, core.String parent, { core.String $fields, }) { @@ -3475,7 +4332,7 @@ _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$parent') + - '/devices:bulk'; + '/deployments'; final _response = _requester.request( _url, @@ -3487,11 +4344,93 @@ downloadOptions: _downloadOptions, ); return _response.then( - (data) => SasPortalBulkCreateDeviceResponse.fromJson( + (data) => SasPortalDeployment.fromJson( data as core.Map<core.String, core.dynamic>), ); } + /// Lists deployments. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent resource name, for example, "nodes/1", + /// customer/1/nodes/2. + /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. + /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no deployments are filtered. + /// + /// [pageSize] - The maximum number of deployments to return in the response. + /// + /// [pageToken] - A pagination token returned from a previous call to + /// ListDeployments that indicates where this listing should continue from. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [SasPortalListDeploymentsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<SasPortalListDeploymentsResponse> list( + core.String parent, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1alpha1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/deployments'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => SasPortalListDeploymentsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class NodesNodesDevicesResource { + final commons.ApiRequester _requester; + + NodesNodesDevicesResource(commons.ApiRequester client) : _requester = client; + /// Creates a device under a node or customer. /// /// [request] - The metadata request object. @@ -3621,7 +4560,7 @@ /// /// [filter] - The filter expression. The filter should have one of the /// following formats: "sn=123454" or "display_name=MyDevice". sn corresponds - /// to serial_number of the device. The filter is case insensitive. + /// to serial number of the device. The filter is case insensitive. /// /// [pageSize] - The maximum number of devices to return in the response. If /// empty or zero, all devices will be listed. Must be in the range \[0, @@ -3763,10 +4702,14 @@ /// [parent] - Required. The parent resource name, for example, "nodes/1". /// Value must have pattern `^nodes/\[^/\]+/nodes/\[^/\]+$`. /// + /// [filter] - The filter expression. The filter should have the following + /// format: "DIRECT_CHILDREN" or format: "direct_children". The filter is case + /// insensitive. If empty, then no nodes are filtered. + /// /// [pageSize] - The maximum number of nodes to return in the response. /// /// [pageToken] - A pagination token returned from a previous call to - /// ListNodes method that indicates where this listing should continue from. + /// ListNodes that indicates where this listing should continue from. /// /// [$fields] - Selector specifying which fields to include in a partial /// response. @@ -3780,6 +4723,7 @@ /// this method will complete with the same error. async.Future<SasPortalListNodesResponse> list( core.String parent, { + core.String filter, core.int pageSize, core.String pageToken, core.String $fields, @@ -3794,6 +4738,9 @@ if (parent == null) { throw core.ArgumentError('Parameter parent is required.'); } + if (filter != null) { + _queryParams['filter'] = [filter]; + } if (pageSize != null) { _queryParams['pageSize'] = ['${pageSize}']; } @@ -4028,66 +4975,12 @@ } } -/// Request for BulkCreateDevice method. -class SasPortalBulkCreateDeviceRequest { - /// A csv with each row representing a \[device\]. - /// - /// Each row must conform to the regulations described on - /// CreateDeviceRequest's device field. - /// - /// Required. - core.String csv; - - SasPortalBulkCreateDeviceRequest(); - - SasPortalBulkCreateDeviceRequest.fromJson(core.Map _json) { - if (_json.containsKey('csv')) { - csv = _json['csv'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (csv != null) { - _json['csv'] = csv; - } - return _json; - } -} - -/// Response for BulkCreateDevice method. -class SasPortalBulkCreateDeviceResponse { - /// The devices that were imported. - /// - /// Required. - core.List<SasPortalDevice> devices; - - SasPortalBulkCreateDeviceResponse(); - - SasPortalBulkCreateDeviceResponse.fromJson(core.Map _json) { - if (_json.containsKey('devices')) { - devices = (_json['devices'] as core.List) - .map<SasPortalDevice>((value) => SasPortalDevice.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (devices != null) { - _json['devices'] = devices.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Request for CreateSignedDevice method. +/// Request for CreateSignedDevice. class SasPortalCreateSignedDeviceRequest { /// JSON Web Token signed using a CPI private key. /// - /// Payload must be the JSON encoding of the \[Device\]. The user_id field - /// must be set. + /// Payload must be the JSON encoding of the device. The user_id field must be + /// set. /// /// Required. core.String encodedDevice; @@ -4099,7 +4992,7 @@ convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); } - /// Unique installer id (cpiId) from the Certified Professional Installers + /// Unique installer id (CPI ID) from the Certified Professional Installers /// database. /// /// Required. @@ -4174,6 +5067,77 @@ } } +/// The Deployment. +class SasPortalDeployment { + /// The allowed billing modes under this deployment. + core.List<core.String> allowedBillingModes; + + /// Default billing mode for the deployment and devices under it. + /// Possible string values are: + /// - "BILLING_MODE_UNSPECIFIED" : Billing mode has not been specified. + /// - "MOBILE" : Price is based on category of CBSD: Category A, Category B + /// registered with SAS. + /// - "FIXED_WIRELESS" : Price is based on type of CBSD: Base station or CPE. + core.String defaultBillingMode; + + /// The deployment's display name. + core.String displayName; + + /// Resource name. + /// + /// Output only. + core.String name; + + /// User ID used by the devices belonging to this deployment. + /// + /// Each deployment should be associated with one unique user ID. + core.List<core.String> sasUserIds; + + SasPortalDeployment(); + + SasPortalDeployment.fromJson(core.Map _json) { + if (_json.containsKey('allowedBillingModes')) { + allowedBillingModes = (_json['allowedBillingModes'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('defaultBillingMode')) { + defaultBillingMode = _json['defaultBillingMode'] as core.String; + } + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('sasUserIds')) { + sasUserIds = (_json['sasUserIds'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowedBillingModes != null) { + _json['allowedBillingModes'] = allowedBillingModes; + } + if (defaultBillingMode != null) { + _json['defaultBillingMode'] = defaultBillingMode; + } + if (displayName != null) { + _json['displayName'] = displayName; + } + if (name != null) { + _json['name'] = name; + } + if (sasUserIds != null) { + _json['sasUserIds'] = sasUserIds; + } + return _json; + } +} + class SasPortalDevice { /// Current configuration of the device as registered to the SAS. /// @@ -4290,10 +5254,10 @@ /// Information about the device's air interface. class SasPortalDeviceAirInterface { + /// Conditional. + /// /// This field specifies the radio access technology that is used for the /// CBSD. - /// - /// Conditional /// Possible string values are: /// - "RADIO_TECHNOLOGY_UNSPECIFIED" /// - "E_UTRA" @@ -4306,11 +5270,11 @@ /// - "TARANA_WIRELESS" core.String radioTechnology; - /// This field is related to the radioTechnology field and provides the air + /// This field is related to the `radioTechnology` and provides the air /// interface specification that the CBSD is compliant with at the time of /// registration. /// - /// Optional + /// Optional. core.String supportedSpec; SasPortalDeviceAirInterface(); @@ -4354,9 +5318,9 @@ /// Installation parameters for the device. SasPortalInstallationParams installationParams; - /// Output-only. - /// /// Whether the configuration has been signed by a CPI. + /// + /// Output only. core.bool isSigned; /// Measurement reporting capabilities of the device. @@ -4372,9 +5336,9 @@ /// - "FINAL" core.String state; - /// Output-only. - /// /// The last time the device configuration was edited. + /// + /// Output only. core.String updateTime; /// The identifier of a device user. @@ -4481,7 +5445,7 @@ /// Maximum Equivalent Isotropically Radiated Power (EIRP) permitted by the /// grant. /// - /// The maximum EIRP is in units of dBm/MHz. The value of maxEirp represents + /// The maximum EIRP is in units of dBm/MHz. The value of `maxEirp` represents /// the average (RMS) EIRP that would be measured by the procedure defined in /// FCC part 96.41(e)(3). core.double maxEirp; @@ -4723,8 +5687,7 @@ } } -/// Request for GenerateSecret method\] -/// \[spectrum.sas.portal.v1alpha1.DeviceManager.GenerateSecret\]. +/// Request for GenerateSecret. class SasPortalGenerateSecretRequest { SasPortalGenerateSecretRequest(); @@ -4738,10 +5701,9 @@ } } -/// Response for GenerateSecret method. +/// Response for GenerateSecret. class SasPortalGenerateSecretResponse { - /// The secret generated by the string and used by \[ValidateInstaller\] - /// method. + /// The secret generated by the string and used by ValidateInstaller. core.String secret; SasPortalGenerateSecretResponse(); @@ -4836,9 +5798,9 @@ /// Device antenna height in meters. /// - /// When the heightType parameter value is "AGL", the antenna height should be - /// given relative to ground level. When the heightType parameter value is - /// "AMSL", it is given with respect to WGS84 datum. + /// When the `heightType` parameter value is "AGL", the antenna height should + /// be given relative to ground level. When the `heightType` parameter value + /// is "AMSL", it is given with respect to WGS84 datum. core.double height; /// Specifies how the height is measured. @@ -4858,7 +5820,7 @@ /// Whether the device antenna is indoor or not. /// - /// True: indoor. False: outdoor. + /// `true`: indoor. `false`: outdoor. core.bool indoorDeployment; /// Latitude of the device antenna location in degrees relative to the WGS 84 @@ -4869,11 +5831,12 @@ /// equator. core.double latitude; - /// Longitude of the device antenna location. + /// Longitude of the device antenna location in degrees relative to the WGS 84 + /// datum. /// - /// in degrees relative to the WGS 84 datum. The allowed range is from - /// -180.000000 to +180.000000. Positive values represent longitudes east of - /// the prime meridian; negative values west of the prime meridian. + /// The allowed range is from -180.000000 to +180.000000. Positive values + /// represent longitudes east of the prime meridian; negative values west of + /// the prime meridian. core.double longitude; /// A positive number in meters to indicate accuracy of the device antenna @@ -4983,8 +5946,8 @@ /// The list of customers that match the request. core.List<SasPortalCustomer> customers; - /// A pagination token returned from a previous call to ListCustomers method - /// that indicates from where listing should continue. + /// A pagination token returned from a previous call to ListCustomers that + /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there are no more customers. core.String nextPageToken; @@ -5015,13 +5978,51 @@ } } -/// Response for ListDevices method. +/// Response for ListDeployments. +class SasPortalListDeploymentsResponse { + /// The deployments that match the request. + core.List<SasPortalDeployment> deployments; + + /// A pagination token returned from a previous call to ListDeployments that + /// indicates from where listing should continue. + /// + /// If the field is missing or empty, it means there are no more deployments. + core.String nextPageToken; + + SasPortalListDeploymentsResponse(); + + SasPortalListDeploymentsResponse.fromJson(core.Map _json) { + if (_json.containsKey('deployments')) { + deployments = (_json['deployments'] as core.List) + .map<SasPortalDeployment>((value) => SasPortalDeployment.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (deployments != null) { + _json['deployments'] = + deployments.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response for ListDevices. class SasPortalListDevicesResponse { /// The devices that match the request. core.List<SasPortalDevice> devices; - /// A pagination token returned from a previous call to ListDevices method - /// that indicates from where listing should continue. + /// A pagination token returned from a previous call to ListDevices that + /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there is no more devices. core.String nextPageToken; @@ -5052,9 +6053,9 @@ } } -/// Response for ListNodes method. +/// Response for ListNodes. class SasPortalListNodesResponse { - /// A pagination token returned from a previous call to ListNodes method that + /// A pagination token returned from a previous call to ListNodes that /// indicates from where listing should continue. /// /// If the field is missing or empty, it means there is no more nodes. @@ -5089,9 +6090,9 @@ } } -/// Request for MoveDeployment method. +/// Request for MoveDeployment. class SasPortalMoveDeploymentRequest { - /// The name of the new parent resource Node or Customer to reparent the + /// The name of the new parent resource node or customer to reparent the /// deployment under. /// /// Required. @@ -5114,9 +6115,9 @@ } } -/// Request for MoveDevice method. +/// Request for MoveDevice. class SasPortalMoveDeviceRequest { - /// The name of the new parent resource (Node or Customer) to reparent the + /// The name of the new parent resource node or customer to reparent the /// device under. /// /// Required. @@ -5139,9 +6140,9 @@ } } -/// Request for MoveNode method. +/// Request for MoveNode. class SasPortalMoveNodeRequest { - /// The name of the new parent resource node or Customer) to reparent the node + /// The name of the new parent resource node or customer to reparent the node /// under. /// /// Required. @@ -5307,18 +6308,19 @@ /// Defines an access control policy to the resources. class SasPortalPolicy { + /// List of assignments core.List<SasPortalAssignment> assignments; - /// The \[etag\] is used for optimistic concurrency control as a way to help + /// The etag is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// - /// It is strongly suggested that systems make use of the \[etag\] in the + /// It is strongly suggested that systems make use of the etag in the /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An \[etag\] is returned in the response to \[GetPolicy\], and - /// systems are expected to put that etag in the request to \[SetPolicy\] to - /// ensure that their change will be applied to the same version of the - /// policy. If no \[etag\] is provided in the call to \[SetPolicy\], then the - /// existing policy is overwritten blindly. + /// conditions: An etag is returned in the response to GetPolicy, and systems + /// are expected to put that etag in the request to SetPolicy to ensure that + /// their change will be applied to the same version of the policy. If no etag + /// is provided in the call to GetPolicy, then the existing policy is + /// overwritten blindly. core.String etag; core.List<core.int> get etagAsBytes => convert.base64.decode(etag); @@ -5392,7 +6394,7 @@ } } -/// Request for SignDevice method. +/// Request for SignDevice. class SasPortalSignDeviceRequest { /// The device to sign. /// @@ -5541,7 +6543,7 @@ } } -/// Request for UpdateSignedDevice method. +/// Request for UpdateSignedDevice. class SasPortalUpdateSignedDeviceRequest { /// The JSON Web Token signed using a CPI private key. /// @@ -5587,7 +6589,7 @@ } } -/// Request for ValidateInstaller method. +/// Request for ValidateInstaller. class SasPortalValidateInstallerRequest { /// JSON Web Token signed using a CPI private key. /// @@ -5596,13 +6598,13 @@ /// Required. core.String encodedSecret; - /// Unique installer id (cpiId) from the Certified Professional Installers + /// Unique installer id (CPI ID) from the Certified Professional Installers /// database. /// /// Required. core.String installerId; - /// Secret returned by the GenerateSecret method. + /// Secret returned by the GenerateSecret. /// /// Required. core.String secret; @@ -5636,8 +6638,7 @@ } } -/// Response for ValidateInstaller method\] -/// \[spectrum.sas.portal.v1alpha1.DeviceManager.ValidateInstaller\]. +/// Response for ValidateInstaller. class SasPortalValidateInstallerResponse { SasPortalValidateInstallerResponse();
diff --git a/generated/googleapis_beta/lib/servicedirectory/v1beta1.dart b/generated/googleapis_beta/lib/servicedirectory/v1beta1.dart deleted file mode 100644 index 2baa2d7..0000000 --- a/generated/googleapis_beta/lib/servicedirectory/v1beta1.dart +++ /dev/null
@@ -1,2605 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Service Directory API - v1beta1 -/// -/// Service Directory is a platform for discovering, publishing, and connecting -/// services. -/// -/// For more information, see <https://cloud.google.com/service-directory> -/// -/// Create an instance of [ServiceDirectoryApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsNamespacesResource] -/// - [ProjectsLocationsNamespacesServicesResource] -/// - [ProjectsLocationsNamespacesServicesEndpointsResource] -library servicedirectory.v1beta1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Service Directory is a platform for discovering, publishing, and connecting -/// services. -class ServiceDirectoryApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - ServiceDirectoryApi(http.Client client, - {core.String rootUrl = 'https://servicedirectory.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsNamespacesResource get namespaces => - ProjectsLocationsNamespacesResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsNamespacesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsNamespacesServicesResource get services => - ProjectsLocationsNamespacesServicesResource(_requester); - - ProjectsLocationsNamespacesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a namespace, and returns the new Namespace. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the project and location the - /// namespace will be created in. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [namespaceId] - Required. The Resource ID must be 1-63 characters long, - /// and comply with RFC1035. Specifically, the name must be 1-63 characters - /// long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` - /// which means the first character must be a lowercase letter, and all - /// following characters must be a dash, lowercase letter, or digit, except - /// the last character, which cannot be a dash. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Namespace]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Namespace> create( - Namespace request, - core.String parent, { - core.String namespaceId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (namespaceId != null) { - _queryParams['namespaceId'] = [namespaceId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/namespaces'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Namespace.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a namespace. - /// - /// This also deletes all services and endpoints in the namespace. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the namespace to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a namespace. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the namespace to retrieve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Namespace]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Namespace> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Namespace.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the IAM Policy for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - GetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all namespaces. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the project and location whose - /// namespaces we'd like to list. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to list result by. General filter string - /// syntax: () can be "name", or "labels." for map field. can be "<, >, <=, - /// >=, !=, =, :". Of which ":" means HAS, and is roughly the same as "=". - /// must be the same data type as field. can be "AND, OR, NOT". Examples of - /// valid filters: * "labels.owner" returns Namespaces that have a label with - /// the key "owner" this is the same as "labels:owner". * - /// "labels.protocol=gRPC" returns Namespaces that have key/value - /// "protocol=gRPC". * - /// "name>projects/my-project/locations/us-east/namespaces/namespace-c" - /// returns Namespaces that have name that is alphabetically later than the - /// string, so "namespace-e" will be returned but "namespace-a" will not be. * - /// "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have "owner" - /// in label key but value is not "sd" AND have key/value foo=bar. * - /// "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't - /// have a field called "doesnotexist". Since the filter does not match any - /// Namespaces, it returns no results. - /// - /// [orderBy] - Optional. The order to list result by. General order by string - /// syntax: () (,) allows values {"name"} ascending or descending order by . - /// If this is left blank, "asc" is used. Note that an empty order_by string - /// result in default order, which is order by name in ascending order. - /// - /// [pageSize] - Optional. The maximum number of items to return. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListNamespacesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListNamespacesResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/namespaces'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListNamespacesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a namespace. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Immutable. The resource name for the namespace in the format - /// 'projects / * /locations / * /namespaces / * '. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [updateMask] - Required. List of fields to be updated in this request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Namespace]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Namespace> patch( - Namespace request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Namespace.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the IAM Policy for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Tests IAM permissions for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsNamespacesServicesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsNamespacesServicesEndpointsResource get endpoints => - ProjectsLocationsNamespacesServicesEndpointsResource(_requester); - - ProjectsLocationsNamespacesServicesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a service, and returns the new Service. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the namespace this service will - /// belong to. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [serviceId] - Required. The Resource ID must be 1-63 characters long, and - /// comply with RFC1035. Specifically, the name must be 1-63 characters long - /// and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which - /// means the first character must be a lowercase letter, and all following - /// characters must be a dash, lowercase letter, or digit, except the last - /// character, which cannot be a dash. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Service]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Service> create( - Service request, - core.String parent, { - core.String serviceId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (serviceId != null) { - _queryParams['serviceId'] = [serviceId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/services'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Service.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a service. - /// - /// This also deletes all endpoints associated with the service. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the service to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a service. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the service to get. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Service]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Service> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Service.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the IAM Policy for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> getIamPolicy( - GetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':getIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all services belonging to a namespace. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the namespace whose services - /// we'd like to list. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to list result by. General filter string - /// syntax: () can be "name", or "metadata." for map field. can be "<, >, <=, - /// >=, !=, =, :". Of which ":" means HAS, and is roughly the same as "=". - /// must be the same data type as field. can be "AND, OR, NOT". Examples of - /// valid filters: * "metadata.owner" returns Services that have a label with - /// the key "owner" this is the same as "metadata:owner". * - /// "metadata.protocol=gRPC" returns Services that have key/value - /// "protocol=gRPC". * - /// "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - /// returns Services that have name that is alphabetically later than the - /// string, so "service-e" will be returned but "service-a" will not be. * - /// "metadata.owner!=sd AND metadata.foo=bar" returns Services that have - /// "owner" in label key but value is not "sd" AND have key/value foo=bar. * - /// "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't - /// have a field called "doesnotexist". Since the filter does not match any - /// Services, it returns no results. - /// - /// [orderBy] - Optional. The order to list result by. - /// - /// [pageSize] - Optional. The maximum number of items to return. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListServicesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListServicesResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/services'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListServicesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a service. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Immutable. The resource name for the service in the format - /// 'projects / * /locations / * /namespaces / * /services / * '. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [updateMask] - Required. List of fields to be updated in this request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Service]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Service> patch( - Service request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Service.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Returns a service and its associated endpoints. - /// - /// Resolving a service is not considered an active developer method. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the service to resolve. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ResolveServiceResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ResolveServiceResponse> resolve( - ResolveServiceRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':resolve'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ResolveServiceResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Sets the IAM Policy for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy is being - /// specified. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Policy]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Policy> setIamPolicy( - SetIamPolicyRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':setIamPolicy'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Policy.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Tests IAM permissions for a resource (namespace or service only). - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [resource] - REQUIRED: The resource for which the policy detail is being - /// requested. See the operation documentation for the appropriate value for - /// this field. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TestIamPermissionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TestIamPermissionsResponse> testIamPermissions( - TestIamPermissionsRequest request, - core.String resource, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (resource == null) { - throw core.ArgumentError('Parameter resource is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$resource') + - ':testIamPermissions'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TestIamPermissionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsNamespacesServicesEndpointsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsNamespacesServicesEndpointsResource( - commons.ApiRequester client) - : _requester = client; - - /// Creates a endpoint, and returns the new Endpoint. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the service that this endpoint - /// provides. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [endpointId] - Required. The Resource ID must be 1-63 characters long, and - /// comply with RFC1035. Specifically, the name must be 1-63 characters long - /// and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which - /// means the first character must be a lowercase letter, and all following - /// characters must be a dash, lowercase letter, or digit, except the last - /// character, which cannot be a dash. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Endpoint]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Endpoint> create( - Endpoint request, - core.String parent, { - core.String endpointId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (endpointId != null) { - _queryParams['endpointId'] = [endpointId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/endpoints'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Endpoint.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a endpoint. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the endpoint to delete. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+/endpoints/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets a endpoint. - /// - /// Request parameters: - /// - /// [name] - Required. The name of the endpoint to get. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+/endpoints/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Endpoint]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Endpoint> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Endpoint.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists all endpoints. - /// - /// Request parameters: - /// - /// [parent] - Required. The resource name of the service whose endpoints we'd - /// like to list. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+$`. - /// - /// [filter] - Optional. The filter to list result by. General filter string - /// syntax: () can be "name", "address", "port" or "metadata." for map field. - /// can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and is roughly - /// the same as "=". must be the same data type as field. can be "AND, OR, - /// NOT". Examples of valid filters: * "metadata.owner" returns Endpoints that - /// have a label with the key "owner" this is the same as "metadata:owner". * - /// "metadata.protocol=gRPC" returns Endpoints that have key/value - /// "protocol=gRPC". * "address=192.108.1.105" returns Endpoints that have - /// this address. * "port>8080" returns Endpoints that have port number larger - /// than 8080. * - /// "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - /// returns Endpoints that have name that is alphabetically later than the - /// string, so "endpoint-e" will be returned but "endpoint-a" will not be. * - /// "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have - /// "owner" in label key but value is not "sd" AND have key/value foo=bar. * - /// "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't - /// have a field called "doesnotexist". Since the filter does not match any - /// Endpoints, it returns no results. - /// - /// [orderBy] - Optional. The order to list result by. - /// - /// [pageSize] - Optional. The maximum number of items to return. - /// - /// [pageToken] - Optional. The next_page_token value returned from a previous - /// List request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListEndpointsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListEndpointsResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/endpoints'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListEndpointsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Updates a endpoint. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - Immutable. The resource name for the endpoint in the format - /// 'projects / * /locations / * /namespaces / * /services / * /endpoints / * - /// '. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/namespaces/\[^/\]+/services/\[^/\]+/endpoints/\[^/\]+$`. - /// - /// [updateMask] - Required. List of fields to be updated in this request. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Endpoint]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Endpoint> patch( - Endpoint request, - core.String name, { - core.String updateMask, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (updateMask != null) { - _queryParams['updateMask'] = [updateMask]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'PATCH', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Endpoint.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// Associates `members` with a `role`. -class Binding { - /// A client-specified ID for this binding. - /// - /// Expected to be globally unique to support the internal bindings-by-ID API. - core.String bindingId; - - /// The condition that is associated with this binding. - /// - /// If the condition evaluates to `true`, then this binding applies to the - /// current request. If the condition evaluates to `false`, then this binding - /// does not apply to the current request. However, a different role binding - /// might grant the same role to one or more of the members in this binding. - /// To learn which resources support conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - Expr condition; - - /// Specifies the identities requesting access for a Cloud Platform resource. - /// - /// `members` can have the following values: * `allUsers`: A special - /// identifier that represents anyone who is on the internet; with or without - /// a Google account. * `allAuthenticatedUsers`: A special identifier that - /// represents anyone who is authenticated with a Google account or a service - /// account. * `user:{emailid}`: An email address that represents a specific - /// Google account. For example, `alice@example.com` . * - /// `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. * - /// `group:{emailid}`: An email address that represents a Google group. For - /// example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a user that has - /// been recently deleted. For example, - /// `alice@example.com?uid=123456789012345678901`. If the user is recovered, - /// this value reverts to `user:{emailid}` and the recovered user retains the - /// role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: - /// An email address (plus unique identifier) representing a service account - /// that has been recently deleted. For example, - /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If - /// the service account is undeleted, this value reverts to - /// `serviceAccount:{emailid}` and the undeleted service account retains the - /// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email - /// address (plus unique identifier) representing a Google group that has been - /// recently deleted. For example, - /// `admins@example.com?uid=123456789012345678901`. If the group is recovered, - /// this value reverts to `group:{emailid}` and the recovered group retains - /// the role in the binding. * `domain:{domain}`: The G Suite domain (primary) - /// that represents all the users of that domain. For example, `google.com` or - /// `example.com`. - core.List<core.String> members; - - /// Role that is assigned to `members`. - /// - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - core.String role; - - Binding(); - - Binding.fromJson(core.Map _json) { - if (_json.containsKey('bindingId')) { - bindingId = _json['bindingId'] as core.String; - } - if (_json.containsKey('condition')) { - condition = Expr.fromJson( - _json['condition'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('members')) { - members = (_json['members'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - if (_json.containsKey('role')) { - role = _json['role'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindingId != null) { - _json['bindingId'] = bindingId; - } - if (condition != null) { - _json['condition'] = condition.toJson(); - } - if (members != null) { - _json['members'] = members; - } - if (role != null) { - _json['role'] = role; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// An individual endpoint that provides a service. -/// -/// The service must already exist to create an endpoint. -class Endpoint { - /// An IPv4 or IPv6 address. - /// - /// Service Directory will reject bad addresses like: "8.8.8" "8.8.8.8:53" - /// "test:bad:address" "\[::1\]" "\[::1\]:8080" Limited to 45 characters. - /// - /// Optional. - core.String address; - - /// Metadata for the endpoint. - /// - /// This data can be consumed by service clients. The entire metadata - /// dictionary may contain up to 512 characters, spread accoss all key-value - /// pairs. Metadata that goes beyond any these limits will be rejected. - /// - /// Optional. - core.Map<core.String, core.String> metadata; - - /// The resource name for the endpoint in the format 'projects / * /locations - /// / * /namespaces / * /services / * /endpoints / * '. - /// - /// Immutable. - core.String name; - - /// Service Directory will reject values outside of \[0, 65535\]. - /// - /// Optional. - core.int port; - - Endpoint(); - - Endpoint.fromJson(core.Map _json) { - if (_json.containsKey('address')) { - address = _json['address'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('port')) { - port = _json['port'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (address != null) { - _json['address'] = address; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (port != null) { - _json['port'] = port; - } - return _json; - } -} - -/// Represents a textual expression in the Common Expression Language (CEL) -/// syntax. -/// -/// CEL is a C-like expression language. The syntax and semantics of CEL are -/// documented at https://github.com/google/cel-spec. Example (Comparison): -/// title: "Summary size limit" description: "Determines if a summary is less -/// than 100 chars" expression: "document.summary.size() < 100" Example -/// (Equality): title: "Requestor is owner" description: "Determines if -/// requestor is the document owner" expression: "document.owner == -/// request.auth.claims.email" Example (Logic): title: "Public documents" -/// description: "Determine whether the document should be publicly visible" -/// expression: "document.type != 'private' && document.type != 'internal'" -/// Example (Data Manipulation): title: "Notification string" description: -/// "Create a notification string with a timestamp." expression: "'New message -/// received at ' + string(document.create_time)" The exact variables and -/// functions that may be referenced within an expression are determined by the -/// service that evaluates it. See the service documentation for additional -/// information. -class Expr { - /// Description of the expression. - /// - /// This is a longer text which describes the expression, e.g. when hovered - /// over it in a UI. - /// - /// Optional. - core.String description; - - /// Textual representation of an expression in Common Expression Language - /// syntax. - core.String expression; - - /// String indicating the location of the expression for error reporting, e.g. - /// a file name and a position in the file. - /// - /// Optional. - core.String location; - - /// Title for the expression, i.e. a short string describing its purpose. - /// - /// This can be used e.g. in UIs which allow to enter the expression. - /// - /// Optional. - core.String title; - - Expr(); - - Expr.fromJson(core.Map _json) { - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('expression')) { - expression = _json['expression'] as core.String; - } - if (_json.containsKey('location')) { - location = _json['location'] as core.String; - } - if (_json.containsKey('title')) { - title = _json['title'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (description != null) { - _json['description'] = description; - } - if (expression != null) { - _json['expression'] = expression; - } - if (location != null) { - _json['location'] = location; - } - if (title != null) { - _json['title'] = title; - } - return _json; - } -} - -/// Request message for `GetIamPolicy` method. -class GetIamPolicyRequest { - /// OPTIONAL: A `GetPolicyOptions` object for specifying options to - /// `GetIamPolicy`. - GetPolicyOptions options; - - GetIamPolicyRequest(); - - GetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('options')) { - options = GetPolicyOptions.fromJson( - _json['options'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (options != null) { - _json['options'] = options.toJson(); - } - return _json; - } -} - -/// Encapsulates settings provided to GetIamPolicy. -class GetPolicyOptions { - /// The policy format version to be returned. - /// - /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be - /// rejected. Requests for policies with any conditional bindings must specify - /// version 3. Policies without any conditional bindings may specify any valid - /// value or leave the field unset. To learn which resources support - /// conditions in their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - /// - /// Optional. - core.int requestedPolicyVersion; - - GetPolicyOptions(); - - GetPolicyOptions.fromJson(core.Map _json) { - if (_json.containsKey('requestedPolicyVersion')) { - requestedPolicyVersion = _json['requestedPolicyVersion'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (requestedPolicyVersion != null) { - _json['requestedPolicyVersion'] = requestedPolicyVersion; - } - return _json; - } -} - -/// The response message for RegistrationService.ListEndpoints. -class ListEndpointsResponse { - /// The list of endpoints. - core.List<Endpoint> endpoints; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - ListEndpointsResponse(); - - ListEndpointsResponse.fromJson(core.Map _json) { - if (_json.containsKey('endpoints')) { - endpoints = (_json['endpoints'] as core.List) - .map<Endpoint>((value) => - Endpoint.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (endpoints != null) { - _json['endpoints'] = endpoints.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for RegistrationService.ListNamespaces. -class ListNamespacesResponse { - /// The list of namespaces. - core.List<Namespace> namespaces; - - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - ListNamespacesResponse(); - - ListNamespacesResponse.fromJson(core.Map _json) { - if (_json.containsKey('namespaces')) { - namespaces = (_json['namespaces'] as core.List) - .map<Namespace>((value) => - Namespace.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (namespaces != null) { - _json['namespaces'] = namespaces.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// The response message for RegistrationService.ListServices. -class ListServicesResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results in the list. - core.String nextPageToken; - - /// The list of services. - core.List<Service> services; - - ListServicesResponse(); - - ListServicesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('services')) { - services = (_json['services'] as core.List) - .map<Service>((value) => - Service.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (services != null) { - _json['services'] = services.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// A container for services. -/// -/// Namespaces allow administrators to group services together and define -/// permissions for a collection of services. -class Namespace { - /// Resource labels associated with this Namespace. - /// - /// No more than 64 user labels can be associated with a given resource. Label - /// keys and values can be no longer than 63 characters. - /// - /// Optional. - core.Map<core.String, core.String> labels; - - /// The resource name for the namespace in the format 'projects / * /locations - /// / * /namespaces / * '. - /// - /// Immutable. - core.String name; - - Namespace(); - - Namespace.fromJson(core.Map _json) { - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// An Identity and Access Management (IAM) policy, which specifies access -/// controls for Google Cloud resources. -/// -/// A `Policy` is a collection of `bindings`. A `binding` binds one or more -/// `members` to a single `role`. Members can be user accounts, service -/// accounts, Google groups, and domains (such as G Suite). A `role` is a named -/// list of permissions; each `role` can be an IAM predefined role or a -/// user-created custom role. For some types of Google Cloud resources, a -/// `binding` can also specify a `condition`, which is a logical expression that -/// allows access to a resource only if the expression evaluates to `true`. A -/// condition can add constraints based on attributes of the request, the -/// resource, or both. To learn which resources support conditions in their IAM -/// policies, see the -/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). -/// **JSON example:** { "bindings": \[ { "role": -/// "roles/resourcemanager.organizationAdmin", "members": \[ -/// "user:mike@example.com", "group:admins@example.com", "domain:google.com", -/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" \] }, { "role": -/// "roles/resourcemanager.organizationViewer", "members": \[ -/// "user:eve@example.com" \], "condition": { "title": "expirable access", -/// "description": "Does not grant access after Sep 2020", "expression": -/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } \], "etag": -/// "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - -/// user:mike@example.com - group:admins@example.com - domain:google.com - -/// serviceAccount:my-project-id@appspot.gserviceaccount.com role: -/// roles/resourcemanager.organizationAdmin - members: - user:eve@example.com -/// role: roles/resourcemanager.organizationViewer condition: title: expirable -/// access description: Does not grant access after Sep 2020 expression: -/// request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - -/// version: 3 For a description of IAM and its features, see the -/// [IAM documentation](https://cloud.google.com/iam/docs/). -class Policy { - /// Associates a list of `members` to a `role`. - /// - /// Optionally, may specify a `condition` that determines how and when the - /// `bindings` are applied. Each of the `bindings` must contain at least one - /// member. - core.List<Binding> bindings; - - /// `etag` is used for optimistic concurrency control as a way to help prevent - /// simultaneous updates of a policy from overwriting each other. - /// - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the - /// policy. **Important:** If you use IAM Conditions, you must include the - /// `etag` field whenever you call `setIamPolicy`. If you omit this field, - /// then IAM allows you to overwrite a version `3` policy with a version `1` - /// policy, and all of the conditions in the version `3` policy are lost. - core.String etag; - core.List<core.int> get etagAsBytes => convert.base64.decode(etag); - - set etagAsBytes(core.List<core.int> _bytes) { - etag = - convert.base64.encode(_bytes).replaceAll('/', '_').replaceAll('+', '-'); - } - - /// Specifies the format of the policy. - /// - /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - /// are rejected. Any operation that affects conditional role bindings must - /// specify version `3`. This requirement applies to the following operations: - /// * Getting a policy that includes a conditional role binding * Adding a - /// conditional role binding to a policy * Changing a conditional role binding - /// in a policy * Removing any role binding, with or without a condition, from - /// a policy that includes conditions **Important:** If you use IAM - /// Conditions, you must include the `etag` field whenever you call - /// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a - /// version `3` policy with a version `1` policy, and all of the conditions in - /// the version `3` policy are lost. If a policy does not include any - /// conditions, operations on that policy may specify any valid version or - /// leave the field unset. To learn which resources support conditions in - /// their IAM policies, see the - /// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - core.int version; - - Policy(); - - Policy.fromJson(core.Map _json) { - if (_json.containsKey('bindings')) { - bindings = (_json['bindings'] as core.List) - .map<Binding>((value) => - Binding.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('etag')) { - etag = _json['etag'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (bindings != null) { - _json['bindings'] = bindings.map((value) => value.toJson()).toList(); - } - if (etag != null) { - _json['etag'] = etag; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -} - -/// The request message for LookupService.ResolveService. -/// -/// Looks up a service by its name, returns the service and its endpoints. -class ResolveServiceRequest { - /// The filter applied to the endpoints of the resolved service. - /// - /// General filter string syntax: () can be "name" or "metadata." for map - /// field. can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is - /// roughly the same as "=". must be the same data type as the field. can be - /// "AND, OR, NOT". Examples of valid filters: * "metadata.owner" returns - /// Endpoints that have a label with the key "owner", this is the same as - /// "metadata:owner" * "metadata.protocol=gRPC" returns Endpoints that have - /// key/value "protocol=gRPC" * "metadata.owner!=sd AND metadata.foo=bar" - /// returns Endpoints that have "owner" field in metadata with a value that is - /// not "sd" AND have the key/value foo=bar. - /// - /// Optional. - core.String endpointFilter; - - /// The maximum number of endpoints to return. - /// - /// Defaults to 25. Maximum is 100. If a value less than one is specified, the - /// Default is used. If a value greater than the Maximum is specified, the - /// Maximum is used. - /// - /// Optional. - core.int maxEndpoints; - - ResolveServiceRequest(); - - ResolveServiceRequest.fromJson(core.Map _json) { - if (_json.containsKey('endpointFilter')) { - endpointFilter = _json['endpointFilter'] as core.String; - } - if (_json.containsKey('maxEndpoints')) { - maxEndpoints = _json['maxEndpoints'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (endpointFilter != null) { - _json['endpointFilter'] = endpointFilter; - } - if (maxEndpoints != null) { - _json['maxEndpoints'] = maxEndpoints; - } - return _json; - } -} - -/// The response message for LookupService.ResolveService. -class ResolveServiceResponse { - Service service; - - ResolveServiceResponse(); - - ResolveServiceResponse.fromJson(core.Map _json) { - if (_json.containsKey('service')) { - service = Service.fromJson( - _json['service'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (service != null) { - _json['service'] = service.toJson(); - } - return _json; - } -} - -/// An individual service. -/// -/// A service contains a name and optional metadata. A service must exist before -/// endpoints can be added to it. -class Service { - /// Endpoints associated with this service. - /// - /// Returned on LookupService.Resolve. Control plane clients should use - /// RegistrationService.ListEndpoints. - /// - /// Output only. - core.List<Endpoint> endpoints; - - /// Metadata for the service. - /// - /// This data can be consumed by service clients. The entire metadata - /// dictionary may contain up to 2000 characters, spread across all key-value - /// pairs. Metadata that goes beyond any these limits will be rejected. - /// - /// Optional. - core.Map<core.String, core.String> metadata; - - /// The resource name for the service in the format 'projects / * /locations / - /// * /namespaces / * /services / * '. - /// - /// Immutable. - core.String name; - - Service(); - - Service.fromJson(core.Map _json) { - if (_json.containsKey('endpoints')) { - endpoints = (_json['endpoints'] as core.List) - .map<Endpoint>((value) => - Endpoint.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (endpoints != null) { - _json['endpoints'] = endpoints.map((value) => value.toJson()).toList(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// Request message for `SetIamPolicy` method. -class SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. - /// - /// The size of the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) might - /// reject them. - Policy policy; - - SetIamPolicyRequest(); - - SetIamPolicyRequest.fromJson(core.Map _json) { - if (_json.containsKey('policy')) { - policy = Policy.fromJson( - _json['policy'] as core.Map<core.String, core.dynamic>); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (policy != null) { - _json['policy'] = policy.toJson(); - } - return _json; - } -} - -/// Request message for `TestIamPermissions` method. -class TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. - /// - /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. - /// For more information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - core.List<core.String> permissions; - - TestIamPermissionsRequest(); - - TestIamPermissionsRequest.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -} - -/// Response message for `TestIamPermissions` method. -class TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - core.List<core.String> permissions; - - TestIamPermissionsResponse(); - - TestIamPermissionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('permissions')) { - permissions = (_json['permissions'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (permissions != null) { - _json['permissions'] = permissions; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/speech/v2beta1.dart b/generated/googleapis_beta/lib/speech/v2beta1.dart deleted file mode 100644 index c250ee0..0000000 --- a/generated/googleapis_beta/lib/speech/v2beta1.dart +++ /dev/null
@@ -1,723 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud Speech-to-Text API - v2beta1 -/// -/// Converts audio to text by applying powerful neural network models. -/// -/// For more information, see -/// <https://cloud.google.com/speech-to-text/docs/quickstart-protocol> -/// -/// Create an instance of [SpeechApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsOperationsResource] -library speech.v2beta1; - -import 'dart:async' as async; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// Converts audio to text by applying powerful neural network models. -class SpeechApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - SpeechApi(http.Client client, - {core.String rootUrl = 'https://speech.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v2beta1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Describes the progress of a long-running `LongRunningRecognize` call. -/// -/// It is included in the `metadata` field of the `Operation` returned by the -/// `GetOperation` call of the `google::longrunning::Operations` service. -class LongRunningRecognizeMetadata { - /// Time of the most recent processing update. - /// - /// Output only. - core.String lastUpdateTime; - - /// Approximate percentage of audio processed thus far. - /// - /// Guaranteed to be 100 when the audio is fully processed and the results are - /// available. - /// - /// Output only. - core.int progressPercent; - - /// Time when the request was received. - /// - /// Output only. - core.String startTime; - - /// The URI of the audio file being transcribed. - /// - /// Empty if the audio was sent as byte content. - core.String uri; - - LongRunningRecognizeMetadata(); - - LongRunningRecognizeMetadata.fromJson(core.Map _json) { - if (_json.containsKey('lastUpdateTime')) { - lastUpdateTime = _json['lastUpdateTime'] as core.String; - } - if (_json.containsKey('progressPercent')) { - progressPercent = _json['progressPercent'] as core.int; - } - if (_json.containsKey('startTime')) { - startTime = _json['startTime'] as core.String; - } - if (_json.containsKey('uri')) { - uri = _json['uri'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (lastUpdateTime != null) { - _json['lastUpdateTime'] = lastUpdateTime; - } - if (progressPercent != null) { - _json['progressPercent'] = progressPercent; - } - if (startTime != null) { - _json['startTime'] = startTime; - } - if (uri != null) { - _json['uri'] = uri; - } - return _json; - } -} - -/// The only message returned to the client by the `LongRunningRecognize` -/// method. -/// -/// It contains the result as zero or more sequential SpeechRecognitionResult -/// messages. It is included in the `result.response` field of the `Operation` -/// returned by the `GetOperation` call of the `google::longrunning::Operations` -/// service. -class LongRunningRecognizeResponse { - /// Sequential list of transcription results corresponding to sequential - /// portions of audio. - /// - /// Output only. - core.List<SpeechRecognitionResult> results; - - LongRunningRecognizeResponse(); - - LongRunningRecognizeResponse.fromJson(core.Map _json) { - if (_json.containsKey('results')) { - results = (_json['results'] as core.List) - .map<SpeechRecognitionResult>((value) => - SpeechRecognitionResult.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (results != null) { - _json['results'] = results.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Alternative hypotheses (a.k.a. n-best list). -class SpeechRecognitionAlternative { - /// The confidence estimate between 0.0 and 1.0. - /// - /// A higher number indicates an estimated greater likelihood that the - /// recognized words are correct. This field is set only for the top - /// alternative of a non-streaming result or, of a streaming result where - /// `is_final=true`. This field is not guaranteed to be accurate and users - /// should not rely on it to be always provided. The default of 0.0 is a - /// sentinel value indicating `confidence` was not set. - /// - /// Output only. - core.double confidence; - - /// Transcript text representing the words that the user spoke. - /// - /// Output only. - core.String transcript; - - /// A list of word-specific information for each recognized word. - /// - /// Note: When `enable_speaker_diarization` is true, you will see all the - /// words from the beginning of the audio. - /// - /// Output only. - core.List<WordInfo> words; - - SpeechRecognitionAlternative(); - - SpeechRecognitionAlternative.fromJson(core.Map _json) { - if (_json.containsKey('confidence')) { - confidence = (_json['confidence'] as core.num).toDouble(); - } - if (_json.containsKey('transcript')) { - transcript = _json['transcript'] as core.String; - } - if (_json.containsKey('words')) { - words = (_json['words'] as core.List) - .map<WordInfo>((value) => - WordInfo.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (confidence != null) { - _json['confidence'] = confidence; - } - if (transcript != null) { - _json['transcript'] = transcript; - } - if (words != null) { - _json['words'] = words.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// A speech recognition result corresponding to a portion of the audio. -class SpeechRecognitionResult { - /// May contain one or more recognition hypotheses (up to the maximum - /// specified in `max_alternatives`). - /// - /// These alternatives are ordered in terms of accuracy, with the top (first) - /// alternative being the most probable, as ranked by the recognizer. - /// - /// Output only. - core.List<SpeechRecognitionAlternative> alternatives; - - /// For multi-channel audio, this is the channel number corresponding to the - /// recognized result for the audio from that channel. - /// - /// For `audio_channel_count` = N, its output values can range from `1` to - /// `N`. - /// - /// Output only. - core.int channelTag; - - /// The \[BCP-47\](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - /// of the language in this result. - /// - /// This language code was detected to have the most likelihood of being - /// spoken in the audio. - /// - /// Output only. - core.String languageCode; - - SpeechRecognitionResult(); - - SpeechRecognitionResult.fromJson(core.Map _json) { - if (_json.containsKey('alternatives')) { - alternatives = (_json['alternatives'] as core.List) - .map<SpeechRecognitionAlternative>((value) => - SpeechRecognitionAlternative.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('channelTag')) { - channelTag = _json['channelTag'] as core.int; - } - if (_json.containsKey('languageCode')) { - languageCode = _json['languageCode'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (alternatives != null) { - _json['alternatives'] = - alternatives.map((value) => value.toJson()).toList(); - } - if (channelTag != null) { - _json['channelTag'] = channelTag; - } - if (languageCode != null) { - _json['languageCode'] = languageCode; - } - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Word-specific information for recognized words. -class WordInfo { - /// The confidence estimate between 0.0 and 1.0. - /// - /// A higher number indicates an estimated greater likelihood that the - /// recognized words are correct. This field is set only for the top - /// alternative of a non-streaming result or, of a streaming result where - /// `is_final=true`. This field is not guaranteed to be accurate and users - /// should not rely on it to be always provided. The default of 0.0 is a - /// sentinel value indicating `confidence` was not set. - /// - /// Output only. - core.double confidence; - - /// Time offset relative to the beginning of the audio, and corresponding to - /// the end of the spoken word. - /// - /// This field is only set if `enable_word_time_offsets=true` and only in the - /// top hypothesis. This is an experimental feature and the accuracy of the - /// time offset can vary. - /// - /// Output only. - core.String endOffset; - - /// A distinct integer value is assigned for every speaker within the audio. - /// - /// This field specifies which one of those speakers was detected to have - /// spoken this word. Value ranges from `1` to - /// `diarization_config.max_speaker_count` . `speaker_tag` is set if - /// `diarization_config.enable_speaker_diarization` = `true` and only in the - /// top alternative. - /// - /// Output only. - core.int speakerTag; - - /// Time offset relative to the beginning of the audio, and corresponding to - /// the start of the spoken word. - /// - /// This field is only set if `enable_word_time_offsets=true` and only in the - /// top hypothesis. This is an experimental feature and the accuracy of the - /// time offset can vary. - /// - /// Output only. - core.String startOffset; - - /// The word corresponding to this set of information. - /// - /// Output only. - core.String word; - - WordInfo(); - - WordInfo.fromJson(core.Map _json) { - if (_json.containsKey('confidence')) { - confidence = (_json['confidence'] as core.num).toDouble(); - } - if (_json.containsKey('endOffset')) { - endOffset = _json['endOffset'] as core.String; - } - if (_json.containsKey('speakerTag')) { - speakerTag = _json['speakerTag'] as core.int; - } - if (_json.containsKey('startOffset')) { - startOffset = _json['startOffset'] as core.String; - } - if (_json.containsKey('word')) { - word = _json['word'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (confidence != null) { - _json['confidence'] = confidence; - } - if (endOffset != null) { - _json['endOffset'] = endOffset; - } - if (speakerTag != null) { - _json['speakerTag'] = speakerTag; - } - if (startOffset != null) { - _json['startOffset'] = startOffset; - } - if (word != null) { - _json['word'] = word; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/sqladmin/v1beta4.dart b/generated/googleapis_beta/lib/sqladmin/v1beta4.dart index 57a3c73..b2b4cda 100644 --- a/generated/googleapis_beta/lib/sqladmin/v1beta4.dart +++ b/generated/googleapis_beta/lib/sqladmin/v1beta4.dart
@@ -49,7 +49,7 @@ /// API for Cloud SQL database instance management class SQLAdminApi { - /// View and manage your data across Google Cloud Platform services + /// See, edit, configure, and delete your Google Cloud Platform data static const cloudPlatformScope = 'https://www.googleapis.com/auth/cloud-platform'; @@ -2440,7 +2440,9 @@ /// /// [instance] - Cloud SQL instance ID. This does not include the project ID. /// - /// [syncMode] - External sync mode + /// [skipVerification] - Whether to skip the verification step (VESS). + /// + /// [syncMode] - External sync mode. /// Possible string values are: /// - "EXTERNAL_SYNC_MODE_UNSPECIFIED" : Unknown external sync mode, will be /// defaulted to ONLINE mode @@ -2462,6 +2464,7 @@ async.Future<Operation> startExternalSync( core.String project, core.String instance, { + core.bool skipVerification, core.String syncMode, core.String $fields, }) { @@ -2478,6 +2481,9 @@ if (instance == null) { throw core.ArgumentError('Parameter instance is required.'); } + if (skipVerification != null) { + _queryParams['skipVerification'] = ['${skipVerification}']; + } if (syncMode != null) { _queryParams['syncMode'] = [syncMode]; } @@ -3344,6 +3350,9 @@ /// The warning message. core.String message; + /// The region name for REGION_UNREACHABLE warning. + core.String region; + ApiWarning(); ApiWarning.fromJson(core.Map _json) { @@ -3353,6 +3362,9 @@ if (_json.containsKey('message')) { message = _json['message'] as core.String; } + if (_json.containsKey('region')) { + region = _json['region'] as core.String; + } } core.Map<core.String, core.Object> toJson() { @@ -3363,6 +3375,9 @@ if (message != null) { _json['message'] = message; } + if (region != null) { + _json['region'] = region; + } return _json; } } @@ -3470,6 +3485,37 @@ } } +/// Backup context. +class BackupContext { + /// The identifier of the backup. + core.String backupId; + + /// This is always *sql#backupContext*. + core.String kind; + + BackupContext(); + + BackupContext.fromJson(core.Map _json) { + if (_json.containsKey('backupId')) { + backupId = _json['backupId'] as core.String; + } + if (_json.containsKey('kind')) { + kind = _json['kind'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (backupId != null) { + _json['backupId'] = backupId; + } + if (kind != null) { + _json['kind'] = kind; + } + return _json; + } +} + /// We currently only support backup retention by specifying the number of /// backups we will retain. class BackupRetentionSettings { @@ -3584,6 +3630,9 @@ core.String status; /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND". + /// + /// This field defaults to "ON_DEMAND" and is ignored, when specified for + /// insert requests. /// Possible string values are: /// - "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" : This is an unknown BackupRun type. /// - "AUTOMATED" : The backup schedule automatically triggers a backup. @@ -4188,9 +4237,22 @@ /// Use only on creation. core.String rootPassword; + /// The status indicating if instance satisfies physical zone separation. + /// + /// Reserved for future use. + core.bool satisfiesPzs; + /// The start time of any upcoming scheduled maintenance for this instance. SqlScheduledMaintenance scheduledMaintenance; + /// The Compute Engine zone that the failover instance is currently serving + /// from for a regional instance. + /// + /// This value could be different from the zone that was specified when the + /// instance was created if the instance has failed over to its + /// secondary/failover zone. Reserved for future use. + core.String secondaryGceZone; + /// The URI of this resource. core.String selfLink; @@ -4208,17 +4270,15 @@ /// The current serving state of the Cloud SQL instance. /// /// This can be one of the following. *SQL_INSTANCE_STATE_UNSPECIFIED*: The - /// state of the instance is unknown. *RUNNABLE*: The instance has been - /// stopped by owner. It is not currently running, but it's ready to be - /// restarted. *SUSPENDED*: The instance is not available, for example due to - /// problems with billing. for example due to problems with billing. - /// *PENDING_DELETE*: The instance is being deleted. *PENDING_CREATE*: The - /// instance is being created. *MAINTENANCE*: The instance is down for - /// maintenance. *FAILED*: The instance creation failed. + /// state of the instance is unknown. *RUNNABLE*: The instance is running, or + /// has been stopped by owner. *SUSPENDED*: The instance is not available, for + /// example due to problems with billing. for example due to problems with + /// billing. *PENDING_DELETE*: The instance is being deleted. + /// *PENDING_CREATE*: The instance is being created. *MAINTENANCE*: The + /// instance is down for maintenance. *FAILED*: The instance creation failed. /// Possible string values are: /// - "SQL_INSTANCE_STATE_UNSPECIFIED" : The state of the instance is unknown. - /// - "RUNNABLE" : The instance has been stopped by owner. It is not currently - /// running, but it's ready to be restarted. + /// - "RUNNABLE" : The instance is running, or has been stopped by owner. /// - "SUSPENDED" : The instance is not available, for example due to problems /// with billing. /// - "PENDING_DELETE" : The instance is being deleted. @@ -4312,10 +4372,16 @@ if (_json.containsKey('rootPassword')) { rootPassword = _json['rootPassword'] as core.String; } + if (_json.containsKey('satisfiesPzs')) { + satisfiesPzs = _json['satisfiesPzs'] as core.bool; + } if (_json.containsKey('scheduledMaintenance')) { scheduledMaintenance = SqlScheduledMaintenance.fromJson( _json['scheduledMaintenance'] as core.Map<core.String, core.dynamic>); } + if (_json.containsKey('secondaryGceZone')) { + secondaryGceZone = _json['secondaryGceZone'] as core.String; + } if (_json.containsKey('selfLink')) { selfLink = _json['selfLink'] as core.String; } @@ -4411,9 +4477,15 @@ if (rootPassword != null) { _json['rootPassword'] = rootPassword; } + if (satisfiesPzs != null) { + _json['satisfiesPzs'] = satisfiesPzs; + } if (scheduledMaintenance != null) { _json['scheduledMaintenance'] = scheduledMaintenance.toJson(); } + if (secondaryGceZone != null) { + _json['secondaryGceZone'] = secondaryGceZone; + } if (selfLink != null) { _json['selfLink'] = selfLink; } @@ -4759,6 +4831,8 @@ } /// Options for exporting data as CSV. +/// +/// *MySQL* and *PostgreSQL* instances only. class ExportContextCsvExportOptions { /// The select query used to extract the data. core.String selectQuery; @@ -4785,9 +4859,10 @@ /// Option to include SQL statement required to set up replication. /// /// If set to *1*, the dump file includes a CHANGE MASTER TO statement with - /// the binary log coordinates. If set to *2*, the CHANGE MASTER TO statement - /// is written as a SQL comment, and has no effect. All other values are - /// ignored. + /// the binary log coordinates, and --set-gtid-purged is set to ON. If set to + /// *2*, the CHANGE MASTER TO statement is written as a SQL comment and has no + /// effect. If set to any value other than *1*, --set-gtid-purged is set to + /// OFF. core.int masterData; ExportContextSqlExportOptionsMysqlExportOptions(); @@ -4858,6 +4933,8 @@ /// Database instance export context. class ExportContext { /// Options for exporting data as CSV. + /// + /// *MySQL* and *PostgreSQL* instances only. ExportContextCsvExportOptions csvExportOptions; /// Databases to be exported. @@ -4875,7 +4952,7 @@ /// The file type for the specified uri. /// /// *SQL*: The file contains SQL statements. *CSV*: The file contains CSV - /// data. + /// data. *BAK*: The file contains backup data for a SQL Server instance. /// Possible string values are: /// - "SQL_FILE_TYPE_UNSPECIFIED" : Unknown file type. /// - "SQL" : File containing SQL statements. @@ -4895,10 +4972,9 @@ /// The path to the file in Google Cloud Storage where the export will be /// stored. /// - /// The URI is in the form *gs: //bucketName/fileName*. If the file already - /// exists, the requests // succeeds, but the operation fails. If *fileType* - /// is // *SQL* and the filename ends with .gz, the contents are // - /// compressed. + /// The URI is in the form *gs://bucketName/fileName*. If the file already + /// exists, the request succeeds, but the operation fails. If *fileType* is + /// *SQL* and the filename ends with .gz, the contents are compressed. core.String uri; ExportContext(); @@ -5300,12 +5376,12 @@ /// This is always *sql#importContext*. core.String kind; - /// Path to the import file in Cloud Storage, in the form *gs: - /// //bucketName/fileName*. + /// Path to the import file in Cloud Storage, in the form + /// *gs://bucketName/fileName*. /// - /// Compressed gzip files (.gz) are supported // when *fileType* is *SQL*. The - /// instance must have // write permissions to the bucket and read access to - /// the file. + /// Compressed gzip files (.gz) are supported when *fileType* is *SQL*. The + /// instance must have write permissions to the bucket and read access to the + /// file. core.String uri; ImportContext(); @@ -5363,6 +5439,63 @@ } } +/// Insights configuration. +/// +/// This specifies when Cloud SQL Insights feature is enabled and optional +/// configuration. +class InsightsConfig { + /// Whether Query Insights feature is enabled. + core.bool queryInsightsEnabled; + + /// Maximum query length stored in bytes. + /// + /// Default value: 1024 bytes. Range: 256-4500 bytes. Query length more than + /// this field value will be truncated to this value. When unset, query length + /// will be the default value. + core.int queryStringLength; + + /// Whether Query Insights will record application tags from query when + /// enabled. + core.bool recordApplicationTags; + + /// Whether Query Insights will record client address when enabled. + core.bool recordClientAddress; + + InsightsConfig(); + + InsightsConfig.fromJson(core.Map _json) { + if (_json.containsKey('queryInsightsEnabled')) { + queryInsightsEnabled = _json['queryInsightsEnabled'] as core.bool; + } + if (_json.containsKey('queryStringLength')) { + queryStringLength = _json['queryStringLength'] as core.int; + } + if (_json.containsKey('recordApplicationTags')) { + recordApplicationTags = _json['recordApplicationTags'] as core.bool; + } + if (_json.containsKey('recordClientAddress')) { + recordClientAddress = _json['recordClientAddress'] as core.bool; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (queryInsightsEnabled != null) { + _json['queryInsightsEnabled'] = queryInsightsEnabled; + } + if (queryStringLength != null) { + _json['queryStringLength'] = queryStringLength; + } + if (recordApplicationTags != null) { + _json['recordApplicationTags'] = recordApplicationTags; + } + if (recordClientAddress != null) { + _json['recordClientAddress'] = recordClientAddress; + } + return _json; + } +} + /// Database instance clone request. class InstancesCloneRequest { /// Contains details about the clone operation. @@ -5783,6 +5916,12 @@ /// This is always *sql#locationPreference*. core.String kind; + /// The preferred Compute Engine zone for the secondary/failover (for example: + /// us-central1-a, us-central1-b, etc.). + /// + /// Reserved for future use. + core.String secondaryZone; + /// The preferred Compute Engine zone (for example: us-central1-a, /// us-central1-b, etc.). core.String zone; @@ -5796,6 +5935,9 @@ if (_json.containsKey('kind')) { kind = _json['kind'] as core.String; } + if (_json.containsKey('secondaryZone')) { + secondaryZone = _json['secondaryZone'] as core.String; + } if (_json.containsKey('zone')) { zone = _json['zone'] as core.String; } @@ -5809,6 +5951,9 @@ if (kind != null) { _json['kind'] = kind; } + if (secondaryZone != null) { + _json['secondaryZone'] = secondaryZone; + } if (zone != null) { _json['zone'] = zone; } @@ -6092,8 +6237,11 @@ /// An Operation resource. /// /// For successful operations that return an Operation resource, only the fields -/// relevant to the operation are populated in the resource. +/// relevant to the operation are populated in the resource. Next field: 18 class Operation { + /// The context for backup operation, if applicable. + BackupContext backupContext; + /// The time this operation finished in UTC timezone in RFC 3339 format, for /// example *2012-11-15T16:19:00.094Z*. core.String endTime; @@ -6204,6 +6352,10 @@ Operation(); Operation.fromJson(core.Map _json) { + if (_json.containsKey('backupContext')) { + backupContext = BackupContext.fromJson( + _json['backupContext'] as core.Map<core.String, core.dynamic>); + } if (_json.containsKey('endTime')) { endTime = _json['endTime'] as core.String; } @@ -6256,6 +6408,9 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; + if (backupContext != null) { + _json['backupContext'] = backupContext.toJson(); + } if (endTime != null) { _json['endTime'] = endTime; } @@ -6624,7 +6779,8 @@ /// - "ON_DEMAND" : The instance starts upon receiving requests. core.String activationPolicy; - /// Active Directory configuration, for now relevant only for SQL Server + /// Active Directory configuration, relevant only for Cloud SQL for SQL + /// Server. SqlActiveDirectoryConfig activeDirectoryConfig; /// The App Engine app IDs that can access this instance. @@ -6685,6 +6841,9 @@ /// Deny maintenance periods core.List<DenyMaintenancePeriod> denyMaintenancePeriods; + /// Insights configuration, for now relevant only for Postgres. + InsightsConfig insightsConfig; + /// The settings for IP Management. /// /// This allows to enable or disable the instance IP and manage which external @@ -6813,6 +6972,10 @@ value as core.Map<core.String, core.dynamic>)) .toList(); } + if (_json.containsKey('insightsConfig')) { + insightsConfig = InsightsConfig.fromJson( + _json['insightsConfig'] as core.Map<core.String, core.dynamic>); + } if (_json.containsKey('ipConfiguration')) { ipConfiguration = IpConfiguration.fromJson( _json['ipConfiguration'] as core.Map<core.String, core.dynamic>); @@ -6898,6 +7061,9 @@ _json['denyMaintenancePeriods'] = denyMaintenancePeriods.map((value) => value.toJson()).toList(); } + if (insightsConfig != null) { + _json['insightsConfig'] = insightsConfig.toJson(); + } if (ipConfiguration != null) { _json['ipConfiguration'] = ipConfiguration.toJson(); } @@ -6935,12 +7101,12 @@ } } -/// Active Directory configuration, for now relevant only for SQL Server +/// Active Directory configuration, relevant only for Cloud SQL for SQL Server. class SqlActiveDirectoryConfig { - /// Domain name + /// The name of the domain (e.g., mydomain.com). core.String domain; - /// This will be always sql#activeDirectoryConfig. + /// This is always sql#activeDirectoryConfig. core.String kind; SqlActiveDirectoryConfig(); @@ -7008,6 +7174,10 @@ /// - "UNSUPPORTED_GTID_MODE" : The gtid_mode is not supported, applicable for /// MySQL. /// - "SQLSERVER_AGENT_NOT_RUNNING" : SQL Server Agent is not running. + /// - "UNSUPPORTED_TABLE_DEFINITION" : The table definition is not support due + /// to missing primary key or replica identity, applicable for postgres. + /// - "UNSUPPORTED_DEFINER" : The customer has a definer that will break EM + /// setup. core.String type; SqlExternalSyncSettingError(); @@ -7336,12 +7506,18 @@ /// SslCerts create ephemeral certificate request. class SslCertsCreateEphemeralRequest { + /// Access token to include in the signed certificate. + core.String accessToken; + /// PEM encoded public key to include in the signed certificate. core.String publicKey; SslCertsCreateEphemeralRequest(); SslCertsCreateEphemeralRequest.fromJson(core.Map _json) { + if (_json.containsKey('access_token')) { + accessToken = _json['access_token'] as core.String; + } if (_json.containsKey('public_key')) { publicKey = _json['public_key'] as core.String; } @@ -7349,6 +7525,9 @@ core.Map<core.String, core.Object> toJson() { final _json = <core.String, core.Object>{}; + if (accessToken != null) { + _json['access_token'] = accessToken; + } if (publicKey != null) { _json['public_key'] = publicKey; }
diff --git a/generated/googleapis_beta/lib/toolresults/v1beta3.dart b/generated/googleapis_beta/lib/toolresults/v1beta3.dart index 006462a..592bdcf 100644 --- a/generated/googleapis_beta/lib/toolresults/v1beta3.dart +++ b/generated/googleapis_beta/lib/toolresults/v1beta3.dart
@@ -3225,6 +3225,20 @@ } } +/// A warning that device ran out of memory +class DeviceOutOfMemory { + DeviceOutOfMemory(); + + DeviceOutOfMemory.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + /// A Duration represents a signed, fixed-length span of time represented as a /// count of seconds and fractions of seconds at nanosecond resolution. /// @@ -4849,6 +4863,20 @@ } } +/// A warning that there were issues in logcat collection. +class LogcatCollectionError { + LogcatCollectionError(); + + LogcatCollectionError.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + /// One dimension of the matrix of different runs of a step. class MatrixDimensionDefinition { MatrixDimensionDefinition(); @@ -7165,6 +7193,8 @@ /// crawl /// - "unityException" : An uncaught Unity exception was detected (these don't /// crash apps). + /// - "deviceOutOfMemory" : Device running out of memory was detected + /// - "logcatCollectionError" : Problems detected while collecting logcat core.String type; /// Warning message with additional details of the issue.
diff --git a/generated/googleapis_beta/lib/tpu/v1alpha1.dart b/generated/googleapis_beta/lib/tpu/v1alpha1.dart deleted file mode 100644 index 7704f63..0000000 --- a/generated/googleapis_beta/lib/tpu/v1alpha1.dart +++ /dev/null
@@ -1,2231 +0,0 @@ -// This is a generated file (see the discoveryapis_generator project). - -// ignore_for_file: camel_case_types -// ignore_for_file: comment_references -// ignore_for_file: file_names -// ignore_for_file: library_names -// ignore_for_file: lines_longer_than_80_chars -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: prefer_final_locals -// ignore_for_file: prefer_interpolation_to_compose_strings -// ignore_for_file: unnecessary_brace_in_string_interps -// ignore_for_file: unnecessary_cast -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: unnecessary_string_interpolations - -/// Cloud TPU API - v1alpha1 -/// -/// TPU API provides customers with access to Google TPU technology. -/// -/// For more information, see <https://cloud.google.com/tpu/> -/// -/// Create an instance of [TPUApi] to access these resources: -/// -/// - [ProjectsResource] -/// - [ProjectsLocationsResource] -/// - [ProjectsLocationsAcceleratorTypesResource] -/// - [ProjectsLocationsNodesResource] -/// - [ProjectsLocationsOperationsResource] -/// - [ProjectsLocationsTensorflowVersionsResource] -library tpu.v1alpha1; - -import 'dart:async' as async; -import 'dart:convert' as convert; -import 'dart:core' as core; - -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; -import 'package:http/http.dart' as http; - -import '../src/user_agent.dart'; - -export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' - show ApiRequestError, DetailedApiRequestError; - -/// TPU API provides customers with access to Google TPU technology. -class TPUApi { - /// View and manage your data across Google Cloud Platform services - static const cloudPlatformScope = - 'https://www.googleapis.com/auth/cloud-platform'; - - final commons.ApiRequester _requester; - - ProjectsResource get projects => ProjectsResource(_requester); - - TPUApi(http.Client client, - {core.String rootUrl = 'https://tpu.googleapis.com/', - core.String servicePath = ''}) - : _requester = - commons.ApiRequester(client, rootUrl, servicePath, userAgent); -} - -class ProjectsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsResource get locations => - ProjectsLocationsResource(_requester); - - ProjectsResource(commons.ApiRequester client) : _requester = client; -} - -class ProjectsLocationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAcceleratorTypesResource get acceleratorTypes => - ProjectsLocationsAcceleratorTypesResource(_requester); - ProjectsLocationsNodesResource get nodes => - ProjectsLocationsNodesResource(_requester); - ProjectsLocationsOperationsResource get operations => - ProjectsLocationsOperationsResource(_requester); - ProjectsLocationsTensorflowVersionsResource get tensorflowVersions => - ProjectsLocationsTensorflowVersionsResource(_requester); - - ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; - - /// Gets information about a location. - /// - /// Request parameters: - /// - /// [name] - Resource name for the location. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Location]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Location> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists information about the supported locations for this service. - /// - /// Request parameters: - /// - /// [name] - The resource that owns the locations collection, if applicable. - /// Value must have pattern `^projects/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListLocationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListLocationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/locations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListLocationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsAcceleratorTypesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsAcceleratorTypesResource(commons.ApiRequester client) - : _requester = client; - - /// Gets AcceleratorType. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/acceleratorTypes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [AcceleratorType]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<AcceleratorType> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => - AcceleratorType.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists accelerator types supported by this API. - /// - /// Request parameters: - /// - /// [parent] - The parent resource name. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - List filter. - /// - /// [orderBy] - Sort results. - /// - /// [pageSize] - The maximum number of items to return. - /// - /// [pageToken] - The next_page_token value returned from a previous List - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListAcceleratorTypesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListAcceleratorTypesResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/acceleratorTypes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListAcceleratorTypesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsNodesResource { - final commons.ApiRequester _requester; - - ProjectsLocationsNodesResource(commons.ApiRequester client) - : _requester = client; - - /// Creates a node. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [parent] - The parent resource name. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [nodeId] - The unqualified resource name. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> create( - Node request, - core.String parent, { - core.String nodeId, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (nodeId != null) { - _queryParams['nodeId'] = [nodeId]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/nodes'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a node. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the details of a node. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Node]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Node> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Node.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists nodes. - /// - /// Request parameters: - /// - /// [parent] - The parent resource name. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [pageSize] - The maximum number of items to return. - /// - /// [pageToken] - The next_page_token value returned from a previous List - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListNodesResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListNodesResponse> list( - core.String parent, { - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/nodes'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListNodesResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Reimages a node's OS. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> reimage( - ReimageNodeRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':reimage'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Starts a node. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> start( - StartNodeRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name') + ':start'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Stops a node. - /// - /// [request] - The metadata request object. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/nodes/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> stop( - StopNodeRequest request, - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (request != null) { - _body = convert.json.encode(request.toJson()); - } - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = - 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name') + ':stop'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsOperationsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsOperationsResource(commons.ApiRequester client) - : _requester = client; - - /// Starts asynchronous cancellation on a long-running operation. - /// - /// The server makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - /// or other methods to check whether the cancellation succeeded or whether - /// the operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with an - /// Operation.error value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be cancelled. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> cancel( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$name') + - ':cancel'; - - final _response = _requester.request( - _url, - 'POST', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Deletes a long-running operation. - /// - /// This method indicates that the client is no longer interested in the - /// operation result. It does not cancel the operation. If the server doesn't - /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource to be deleted. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Empty]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Empty> delete( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'DELETE', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Gets the latest state of a long-running operation. - /// - /// Clients can use this method to poll the operation result at intervals as - /// recommended by the API service. - /// - /// Request parameters: - /// - /// [name] - The name of the operation resource. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [Operation]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<Operation> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists operations that match the specified filter in the request. - /// - /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. - /// NOTE: the `name` binding allows API services to override the binding to - /// use different resource name schemes, such as `users / * /operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users / * }/operations"` to their service configuration. For - /// backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding is - /// the parent resource, without the operations collection id. - /// - /// Request parameters: - /// - /// [name] - The name of the operation's parent resource. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - The standard list filter. - /// - /// [pageSize] - The standard list page size. - /// - /// [pageToken] - The standard list page token. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListOperationsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListOperationsResponse> list( - core.String name, { - core.String filter, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$name') + - '/operations'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListOperationsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -class ProjectsLocationsTensorflowVersionsResource { - final commons.ApiRequester _requester; - - ProjectsLocationsTensorflowVersionsResource(commons.ApiRequester client) - : _requester = client; - - /// Gets TensorFlow Version. - /// - /// Request parameters: - /// - /// [name] - The resource name. - /// Value must have pattern - /// `^projects/\[^/\]+/locations/\[^/\]+/tensorflowVersions/\[^/\]+$`. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [TensorFlowVersion]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<TensorFlowVersion> get( - core.String name, { - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (name == null) { - throw core.ArgumentError('Parameter name is required.'); - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + commons.Escaper.ecapeVariableReserved('$name'); - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => TensorFlowVersion.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } - - /// Lists TensorFlow versions supported by this API. - /// - /// Request parameters: - /// - /// [parent] - The parent resource name. - /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. - /// - /// [filter] - List filter. - /// - /// [orderBy] - Sort results. - /// - /// [pageSize] - The maximum number of items to return. - /// - /// [pageToken] - The next_page_token value returned from a previous List - /// request, if any. - /// - /// [$fields] - Selector specifying which fields to include in a partial - /// response. - /// - /// Completes with a [ListTensorFlowVersionsResponse]. - /// - /// Completes with a [commons.ApiRequestError] if the API endpoint returned an - /// error. - /// - /// If the used [http.Client] completes with an error when making a REST call, - /// this method will complete with the same error. - async.Future<ListTensorFlowVersionsResponse> list( - core.String parent, { - core.String filter, - core.String orderBy, - core.int pageSize, - core.String pageToken, - core.String $fields, - }) { - core.String _url; - final _queryParams = <core.String, core.List<core.String>>{}; - commons.Media _uploadMedia; - commons.UploadOptions _uploadOptions; - var _downloadOptions = commons.DownloadOptions.Metadata; - core.String _body; - - if (parent == null) { - throw core.ArgumentError('Parameter parent is required.'); - } - if (filter != null) { - _queryParams['filter'] = [filter]; - } - if (orderBy != null) { - _queryParams['orderBy'] = [orderBy]; - } - if (pageSize != null) { - _queryParams['pageSize'] = ['${pageSize}']; - } - if (pageToken != null) { - _queryParams['pageToken'] = [pageToken]; - } - if ($fields != null) { - _queryParams['fields'] = [$fields]; - } - - _url = 'v1alpha1/' + - commons.Escaper.ecapeVariableReserved('$parent') + - '/tensorflowVersions'; - - final _response = _requester.request( - _url, - 'GET', - body: _body, - queryParams: _queryParams, - uploadOptions: _uploadOptions, - uploadMedia: _uploadMedia, - downloadOptions: _downloadOptions, - ); - return _response.then( - (data) => ListTensorFlowVersionsResponse.fromJson( - data as core.Map<core.String, core.dynamic>), - ); - } -} - -/// A accelerator type that a Node can be configured with. -class AcceleratorType { - /// The resource name. - core.String name; - - /// the accelerator type. - core.String type; - - AcceleratorType(); - - AcceleratorType.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('type')) { - type = _json['type'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (type != null) { - _json['type'] = type; - } - return _json; - } -} - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. -/// -/// A typical example is to use it as the request or the response type of an API -/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns -/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON -/// object `{}`. -class Empty { - Empty(); - - Empty.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// Response for ListAcceleratorTypes. -class ListAcceleratorTypesResponse { - /// The listed nodes. - core.List<AcceleratorType> acceleratorTypes; - - /// The next page token or empty if none. - core.String nextPageToken; - - /// Locations that could not be reached. - core.List<core.String> unreachable; - - ListAcceleratorTypesResponse(); - - ListAcceleratorTypesResponse.fromJson(core.Map _json) { - if (_json.containsKey('acceleratorTypes')) { - acceleratorTypes = (_json['acceleratorTypes'] as core.List) - .map<AcceleratorType>((value) => AcceleratorType.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (acceleratorTypes != null) { - _json['acceleratorTypes'] = - acceleratorTypes.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// The response message for Locations.ListLocations. -class ListLocationsResponse { - /// A list of locations that matches the specified filter in the request. - core.List<Location> locations; - - /// The standard List next-page token. - core.String nextPageToken; - - ListLocationsResponse(); - - ListLocationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('locations')) { - locations = (_json['locations'] as core.List) - .map<Location>((value) => - Location.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (locations != null) { - _json['locations'] = locations.map((value) => value.toJson()).toList(); - } - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - return _json; - } -} - -/// Response for ListNodes. -class ListNodesResponse { - /// The next page token or empty if none. - core.String nextPageToken; - - /// The listed nodes. - core.List<Node> nodes; - - /// Locations that could not be reached. - core.List<core.String> unreachable; - - ListNodesResponse(); - - ListNodesResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('nodes')) { - nodes = (_json['nodes'] as core.List) - .map<Node>((value) => - Node.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (nodes != null) { - _json['nodes'] = nodes.map((value) => value.toJson()).toList(); - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// The response message for Operations.ListOperations. -class ListOperationsResponse { - /// The standard List next-page token. - core.String nextPageToken; - - /// A list of operations that matches the specified filter in the request. - core.List<Operation> operations; - - ListOperationsResponse(); - - ListOperationsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('operations')) { - operations = (_json['operations'] as core.List) - .map<Operation>((value) => - Operation.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (operations != null) { - _json['operations'] = operations.map((value) => value.toJson()).toList(); - } - return _json; - } -} - -/// Response for ListTensorFlowVersions. -class ListTensorFlowVersionsResponse { - /// The next page token or empty if none. - core.String nextPageToken; - - /// The listed nodes. - core.List<TensorFlowVersion> tensorflowVersions; - - /// Locations that could not be reached. - core.List<core.String> unreachable; - - ListTensorFlowVersionsResponse(); - - ListTensorFlowVersionsResponse.fromJson(core.Map _json) { - if (_json.containsKey('nextPageToken')) { - nextPageToken = _json['nextPageToken'] as core.String; - } - if (_json.containsKey('tensorflowVersions')) { - tensorflowVersions = (_json['tensorflowVersions'] as core.List) - .map<TensorFlowVersion>((value) => TensorFlowVersion.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('unreachable')) { - unreachable = (_json['unreachable'] as core.List) - .map<core.String>((value) => value as core.String) - .toList(); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (nextPageToken != null) { - _json['nextPageToken'] = nextPageToken; - } - if (tensorflowVersions != null) { - _json['tensorflowVersions'] = - tensorflowVersions.map((value) => value.toJson()).toList(); - } - if (unreachable != null) { - _json['unreachable'] = unreachable; - } - return _json; - } -} - -/// A resource that represents Google Cloud Platform location. -class Location { - /// The friendly name for this location, typically a nearby city name. - /// - /// For example, "Tokyo". - core.String displayName; - - /// Cross-service attributes for the location. - /// - /// For example {"cloud.googleapis.com/region": "us-east1"} - core.Map<core.String, core.String> labels; - - /// The canonical id for this location. - /// - /// For example: `"us-east1"`. - core.String locationId; - - /// Service-specific metadata. - /// - /// For example the available capacity at the given location. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// Resource name for the location, which may vary between implementations. - /// - /// For example: `"projects/example-project/locations/us-east1"` - core.String name; - - Location(); - - Location.fromJson(core.Map _json) { - if (_json.containsKey('displayName')) { - displayName = _json['displayName'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('locationId')) { - locationId = _json['locationId'] as core.String; - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (displayName != null) { - _json['displayName'] = displayName; - } - if (labels != null) { - _json['labels'] = labels; - } - if (locationId != null) { - _json['locationId'] = locationId; - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - return _json; - } -} - -/// A network endpoint over which a TPU worker can be reached. -class NetworkEndpoint { - /// The IP address of this network endpoint. - core.String ipAddress; - - /// The port of this network endpoint. - core.int port; - - NetworkEndpoint(); - - NetworkEndpoint.fromJson(core.Map _json) { - if (_json.containsKey('ipAddress')) { - ipAddress = _json['ipAddress'] as core.String; - } - if (_json.containsKey('port')) { - port = _json['port'] as core.int; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (ipAddress != null) { - _json['ipAddress'] = ipAddress; - } - if (port != null) { - _json['port'] = port; - } - return _json; - } -} - -/// A TPU instance. -class Node { - /// The type of hardware accelerators associated with this node. - /// - /// Required. - core.String acceleratorType; - - /// The CIDR block that the TPU node will use when selecting an IP address. - /// - /// This CIDR block must be a /29 block; the Compute Engine networks API - /// forbids a smaller block, and using a larger block would be wasteful (a - /// node can only consume one IP address). Errors will occur if the CIDR block - /// has already been used for a currently existing TPU node, the CIDR block - /// conflicts with any subnetworks in the user's provided network, or the - /// provided network is peered with another network that is using that CIDR - /// block. - core.String cidrBlock; - - /// The time when the node was created. - /// - /// Output only. - core.String createTime; - - /// The user-supplied description of the TPU. - /// - /// Maximum of 512 characters. - core.String description; - - /// The health status of the TPU node. - /// Possible string values are: - /// - "HEALTH_UNSPECIFIED" : Health status is unknown: not initialized or - /// failed to retrieve. - /// - "HEALTHY" : The resource is healthy. - /// - "DEPRECATED_UNHEALTHY" : The resource is unhealthy. - /// - "TIMEOUT" : The resource is unresponsive. - /// - "UNHEALTHY_TENSORFLOW" : The in-guest ML stack is unhealthy. - /// - "UNHEALTHY_MAINTENANCE" : The node is under maintenance/priority boost - /// caused rescheduling and will resume running once rescheduled. - core.String health; - - /// If this field is populated, it contains a description of why the TPU Node - /// is unhealthy. - /// - /// Output only. - core.String healthDescription; - - /// DEPRECATED! Use network_endpoints instead. - /// - /// The network address for the TPU Node as visible to Compute Engine - /// instances. - /// - /// Output only. - core.String ipAddress; - - /// Resource labels to represent user-provided metadata. - core.Map<core.String, core.String> labels; - - /// The immutable name of the TPU - /// - /// Output only. - core.String name; - - /// The name of a network they wish to peer the TPU node to. - /// - /// It must be a preexisting Compute Engine network inside of the project on - /// which this API has been activated. If none is provided, "default" will be - /// used. - core.String network; - - /// The network endpoints where TPU workers can be accessed and sent work. - /// - /// It is recommended that Tensorflow clients of the node reach out to the 0th - /// entry in this map first. - /// - /// Output only. - core.List<NetworkEndpoint> networkEndpoints; - - /// DEPRECATED! Use network_endpoints instead. - /// - /// The network port for the TPU Node as visible to Compute Engine instances. - /// - /// Output only. - core.String port; - SchedulingConfig schedulingConfig; - - /// The service account used to run the tensor flow services within the node. - /// - /// To share resources, including Google Cloud Storage data, with the - /// Tensorflow job running in the Node, this account must have permissions to - /// that data. - /// - /// Output only. - core.String serviceAccount; - - /// The current state for the TPU Node. - /// - /// Output only. - /// Possible string values are: - /// - "STATE_UNSPECIFIED" : TPU node state is not known/set. - /// - "CREATING" : TPU node is being created. - /// - "READY" : TPU node has been created and is fully usable. - /// - "RESTARTING" : TPU node is restarting. - /// - "REIMAGING" : TPU node is undergoing reimaging. - /// - "DELETING" : TPU node is being deleted. - /// - "REPAIRING" : TPU node is being repaired and may be unusable. Details - /// can be found in the `help_description` field. - /// - "STOPPED" : TPU node is stopped. - /// - "STOPPING" : TPU node is currently stopping. - /// - "STARTING" : TPU node is currently starting. - /// - "PREEMPTED" : TPU node has been preempted. Only applies to Preemptible - /// TPU Nodes. - /// - "TERMINATED" : TPU node has been terminated due to maintenance or has - /// reached the end of its life cycle (for preemptible nodes). - /// - "HIDING" : TPU node is currently hiding. - /// - "HIDDEN" : TPU node has been hidden. - /// - "UNHIDING" : TPU node is currently unhiding. - core.String state; - - /// The Symptoms that have occurred to the TPU Node. - /// - /// Output only. - core.List<Symptom> symptoms; - - /// The version of Tensorflow running in the Node. - /// - /// Required. - core.String tensorflowVersion; - - /// Whether the VPC peering for the node is set up through Service Networking - /// API. - /// - /// The VPC Peering should be set up before provisioning the node. If this - /// field is set, cidr_block field should not be specified. If the network, - /// that you want to peer the TPU Node to, is Shared VPC networks, the node - /// must be created with this this field enabled. - core.bool useServiceNetworking; - - Node(); - - Node.fromJson(core.Map _json) { - if (_json.containsKey('acceleratorType')) { - acceleratorType = _json['acceleratorType'] as core.String; - } - if (_json.containsKey('cidrBlock')) { - cidrBlock = _json['cidrBlock'] as core.String; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('description')) { - description = _json['description'] as core.String; - } - if (_json.containsKey('health')) { - health = _json['health'] as core.String; - } - if (_json.containsKey('healthDescription')) { - healthDescription = _json['healthDescription'] as core.String; - } - if (_json.containsKey('ipAddress')) { - ipAddress = _json['ipAddress'] as core.String; - } - if (_json.containsKey('labels')) { - labels = - (_json['labels'] as core.Map).cast<core.String, core.String>().map( - (key, item) => core.MapEntry( - key, - item as core.String, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('network')) { - network = _json['network'] as core.String; - } - if (_json.containsKey('networkEndpoints')) { - networkEndpoints = (_json['networkEndpoints'] as core.List) - .map<NetworkEndpoint>((value) => NetworkEndpoint.fromJson( - value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('port')) { - port = _json['port'] as core.String; - } - if (_json.containsKey('schedulingConfig')) { - schedulingConfig = SchedulingConfig.fromJson( - _json['schedulingConfig'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('serviceAccount')) { - serviceAccount = _json['serviceAccount'] as core.String; - } - if (_json.containsKey('state')) { - state = _json['state'] as core.String; - } - if (_json.containsKey('symptoms')) { - symptoms = (_json['symptoms'] as core.List) - .map<Symptom>((value) => - Symptom.fromJson(value as core.Map<core.String, core.dynamic>)) - .toList(); - } - if (_json.containsKey('tensorflowVersion')) { - tensorflowVersion = _json['tensorflowVersion'] as core.String; - } - if (_json.containsKey('useServiceNetworking')) { - useServiceNetworking = _json['useServiceNetworking'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (acceleratorType != null) { - _json['acceleratorType'] = acceleratorType; - } - if (cidrBlock != null) { - _json['cidrBlock'] = cidrBlock; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (description != null) { - _json['description'] = description; - } - if (health != null) { - _json['health'] = health; - } - if (healthDescription != null) { - _json['healthDescription'] = healthDescription; - } - if (ipAddress != null) { - _json['ipAddress'] = ipAddress; - } - if (labels != null) { - _json['labels'] = labels; - } - if (name != null) { - _json['name'] = name; - } - if (network != null) { - _json['network'] = network; - } - if (networkEndpoints != null) { - _json['networkEndpoints'] = - networkEndpoints.map((value) => value.toJson()).toList(); - } - if (port != null) { - _json['port'] = port; - } - if (schedulingConfig != null) { - _json['schedulingConfig'] = schedulingConfig.toJson(); - } - if (serviceAccount != null) { - _json['serviceAccount'] = serviceAccount; - } - if (state != null) { - _json['state'] = state; - } - if (symptoms != null) { - _json['symptoms'] = symptoms.map((value) => value.toJson()).toList(); - } - if (tensorflowVersion != null) { - _json['tensorflowVersion'] = tensorflowVersion; - } - if (useServiceNetworking != null) { - _json['useServiceNetworking'] = useServiceNetworking; - } - return _json; - } -} - -/// This resource represents a long-running operation that is the result of a -/// network API call. -class Operation { - /// If the value is `false`, it means the operation is still in progress. - /// - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - core.bool done; - - /// The error result of the operation in case of failure or cancellation. - Status error; - - /// Service-specific metadata associated with the operation. - /// - /// It typically contains progress information and common metadata such as - /// create time. Some services might not provide such metadata. Any method - /// that returns a long-running operation should document the metadata type, - /// if any. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> metadata; - - /// The server-assigned name, which is only unique within the same service - /// that originally returns it. - /// - /// If you use the default HTTP mapping, the `name` should be a resource name - /// ending with `operations/{unique_id}`. - core.String name; - - /// The normal response of the operation in case of success. - /// - /// If the original method returns no data on success, such as `Delete`, the - /// response is `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` is - /// the original method name. For example, if the original method name is - /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.Map<core.String, core.Object> response; - - Operation(); - - Operation.fromJson(core.Map _json) { - if (_json.containsKey('done')) { - done = _json['done'] as core.bool; - } - if (_json.containsKey('error')) { - error = Status.fromJson( - _json['error'] as core.Map<core.String, core.dynamic>); - } - if (_json.containsKey('metadata')) { - metadata = - (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('response')) { - response = - (_json['response'] as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - ); - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (done != null) { - _json['done'] = done; - } - if (error != null) { - _json['error'] = error.toJson(); - } - if (metadata != null) { - _json['metadata'] = metadata; - } - if (name != null) { - _json['name'] = name; - } - if (response != null) { - _json['response'] = response; - } - return _json; - } -} - -/// Represents the metadata of the long-running operation. -class OperationMetadata { - /// API version used to start the operation. - /// - /// Output only. - core.String apiVersion; - - /// Identifies whether the user has requested cancellation of the operation. - /// - /// Operations that have successfully been cancelled have Operation.error - /// value with a google.rpc.Status.code of 1, corresponding to - /// `Code.CANCELLED`. - /// - /// Output only. - core.bool cancelRequested; - - /// The time the operation was created. - /// - /// Output only. - core.String createTime; - - /// The time the operation finished running. - /// - /// Output only. - core.String endTime; - - /// Human-readable status of the operation, if any. - /// - /// Output only. - core.String statusDetail; - - /// Server-defined resource path for the target of the operation. - /// - /// Output only. - core.String target; - - /// Name of the verb executed by the operation. - /// - /// Output only. - core.String verb; - - OperationMetadata(); - - OperationMetadata.fromJson(core.Map _json) { - if (_json.containsKey('apiVersion')) { - apiVersion = _json['apiVersion'] as core.String; - } - if (_json.containsKey('cancelRequested')) { - cancelRequested = _json['cancelRequested'] as core.bool; - } - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('endTime')) { - endTime = _json['endTime'] as core.String; - } - if (_json.containsKey('statusDetail')) { - statusDetail = _json['statusDetail'] as core.String; - } - if (_json.containsKey('target')) { - target = _json['target'] as core.String; - } - if (_json.containsKey('verb')) { - verb = _json['verb'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (apiVersion != null) { - _json['apiVersion'] = apiVersion; - } - if (cancelRequested != null) { - _json['cancelRequested'] = cancelRequested; - } - if (createTime != null) { - _json['createTime'] = createTime; - } - if (endTime != null) { - _json['endTime'] = endTime; - } - if (statusDetail != null) { - _json['statusDetail'] = statusDetail; - } - if (target != null) { - _json['target'] = target; - } - if (verb != null) { - _json['verb'] = verb; - } - return _json; - } -} - -/// Request for ReimageNode. -class ReimageNodeRequest { - /// The version for reimage to create. - core.String tensorflowVersion; - - ReimageNodeRequest(); - - ReimageNodeRequest.fromJson(core.Map _json) { - if (_json.containsKey('tensorflowVersion')) { - tensorflowVersion = _json['tensorflowVersion'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (tensorflowVersion != null) { - _json['tensorflowVersion'] = tensorflowVersion; - } - return _json; - } -} - -/// Sets the scheduling options for this node. -class SchedulingConfig { - /// Defines whether the node is preemptible. - core.bool preemptible; - - /// Whether the node is created under a reservation. - core.bool reserved; - - SchedulingConfig(); - - SchedulingConfig.fromJson(core.Map _json) { - if (_json.containsKey('preemptible')) { - preemptible = _json['preemptible'] as core.bool; - } - if (_json.containsKey('reserved')) { - reserved = _json['reserved'] as core.bool; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (preemptible != null) { - _json['preemptible'] = preemptible; - } - if (reserved != null) { - _json['reserved'] = reserved; - } - return _json; - } -} - -/// Request for StartNode. -class StartNodeRequest { - StartNodeRequest(); - - StartNodeRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. -/// -/// It is used by [gRPC](https://github.com/grpc). Each `Status` message -/// contains three pieces of data: error code, error message, and error details. -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -class Status { - /// The status code, which should be an enum value of google.rpc.Code. - core.int code; - - /// A list of messages that carry the error details. - /// - /// There is a common set of message types for APIs to use. - /// - /// The values for Object must be JSON objects. It can consist of `num`, - /// `String`, `bool` and `null` as well as `Map` and `List` values. - core.List<core.Map<core.String, core.Object>> details; - - /// A developer-facing error message, which should be in English. - /// - /// Any user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - core.String message; - - Status(); - - Status.fromJson(core.Map _json) { - if (_json.containsKey('code')) { - code = _json['code'] as core.int; - } - if (_json.containsKey('details')) { - details = (_json['details'] as core.List) - .map<core.Map<core.String, core.Object>>((value) => - (value as core.Map).cast<core.String, core.Object>().map( - (key, item) => core.MapEntry( - key, - item as core.Object, - ), - )) - .toList(); - } - if (_json.containsKey('message')) { - message = _json['message'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (code != null) { - _json['code'] = code; - } - if (details != null) { - _json['details'] = details; - } - if (message != null) { - _json['message'] = message; - } - return _json; - } -} - -/// Request for StopNode. -class StopNodeRequest { - StopNodeRequest(); - - StopNodeRequest.fromJson( - // ignore: avoid_unused_constructor_parameters - core.Map _json); - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - return _json; - } -} - -/// A Symptom instance. -class Symptom { - /// Timestamp when the Symptom is created. - core.String createTime; - - /// Detailed information of the current Symptom. - core.String details; - - /// Type of the Symptom. - /// Possible string values are: - /// - "SYMPTOM_TYPE_UNSPECIFIED" : Unspecified symptom. - /// - "LOW_MEMORY" : TPU VM memory is low. - /// - "OUT_OF_MEMORY" : TPU runtime is out of memory. - /// - "EXECUTE_TIMED_OUT" : TPU runtime execution has timed out. - /// - "MESH_BUILD_FAIL" : TPU runtime fails to construct a mesh that - /// recognizes each TPU device's neighbors. - /// - "HBM_OUT_OF_MEMORY" : TPU HBM is out of memory. - core.String symptomType; - - /// A string used to uniquely distinguish a worker within a TPU node. - core.String workerId; - - Symptom(); - - Symptom.fromJson(core.Map _json) { - if (_json.containsKey('createTime')) { - createTime = _json['createTime'] as core.String; - } - if (_json.containsKey('details')) { - details = _json['details'] as core.String; - } - if (_json.containsKey('symptomType')) { - symptomType = _json['symptomType'] as core.String; - } - if (_json.containsKey('workerId')) { - workerId = _json['workerId'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (createTime != null) { - _json['createTime'] = createTime; - } - if (details != null) { - _json['details'] = details; - } - if (symptomType != null) { - _json['symptomType'] = symptomType; - } - if (workerId != null) { - _json['workerId'] = workerId; - } - return _json; - } -} - -/// A tensorflow version that a Node can be configured with. -class TensorFlowVersion { - /// The resource name. - core.String name; - - /// the tensorflow version. - core.String version; - - TensorFlowVersion(); - - TensorFlowVersion.fromJson(core.Map _json) { - if (_json.containsKey('name')) { - name = _json['name'] as core.String; - } - if (_json.containsKey('version')) { - version = _json['version'] as core.String; - } - } - - core.Map<core.String, core.Object> toJson() { - final _json = <core.String, core.Object>{}; - if (name != null) { - _json['name'] = name; - } - if (version != null) { - _json['version'] = version; - } - return _json; - } -}
diff --git a/generated/googleapis_beta/lib/transcoder/v1beta1.dart b/generated/googleapis_beta/lib/transcoder/v1beta1.dart new file mode 100644 index 0000000..9012220 --- /dev/null +++ b/generated/googleapis_beta/lib/transcoder/v1beta1.dart
@@ -0,0 +1,3163 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Transcoder API - v1beta1 +/// +/// This API converts video files into formats suitable for consumer +/// distribution. +/// +/// For more information, see <https://cloud.google.com/transcoder/docs/> +/// +/// Create an instance of [TranscoderApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsJobTemplatesResource] +/// - [ProjectsLocationsJobsResource] +library transcoder.v1beta1; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// This API converts video files into formats suitable for consumer +/// distribution. +class TranscoderApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + TranscoderApi(http.Client client, + {core.String rootUrl = 'https://transcoder.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsJobTemplatesResource get jobTemplates => + ProjectsLocationsJobTemplatesResource(_requester); + ProjectsLocationsJobsResource get jobs => + ProjectsLocationsJobsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsJobTemplatesResource { + final commons.ApiRequester _requester; + + ProjectsLocationsJobTemplatesResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a job template in the specified region. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent location to create this job template. + /// Format: `projects/{project}/locations/{location}` + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [jobTemplateId] - Required. The ID to use for the job template, which will + /// become the final component of the job template's resource name. This value + /// should be 4-63 characters, and valid characters must match the regular + /// expression `a-zA-Z*`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [JobTemplate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<JobTemplate> create( + JobTemplate request, + core.String parent, { + core.String jobTemplateId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (jobTemplateId != null) { + _queryParams['jobTemplateId'] = [jobTemplateId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/jobTemplates'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + JobTemplate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a job template. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the job template to delete. + /// `projects/{project}/locations/{location}/jobTemplates/{job_template}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/jobTemplates/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns the job template data. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the job template to retrieve. Format: + /// `projects/{project}/locations/{location}/jobTemplates/{job_template}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/jobTemplates/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [JobTemplate]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<JobTemplate> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => + JobTemplate.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists job templates in the specified region. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent location from which to retrieve the + /// collection of job templates. Format: + /// `projects/{project}/locations/{location}` + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of items to return. + /// + /// [pageToken] - The `next_page_token` value returned from a previous List + /// request, if any. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListJobTemplatesResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListJobTemplatesResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/jobTemplates'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListJobTemplatesResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsJobsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsJobsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a job in the specified region. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. The parent location to create and process this job. + /// Format: `projects/{project}/locations/{location}` + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Job]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Job> create( + Job request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/jobs'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Job.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a job. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the job to delete. Format: + /// `projects/{project}/locations/{location}/jobs/{job}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/jobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns the job data. + /// + /// Request parameters: + /// + /// [name] - Required. The name of the job to retrieve. Format: + /// `projects/{project}/locations/{location}/jobs/{job}` + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/jobs/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Job]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Job> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Job.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists jobs in the specified region. + /// + /// Request parameters: + /// + /// [parent] - Required. Format: `projects/{project}/locations/{location}` + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [pageSize] - The maximum number of items to return. + /// + /// [pageToken] - The `next_page_token` value returned from a previous List + /// request, if any. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListJobsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListJobsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/jobs'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListJobsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Ad break. +class AdBreak { + /// Start time in seconds for the ad break, relative to the output file + /// timeline. + /// + /// The default is `0s`. + core.String startTimeOffset; + + AdBreak(); + + AdBreak.fromJson(core.Map _json) { + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + return _json; + } +} + +/// Configuration for AES-128 encryption. +class Aes128Encryption { + /// URI of the key delivery service. + /// + /// This URI is inserted into the M3U8 header. + /// + /// Required. + core.String keyUri; + + Aes128Encryption(); + + Aes128Encryption.fromJson(core.Map _json) { + if (_json.containsKey('keyUri')) { + keyUri = _json['keyUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (keyUri != null) { + _json['keyUri'] = keyUri; + } + return _json; + } +} + +/// Animation types. +class Animation { + /// End previous animation. + AnimationEnd animationEnd; + + /// Display overlay object with fade animation. + AnimationFade animationFade; + + /// Display static overlay object. + AnimationStatic animationStatic; + + Animation(); + + Animation.fromJson(core.Map _json) { + if (_json.containsKey('animationEnd')) { + animationEnd = AnimationEnd.fromJson( + _json['animationEnd'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('animationFade')) { + animationFade = AnimationFade.fromJson( + _json['animationFade'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('animationStatic')) { + animationStatic = AnimationStatic.fromJson( + _json['animationStatic'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (animationEnd != null) { + _json['animationEnd'] = animationEnd.toJson(); + } + if (animationFade != null) { + _json['animationFade'] = animationFade.toJson(); + } + if (animationStatic != null) { + _json['animationStatic'] = animationStatic.toJson(); + } + return _json; + } +} + +/// End previous overlay animation from the video. +/// +/// Without AnimationEnd, the overlay object will keep the state of previous +/// animation until the end of the video. +class AnimationEnd { + /// The time to end overlay object, in seconds. + /// + /// Default: 0 + core.String startTimeOffset; + + AnimationEnd(); + + AnimationEnd.fromJson(core.Map _json) { + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + return _json; + } +} + +/// Display overlay object with fade animation. +class AnimationFade { + /// The time to end the fade animation, in seconds. + /// + /// Default: `start_time_offset` + 1s + core.String endTimeOffset; + + /// Type of fade animation: `FADE_IN` or `FADE_OUT`. + /// + /// Required. + /// Possible string values are: + /// - "FADE_TYPE_UNSPECIFIED" : The fade type is not specified. + /// - "FADE_IN" : Fade the overlay object into view. + /// - "FADE_OUT" : Fade the overlay object out of view. + core.String fadeType; + + /// The time to start the fade animation, in seconds. + /// + /// Default: 0 + core.String startTimeOffset; + + /// Normalized coordinates based on output video resolution. + /// + /// Valid values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the + /// overlay object. For example, use the x and y coordinates {0,0} to position + /// the top-left corner of the overlay animation in the top-left corner of the + /// output video. + NormalizedCoordinate xy; + + AnimationFade(); + + AnimationFade.fromJson(core.Map _json) { + if (_json.containsKey('endTimeOffset')) { + endTimeOffset = _json['endTimeOffset'] as core.String; + } + if (_json.containsKey('fadeType')) { + fadeType = _json['fadeType'] as core.String; + } + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + if (_json.containsKey('xy')) { + xy = NormalizedCoordinate.fromJson( + _json['xy'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endTimeOffset != null) { + _json['endTimeOffset'] = endTimeOffset; + } + if (fadeType != null) { + _json['fadeType'] = fadeType; + } + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + if (xy != null) { + _json['xy'] = xy.toJson(); + } + return _json; + } +} + +/// Display static overlay object. +class AnimationStatic { + /// The time to start displaying the overlay object, in seconds. + /// + /// Default: 0 + core.String startTimeOffset; + + /// Normalized coordinates based on output video resolution. + /// + /// Valid values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the + /// overlay object. For example, use the x and y coordinates {0,0} to position + /// the top-left corner of the overlay animation in the top-left corner of the + /// output video. + NormalizedCoordinate xy; + + AnimationStatic(); + + AnimationStatic.fromJson(core.Map _json) { + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + if (_json.containsKey('xy')) { + xy = NormalizedCoordinate.fromJson( + _json['xy'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + if (xy != null) { + _json['xy'] = xy.toJson(); + } + return _json; + } +} + +/// Audio preprocessing configuration. +class Audio { + /// Enable boosting high frequency components. + /// + /// The default is `false`. + core.bool highBoost; + + /// Enable boosting low frequency components. + /// + /// The default is `false`. + core.bool lowBoost; + + /// Specify audio loudness normalization in loudness units relative to full + /// scale (LUFS). + /// + /// Enter a value between -24 and 0, where -24 is the Advanced Television + /// Systems Committee (ATSC A/85), -23 is the EU R128 broadcast standard, -19 + /// is the prior standard for online mono audio, -18 is the ReplayGain + /// standard, -16 is the prior standard for stereo audio, -14 is the new + /// online audio standard recommended by Spotify, as well as Amazon Echo, and + /// 0 disables normalization. The default is 0. + core.double lufs; + + Audio(); + + Audio.fromJson(core.Map _json) { + if (_json.containsKey('highBoost')) { + highBoost = _json['highBoost'] as core.bool; + } + if (_json.containsKey('lowBoost')) { + lowBoost = _json['lowBoost'] as core.bool; + } + if (_json.containsKey('lufs')) { + lufs = (_json['lufs'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (highBoost != null) { + _json['highBoost'] = highBoost; + } + if (lowBoost != null) { + _json['lowBoost'] = lowBoost; + } + if (lufs != null) { + _json['lufs'] = lufs; + } + return _json; + } +} + +/// The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. +class AudioAtom { + /// List of `Channel`s for this audio stream. + /// + /// for in-depth explanation. + core.List<AudioChannel> channels; + + /// The `EditAtom.key` that references the atom with audio inputs in the + /// `Job.edit_list`. + /// + /// Required. + core.String key; + + AudioAtom(); + + AudioAtom.fromJson(core.Map _json) { + if (_json.containsKey('channels')) { + channels = (_json['channels'] as core.List) + .map<AudioChannel>((value) => AudioChannel.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (channels != null) { + _json['channels'] = channels.map((value) => value.toJson()).toList(); + } + if (key != null) { + _json['key'] = key; + } + return _json; + } +} + +/// The audio channel. +class AudioChannel { + /// List of `Job.inputs` for this audio channel. + core.List<AudioChannelInput> inputs; + + AudioChannel(); + + AudioChannel.fromJson(core.Map _json) { + if (_json.containsKey('inputs')) { + inputs = (_json['inputs'] as core.List) + .map<AudioChannelInput>((value) => AudioChannelInput.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputs != null) { + _json['inputs'] = inputs.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Identifies which input file, track, and channel should be used. +class AudioChannelInput { + /// The zero-based index of the channel in the input file. + /// + /// Required. + core.int channel; + + /// Audio volume control in dB. + /// + /// Negative values decrease volume, positive values increase. The default is + /// 0. + core.double gainDb; + + /// The `Input.key` that identifies the input file. + /// + /// Required. + core.String key; + + /// The zero-based index of the track in the input file. + /// + /// Required. + core.int track; + + AudioChannelInput(); + + AudioChannelInput.fromJson(core.Map _json) { + if (_json.containsKey('channel')) { + channel = _json['channel'] as core.int; + } + if (_json.containsKey('gainDb')) { + gainDb = (_json['gainDb'] as core.num).toDouble(); + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('track')) { + track = _json['track'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (channel != null) { + _json['channel'] = channel; + } + if (gainDb != null) { + _json['gainDb'] = gainDb; + } + if (key != null) { + _json['key'] = key; + } + if (track != null) { + _json['track'] = track; + } + return _json; + } +} + +/// Audio stream resource. +class AudioStream { + /// Audio bitrate in bits per second. + /// + /// Must be between 1 and 10,000,000. + /// + /// Required. + core.int bitrateBps; + + /// Number of audio channels. + /// + /// Must be between 1 and 6. The default is 2. + core.int channelCount; + + /// A list of channel names specifying layout of the audio channels. + /// + /// This only affects the metadata embedded in the container headers, if + /// supported by the specified format. The default is `["fl", "fr"]`. + /// Supported channel names: - 'fl' - Front left channel - 'fr' - Front right + /// channel - 'sl' - Side left channel - 'sr' - Side right channel - 'fc' - + /// Front center channel - 'lfe' - Low frequency + core.List<core.String> channelLayout; + + /// The codec for this audio stream. + /// + /// The default is `"aac"`. Supported audio codecs: - 'aac' - 'aac-he' - + /// 'aac-he-v2' - 'mp3' - 'ac3' - 'eac3' + core.String codec; + + /// The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. + core.List<AudioAtom> mapping; + + /// The audio sample rate in Hertz. + /// + /// The default is 48000 Hertz. + core.int sampleRateHertz; + + AudioStream(); + + AudioStream.fromJson(core.Map _json) { + if (_json.containsKey('bitrateBps')) { + bitrateBps = _json['bitrateBps'] as core.int; + } + if (_json.containsKey('channelCount')) { + channelCount = _json['channelCount'] as core.int; + } + if (_json.containsKey('channelLayout')) { + channelLayout = (_json['channelLayout'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('codec')) { + codec = _json['codec'] as core.String; + } + if (_json.containsKey('mapping')) { + mapping = (_json['mapping'] as core.List) + .map<AudioAtom>((value) => + AudioAtom.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('sampleRateHertz')) { + sampleRateHertz = _json['sampleRateHertz'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bitrateBps != null) { + _json['bitrateBps'] = bitrateBps; + } + if (channelCount != null) { + _json['channelCount'] = channelCount; + } + if (channelLayout != null) { + _json['channelLayout'] = channelLayout; + } + if (codec != null) { + _json['codec'] = codec; + } + if (mapping != null) { + _json['mapping'] = mapping.map((value) => value.toJson()).toList(); + } + if (sampleRateHertz != null) { + _json['sampleRateHertz'] = sampleRateHertz; + } + return _json; + } +} + +/// Color preprocessing configuration. +class Color { + /// Control brightness of the video. + /// + /// Enter a value between -1 and 1, where -1 is minimum brightness and 1 is + /// maximum brightness. 0 is no change. The default is 0. + core.double brightness; + + /// Control black and white contrast of the video. + /// + /// Enter a value between -1 and 1, where -1 is minimum contrast and 1 is + /// maximum contrast. 0 is no change. The default is 0. + core.double contrast; + + /// Control color saturation of the video. + /// + /// Enter a value between -1 and 1, where -1 is fully desaturated and 1 is + /// maximum saturation. 0 is no change. The default is 0. + core.double saturation; + + Color(); + + Color.fromJson(core.Map _json) { + if (_json.containsKey('brightness')) { + brightness = (_json['brightness'] as core.num).toDouble(); + } + if (_json.containsKey('contrast')) { + contrast = (_json['contrast'] as core.num).toDouble(); + } + if (_json.containsKey('saturation')) { + saturation = (_json['saturation'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (brightness != null) { + _json['brightness'] = brightness; + } + if (contrast != null) { + _json['contrast'] = contrast; + } + if (saturation != null) { + _json['saturation'] = saturation; + } + return _json; + } +} + +/// Video cropping configuration for the input video. +/// +/// The cropped input video is scaled to match the output resolution. +class Crop { + /// The number of pixels to crop from the bottom. + /// + /// The default is 0. + core.int bottomPixels; + + /// The number of pixels to crop from the left. + /// + /// The default is 0. + core.int leftPixels; + + /// The number of pixels to crop from the right. + /// + /// The default is 0. + core.int rightPixels; + + /// The number of pixels to crop from the top. + /// + /// The default is 0. + core.int topPixels; + + Crop(); + + Crop.fromJson(core.Map _json) { + if (_json.containsKey('bottomPixels')) { + bottomPixels = _json['bottomPixels'] as core.int; + } + if (_json.containsKey('leftPixels')) { + leftPixels = _json['leftPixels'] as core.int; + } + if (_json.containsKey('rightPixels')) { + rightPixels = _json['rightPixels'] as core.int; + } + if (_json.containsKey('topPixels')) { + topPixels = _json['topPixels'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (bottomPixels != null) { + _json['bottomPixels'] = bottomPixels; + } + if (leftPixels != null) { + _json['leftPixels'] = leftPixels; + } + if (rightPixels != null) { + _json['rightPixels'] = rightPixels; + } + if (topPixels != null) { + _json['topPixels'] = topPixels; + } + return _json; + } +} + +/// Deblock preprocessing configuration. +class Deblock { + /// Enable deblocker. + /// + /// The default is `false`. + core.bool enabled; + + /// Set strength of the deblocker. + /// + /// Enter a value between 0 and 1. The higher the value, the stronger the + /// block removal. 0 is no deblocking. The default is 0. + core.double strength; + + Deblock(); + + Deblock.fromJson(core.Map _json) { + if (_json.containsKey('enabled')) { + enabled = _json['enabled'] as core.bool; + } + if (_json.containsKey('strength')) { + strength = (_json['strength'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (enabled != null) { + _json['enabled'] = enabled; + } + if (strength != null) { + _json['strength'] = strength; + } + return _json; + } +} + +/// Denoise preprocessing configuration. +class Denoise { + /// Set strength of the denoise. + /// + /// Enter a value between 0 and 1. The higher the value, the smoother the + /// image. 0 is no denoising. The default is 0. + core.double strength; + + /// Set the denoiser mode. + /// + /// The default is `"standard"`. Supported denoiser modes: - 'standard' - + /// 'grain' + core.String tune; + + Denoise(); + + Denoise.fromJson(core.Map _json) { + if (_json.containsKey('strength')) { + strength = (_json['strength'] as core.num).toDouble(); + } + if (_json.containsKey('tune')) { + tune = _json['tune'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (strength != null) { + _json['strength'] = strength; + } + if (tune != null) { + _json['tune'] = tune; + } + return _json; + } +} + +/// Edit atom. +class EditAtom { + /// End time in seconds for the atom, relative to the input file timeline. + /// + /// When `end_time_offset` is not specified, the `inputs` are used until the + /// end of the atom. + core.String endTimeOffset; + + /// List of `Input.key`s identifying files that should be used in this atom. + /// + /// The listed `inputs` must have the same timeline. + core.List<core.String> inputs; + + /// A unique key for this atom. + /// + /// Must be specified when using advanced mapping. + core.String key; + + /// Start time in seconds for the atom, relative to the input file timeline. + /// + /// The default is `0s`. + core.String startTimeOffset; + + EditAtom(); + + EditAtom.fromJson(core.Map _json) { + if (_json.containsKey('endTimeOffset')) { + endTimeOffset = _json['endTimeOffset'] as core.String; + } + if (_json.containsKey('inputs')) { + inputs = (_json['inputs'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (endTimeOffset != null) { + _json['endTimeOffset'] = endTimeOffset; + } + if (inputs != null) { + _json['inputs'] = inputs; + } + if (key != null) { + _json['key'] = key; + } + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + return _json; + } +} + +/// Encoding of an input file such as an audio, video, or text track. +/// +/// Elementary streams must be packaged before mapping and sharing between +/// different output formats. +class ElementaryStream { + /// Encoding of an audio stream. + AudioStream audioStream; + + /// A unique key for this elementary stream. + core.String key; + + /// Encoding of a text stream. + /// + /// For example, closed captions or subtitles. + TextStream textStream; + + /// Encoding of a video stream. + VideoStream videoStream; + + ElementaryStream(); + + ElementaryStream.fromJson(core.Map _json) { + if (_json.containsKey('audioStream')) { + audioStream = AudioStream.fromJson( + _json['audioStream'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('textStream')) { + textStream = TextStream.fromJson( + _json['textStream'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('videoStream')) { + videoStream = VideoStream.fromJson( + _json['videoStream'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (audioStream != null) { + _json['audioStream'] = audioStream.toJson(); + } + if (key != null) { + _json['key'] = key; + } + if (textStream != null) { + _json['textStream'] = textStream.toJson(); + } + if (videoStream != null) { + _json['videoStream'] = videoStream.toJson(); + } + return _json; + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Encryption settings. +class Encryption { + /// Configuration for AES-128 encryption. + Aes128Encryption aes128; + + /// 128 bit Initialization Vector (IV) represented as lowercase hexadecimal + /// digits. + /// + /// Required. + core.String iv; + + /// 128 bit encryption key represented as lowercase hexadecimal digits. + /// + /// Required. + core.String key; + + /// Configuration for MPEG Common Encryption (MPEG-CENC). + MpegCommonEncryption mpegCenc; + + /// Configuration for SAMPLE-AES encryption. + SampleAesEncryption sampleAes; + + Encryption(); + + Encryption.fromJson(core.Map _json) { + if (_json.containsKey('aes128')) { + aes128 = Aes128Encryption.fromJson( + _json['aes128'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('iv')) { + iv = _json['iv'] as core.String; + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('mpegCenc')) { + mpegCenc = MpegCommonEncryption.fromJson( + _json['mpegCenc'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('sampleAes')) { + sampleAes = SampleAesEncryption.fromJson( + _json['sampleAes'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (aes128 != null) { + _json['aes128'] = aes128.toJson(); + } + if (iv != null) { + _json['iv'] = iv; + } + if (key != null) { + _json['key'] = key; + } + if (mpegCenc != null) { + _json['mpegCenc'] = mpegCenc.toJson(); + } + if (sampleAes != null) { + _json['sampleAes'] = sampleAes.toJson(); + } + return _json; + } +} + +/// Additional information about the reasons for the failure. +class FailureDetail { + /// A description of the failure. + core.String description; + + FailureDetail(); + + FailureDetail.fromJson(core.Map _json) { + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (description != null) { + _json['description'] = description; + } + return _json; + } +} + +/// Overlaid jpeg image. +class Image { + /// Target image opacity. + /// + /// Valid values: `1.0` (solid, default) to `0.0` (transparent). + core.double alpha; + + /// Normalized image resolution, based on output video resolution. + /// + /// Valid values: `0.0`–`1.0`. To respect the original image aspect ratio, set + /// either `x` or `y` to `0.0`. To use the original image resolution, set both + /// `x` and `y` to `0.0`. + NormalizedCoordinate resolution; + + /// URI of the image in Cloud Storage. + /// + /// For example, `gs://bucket/inputs/image.jpeg`. + /// + /// Required. + core.String uri; + + Image(); + + Image.fromJson(core.Map _json) { + if (_json.containsKey('alpha')) { + alpha = (_json['alpha'] as core.num).toDouble(); + } + if (_json.containsKey('resolution')) { + resolution = NormalizedCoordinate.fromJson( + _json['resolution'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (alpha != null) { + _json['alpha'] = alpha; + } + if (resolution != null) { + _json['resolution'] = resolution.toJson(); + } + if (uri != null) { + _json['uri'] = uri; + } + return _json; + } +} + +/// Input asset. +class Input { + /// A unique key for this input. + /// + /// Must be specified when using advanced mapping and edit lists. + core.String key; + + /// Preprocessing configurations. + PreprocessingConfig preprocessingConfig; + + /// URI of the media. + /// + /// Input files must be at least 5 seconds in duration and stored in Cloud + /// Storage (for example, `gs://bucket/inputs/file.mp4`). If empty, the value + /// will be populated from `Job.input_uri`. + core.String uri; + + Input(); + + Input.fromJson(core.Map _json) { + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('preprocessingConfig')) { + preprocessingConfig = PreprocessingConfig.fromJson( + _json['preprocessingConfig'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (key != null) { + _json['key'] = key; + } + if (preprocessingConfig != null) { + _json['preprocessingConfig'] = preprocessingConfig.toJson(); + } + if (uri != null) { + _json['uri'] = uri; + } + return _json; + } +} + +/// Transcoding job resource. +class Job { + /// The configuration for this job. + JobConfig config; + + /// The time the job was created. + /// + /// Output only. + core.String createTime; + + /// The time the transcoding finished. + /// + /// Output only. + core.String endTime; + + /// List of failure details. + /// + /// This property may contain additional information about the failure when + /// `failure_reason` is present. *Note*: This feature is not yet available. + /// + /// Output only. + core.List<FailureDetail> failureDetails; + + /// A description of the reason for the failure. + /// + /// This property is always present when `state` is `FAILED`. + /// + /// Output only. + core.String failureReason; + + /// Input only. + /// + /// Specify the `input_uri` to populate empty `uri` fields in each element of + /// `Job.config.inputs` or `JobTemplate.config.inputs` when using template. + /// URI of the media. Input files must be at least 5 seconds in duration and + /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). + core.String inputUri; + + /// The resource name of the job. + /// + /// Format: `projects/{project}/locations/{location}/jobs/{job}` + core.String name; + + /// The origin URI. + /// + /// *Note*: This feature is not yet available. + /// + /// Output only. + OriginUri originUri; + + /// Input only. + /// + /// Specify the `output_uri` to populate an empty `Job.config.output.uri` or + /// `JobTemplate.config.output.uri` when using template. URI for the output + /// file(s). For example, `gs://my-bucket/outputs/`. + core.String outputUri; + + /// Specify the priority of the job. + /// + /// Enter a value between 0 and 100, where 0 is the lowest priority and 100 is + /// the highest priority. The default is 0. + core.int priority; + + /// Estimated fractional progress, from `0` to `1` for each step. + /// + /// *Note*: This feature is not yet available. + /// + /// Output only. + Progress progress; + + /// The time the transcoding started. + /// + /// Output only. + core.String startTime; + + /// The current state of the job. + /// + /// Output only. + /// Possible string values are: + /// - "PROCESSING_STATE_UNSPECIFIED" : The processing state is not specified. + /// - "PENDING" : The job is enqueued and will be picked up for processing + /// soon. + /// - "RUNNING" : The job is being processed. + /// - "SUCCEEDED" : The job has been completed successfully. + /// - "FAILED" : The job has failed. For additional information, see + /// `failure_reason` and `failure_details` + core.String state; + + /// Input only. + /// + /// Specify the `template_id` to use for populating `Job.config`. The default + /// is `preset/web-hd`. Preset Transcoder templates: - `preset/{preset_id}` - + /// User defined JobTemplate: `{job_template_id}` + core.String templateId; + + /// Job time to live value in days, which will be effective after job + /// completion. + /// + /// Job should be deleted automatically after the given TTL. Enter a value + /// between 1 and 90. The default is 30. + core.int ttlAfterCompletionDays; + + Job(); + + Job.fromJson(core.Map _json) { + if (_json.containsKey('config')) { + config = JobConfig.fromJson( + _json['config'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('failureDetails')) { + failureDetails = (_json['failureDetails'] as core.List) + .map<FailureDetail>((value) => FailureDetail.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('failureReason')) { + failureReason = _json['failureReason'] as core.String; + } + if (_json.containsKey('inputUri')) { + inputUri = _json['inputUri'] as core.String; + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('originUri')) { + originUri = OriginUri.fromJson( + _json['originUri'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('outputUri')) { + outputUri = _json['outputUri'] as core.String; + } + if (_json.containsKey('priority')) { + priority = _json['priority'] as core.int; + } + if (_json.containsKey('progress')) { + progress = Progress.fromJson( + _json['progress'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('templateId')) { + templateId = _json['templateId'] as core.String; + } + if (_json.containsKey('ttlAfterCompletionDays')) { + ttlAfterCompletionDays = _json['ttlAfterCompletionDays'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (config != null) { + _json['config'] = config.toJson(); + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (failureDetails != null) { + _json['failureDetails'] = + failureDetails.map((value) => value.toJson()).toList(); + } + if (failureReason != null) { + _json['failureReason'] = failureReason; + } + if (inputUri != null) { + _json['inputUri'] = inputUri; + } + if (name != null) { + _json['name'] = name; + } + if (originUri != null) { + _json['originUri'] = originUri.toJson(); + } + if (outputUri != null) { + _json['outputUri'] = outputUri; + } + if (priority != null) { + _json['priority'] = priority; + } + if (progress != null) { + _json['progress'] = progress.toJson(); + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (state != null) { + _json['state'] = state; + } + if (templateId != null) { + _json['templateId'] = templateId; + } + if (ttlAfterCompletionDays != null) { + _json['ttlAfterCompletionDays'] = ttlAfterCompletionDays; + } + return _json; + } +} + +/// Job configuration +class JobConfig { + /// List of ad breaks. + /// + /// Specifies where to insert ad break tags in the output manifests. + core.List<AdBreak> adBreaks; + + /// List of `Edit atom`s. + /// + /// Defines the ultimate timeline of the resulting file or manifest. + core.List<EditAtom> editList; + + /// List of elementary streams. + core.List<ElementaryStream> elementaryStreams; + + /// List of input assets stored in Cloud Storage. + core.List<Input> inputs; + + /// List of output manifests. + core.List<Manifest> manifests; + + /// List of multiplexing settings for output streams. + core.List<MuxStream> muxStreams; + + /// Output configuration. + Output output; + + /// List of overlays on the output video, in descending Z-order. + core.List<Overlay> overlays; + + /// Destination on Pub/Sub. + PubsubDestination pubsubDestination; + + /// List of output sprite sheets. + core.List<SpriteSheet> spriteSheets; + + JobConfig(); + + JobConfig.fromJson(core.Map _json) { + if (_json.containsKey('adBreaks')) { + adBreaks = (_json['adBreaks'] as core.List) + .map<AdBreak>((value) => + AdBreak.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('editList')) { + editList = (_json['editList'] as core.List) + .map<EditAtom>((value) => + EditAtom.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('elementaryStreams')) { + elementaryStreams = (_json['elementaryStreams'] as core.List) + .map<ElementaryStream>((value) => ElementaryStream.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('inputs')) { + inputs = (_json['inputs'] as core.List) + .map<Input>((value) => + Input.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('manifests')) { + manifests = (_json['manifests'] as core.List) + .map<Manifest>((value) => + Manifest.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('muxStreams')) { + muxStreams = (_json['muxStreams'] as core.List) + .map<MuxStream>((value) => + MuxStream.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('output')) { + output = Output.fromJson( + _json['output'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('overlays')) { + overlays = (_json['overlays'] as core.List) + .map<Overlay>((value) => + Overlay.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('pubsubDestination')) { + pubsubDestination = PubsubDestination.fromJson( + _json['pubsubDestination'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('spriteSheets')) { + spriteSheets = (_json['spriteSheets'] as core.List) + .map<SpriteSheet>((value) => SpriteSheet.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (adBreaks != null) { + _json['adBreaks'] = adBreaks.map((value) => value.toJson()).toList(); + } + if (editList != null) { + _json['editList'] = editList.map((value) => value.toJson()).toList(); + } + if (elementaryStreams != null) { + _json['elementaryStreams'] = + elementaryStreams.map((value) => value.toJson()).toList(); + } + if (inputs != null) { + _json['inputs'] = inputs.map((value) => value.toJson()).toList(); + } + if (manifests != null) { + _json['manifests'] = manifests.map((value) => value.toJson()).toList(); + } + if (muxStreams != null) { + _json['muxStreams'] = muxStreams.map((value) => value.toJson()).toList(); + } + if (output != null) { + _json['output'] = output.toJson(); + } + if (overlays != null) { + _json['overlays'] = overlays.map((value) => value.toJson()).toList(); + } + if (pubsubDestination != null) { + _json['pubsubDestination'] = pubsubDestination.toJson(); + } + if (spriteSheets != null) { + _json['spriteSheets'] = + spriteSheets.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Transcoding job template resource. +class JobTemplate { + /// The configuration for this template. + JobConfig config; + + /// The resource name of the job template. + /// + /// Format: + /// `projects/{project}/locations/{location}/jobTemplates/{job_template}` + core.String name; + + JobTemplate(); + + JobTemplate.fromJson(core.Map _json) { + if (_json.containsKey('config')) { + config = JobConfig.fromJson( + _json['config'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (config != null) { + _json['config'] = config.toJson(); + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// Response message for `TranscoderService.ListJobTemplates`. +class ListJobTemplatesResponse { + /// List of job templates in the specified region. + core.List<JobTemplate> jobTemplates; + + /// The pagination token. + core.String nextPageToken; + + ListJobTemplatesResponse(); + + ListJobTemplatesResponse.fromJson(core.Map _json) { + if (_json.containsKey('jobTemplates')) { + jobTemplates = (_json['jobTemplates'] as core.List) + .map<JobTemplate>((value) => JobTemplate.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (jobTemplates != null) { + _json['jobTemplates'] = + jobTemplates.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Response message for `TranscoderService.ListJobs`. +class ListJobsResponse { + /// List of jobs in the specified region. + core.List<Job> jobs; + + /// The pagination token. + core.String nextPageToken; + + ListJobsResponse(); + + ListJobsResponse.fromJson(core.Map _json) { + if (_json.containsKey('jobs')) { + jobs = (_json['jobs'] as core.List) + .map<Job>((value) => + Job.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (jobs != null) { + _json['jobs'] = jobs.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// Manifest configuration. +class Manifest { + /// The name of the generated file. + /// + /// The default is `"manifest"` with the extension suffix corresponding to the + /// `Manifest.type`. + core.String fileName; + + /// List of user given `MuxStream.key`s that should appear in this manifest. + /// + /// When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` + /// and `.m3u8` extension is generated for each element of the + /// `Manifest.mux_streams`. + /// + /// Required. + core.List<core.String> muxStreams; + + /// Type of the manifest, can be "HLS" or "DASH". + /// + /// Required. + /// Possible string values are: + /// - "MANIFEST_TYPE_UNSPECIFIED" : The manifest type is not specified. + /// - "HLS" : Create `"HLS"` manifest. The corresponding file extension is + /// `".m3u8"`. + /// - "DASH" : Create `"DASH"` manifest. The corresponding file extension is + /// `".mpd"`. + core.String type; + + Manifest(); + + Manifest.fromJson(core.Map _json) { + if (_json.containsKey('fileName')) { + fileName = _json['fileName'] as core.String; + } + if (_json.containsKey('muxStreams')) { + muxStreams = (_json['muxStreams'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('type')) { + type = _json['type'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (fileName != null) { + _json['fileName'] = fileName; + } + if (muxStreams != null) { + _json['muxStreams'] = muxStreams; + } + if (type != null) { + _json['type'] = type; + } + return _json; + } +} + +/// Configuration for MPEG Common Encryption (MPEG-CENC). +class MpegCommonEncryption { + /// 128 bit Key ID represented as lowercase hexadecimal digits for use with + /// common encryption. + /// + /// Required. + core.String keyId; + + /// Specify the encryption scheme. + /// + /// Supported encryption schemes: - 'cenc' - 'cbcs' + /// + /// Required. + core.String scheme; + + MpegCommonEncryption(); + + MpegCommonEncryption.fromJson(core.Map _json) { + if (_json.containsKey('keyId')) { + keyId = _json['keyId'] as core.String; + } + if (_json.containsKey('scheme')) { + scheme = _json['scheme'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (keyId != null) { + _json['keyId'] = keyId; + } + if (scheme != null) { + _json['scheme'] = scheme; + } + return _json; + } +} + +/// Multiplexing settings for output stream. +class MuxStream { + /// The container format. + /// + /// The default is `"mp4"` Supported container formats: - 'ts' - 'fmp4'- the + /// corresponding file extension is `".m4s"` - 'mp4' - 'vtt' + core.String container; + + /// List of `ElementaryStream.key`s multiplexed in this stream. + core.List<core.String> elementaryStreams; + + /// Encryption settings. + Encryption encryption; + + /// The name of the generated file. + /// + /// The default is `MuxStream.key` with the extension suffix corresponding to + /// the `MuxStream.container`. Individual segments also have an incremental + /// 10-digit zero-padded suffix starting from 0 before the extension, such as + /// `"mux_stream0000000123.ts"`. + core.String fileName; + + /// A unique key for this multiplexed stream. + /// + /// HLS media manifests will be named `MuxStream.key` with the `".m3u8"` + /// extension suffix. + core.String key; + + /// Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. + SegmentSettings segmentSettings; + + MuxStream(); + + MuxStream.fromJson(core.Map _json) { + if (_json.containsKey('container')) { + container = _json['container'] as core.String; + } + if (_json.containsKey('elementaryStreams')) { + elementaryStreams = (_json['elementaryStreams'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('encryption')) { + encryption = Encryption.fromJson( + _json['encryption'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('fileName')) { + fileName = _json['fileName'] as core.String; + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('segmentSettings')) { + segmentSettings = SegmentSettings.fromJson( + _json['segmentSettings'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (container != null) { + _json['container'] = container; + } + if (elementaryStreams != null) { + _json['elementaryStreams'] = elementaryStreams; + } + if (encryption != null) { + _json['encryption'] = encryption.toJson(); + } + if (fileName != null) { + _json['fileName'] = fileName; + } + if (key != null) { + _json['key'] = key; + } + if (segmentSettings != null) { + _json['segmentSettings'] = segmentSettings.toJson(); + } + return _json; + } +} + +/// 2D normalized coordinates. +/// +/// Default: `{0.0, 0.0}` +class NormalizedCoordinate { + /// Normalized x coordinate. + core.double x; + + /// Normalized y coordinate. + core.double y; + + NormalizedCoordinate(); + + NormalizedCoordinate.fromJson(core.Map _json) { + if (_json.containsKey('x')) { + x = (_json['x'] as core.num).toDouble(); + } + if (_json.containsKey('y')) { + y = (_json['y'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (x != null) { + _json['x'] = x; + } + if (y != null) { + _json['y'] = y; + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +class OperationMetadata { + /// API version used to start the operation. + /// + /// Output only. + core.String apiVersion; + + /// Identifies whether the user has requested cancellation of the operation. + /// + /// Operations that have successfully been cancelled have Operation.error + /// value with a google.rpc.Status.code of 1, corresponding to + /// `Code.CANCELLED`. + /// + /// Output only. + core.bool cancelRequested; + + /// The time the operation was created. + /// + /// Output only. + core.String createTime; + + /// The time the operation finished running. + /// + /// Output only. + core.String endTime; + + /// Human-readable status of the operation, if any. + /// + /// Output only. + core.String statusDetail; + + /// Server-defined resource path for the target of the operation. + /// + /// Output only. + core.String target; + + /// Name of the verb executed by the operation. + /// + /// Output only. + core.String verb; + + OperationMetadata(); + + OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('cancelRequested')) { + cancelRequested = _json['cancelRequested'] as core.bool; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('statusDetail')) { + statusDetail = _json['statusDetail'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (cancelRequested != null) { + _json['cancelRequested'] = cancelRequested; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (statusDetail != null) { + _json['statusDetail'] = statusDetail; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// The origin URI. +class OriginUri { + /// Dash manifest URI. + /// + /// If multiple Dash manifests are created, only the first one is listed. + core.String dash; + + /// HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. + /// + /// If multiple HLS manifests are created, only the first one is listed. + core.String hls; + + OriginUri(); + + OriginUri.fromJson(core.Map _json) { + if (_json.containsKey('dash')) { + dash = _json['dash'] as core.String; + } + if (_json.containsKey('hls')) { + hls = _json['hls'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (dash != null) { + _json['dash'] = dash; + } + if (hls != null) { + _json['hls'] = hls; + } + return _json; + } +} + +/// Location of output file(s) in a Cloud Storage bucket. +class Output { + /// URI for the output file(s). + /// + /// For example, `gs://my-bucket/outputs/`. If empty the value is populated + /// from `Job.output_uri`. + core.String uri; + + Output(); + + Output.fromJson(core.Map _json) { + if (_json.containsKey('uri')) { + uri = _json['uri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (uri != null) { + _json['uri'] = uri; + } + return _json; + } +} + +/// Overlay configuration. +class Overlay { + /// List of Animations. + /// + /// The list should be chronological, without any time overlap. + core.List<Animation> animations; + + /// Image overlay. + Image image; + + Overlay(); + + Overlay.fromJson(core.Map _json) { + if (_json.containsKey('animations')) { + animations = (_json['animations'] as core.List) + .map<Animation>((value) => + Animation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('image')) { + image = + Image.fromJson(_json['image'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (animations != null) { + _json['animations'] = animations.map((value) => value.toJson()).toList(); + } + if (image != null) { + _json['image'] = image.toJson(); + } + return _json; + } +} + +/// Preprocessing configurations. +class PreprocessingConfig { + /// Audio preprocessing configuration. + Audio audio; + + /// Color preprocessing configuration. + Color color; + + /// Specify the video cropping configuration. + Crop crop; + + /// Deblock preprocessing configuration. + Deblock deblock; + + /// Denoise preprocessing configuration. + Denoise denoise; + + PreprocessingConfig(); + + PreprocessingConfig.fromJson(core.Map _json) { + if (_json.containsKey('audio')) { + audio = + Audio.fromJson(_json['audio'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('color')) { + color = + Color.fromJson(_json['color'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('crop')) { + crop = + Crop.fromJson(_json['crop'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('deblock')) { + deblock = Deblock.fromJson( + _json['deblock'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('denoise')) { + denoise = Denoise.fromJson( + _json['denoise'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (audio != null) { + _json['audio'] = audio.toJson(); + } + if (color != null) { + _json['color'] = color.toJson(); + } + if (crop != null) { + _json['crop'] = crop.toJson(); + } + if (deblock != null) { + _json['deblock'] = deblock.toJson(); + } + if (denoise != null) { + _json['denoise'] = denoise.toJson(); + } + return _json; + } +} + +/// Estimated fractional progress for each step, from `0` to `1`. +class Progress { + /// Estimated fractional progress for `analyzing` step. + core.double analyzed; + + /// Estimated fractional progress for `encoding` step. + core.double encoded; + + /// Estimated fractional progress for `notifying` step. + core.double notified; + + /// Estimated fractional progress for `uploading` step. + core.double uploaded; + + Progress(); + + Progress.fromJson(core.Map _json) { + if (_json.containsKey('analyzed')) { + analyzed = (_json['analyzed'] as core.num).toDouble(); + } + if (_json.containsKey('encoded')) { + encoded = (_json['encoded'] as core.num).toDouble(); + } + if (_json.containsKey('notified')) { + notified = (_json['notified'] as core.num).toDouble(); + } + if (_json.containsKey('uploaded')) { + uploaded = (_json['uploaded'] as core.num).toDouble(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (analyzed != null) { + _json['analyzed'] = analyzed; + } + if (encoded != null) { + _json['encoded'] = encoded; + } + if (notified != null) { + _json['notified'] = notified; + } + if (uploaded != null) { + _json['uploaded'] = uploaded; + } + return _json; + } +} + +/// A Pub/Sub destination. +class PubsubDestination { + /// The name of the Pub/Sub topic to publish job completion notification to. + /// + /// For example: `projects/{project}/topics/{topic}`. + core.String topic; + + PubsubDestination(); + + PubsubDestination.fromJson(core.Map _json) { + if (_json.containsKey('topic')) { + topic = _json['topic'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (topic != null) { + _json['topic'] = topic; + } + return _json; + } +} + +/// Configuration for SAMPLE-AES encryption. +class SampleAesEncryption { + /// URI of the key delivery service. + /// + /// This URI is inserted into the M3U8 header. + /// + /// Required. + core.String keyUri; + + SampleAesEncryption(); + + SampleAesEncryption.fromJson(core.Map _json) { + if (_json.containsKey('keyUri')) { + keyUri = _json['keyUri'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (keyUri != null) { + _json['keyUri'] = keyUri; + } + return _json; + } +} + +/// Segment settings for `"ts"`, `"fmp4"` and `"vtt"`. +class SegmentSettings { + /// Create an individual segment file. + /// + /// The default is `false`. + /// + /// Required. + core.bool individualSegments; + + /// Duration of the segments in seconds. + /// + /// The default is `"6.0s"`. Note that `segmentDuration` must be greater than + /// or equal to \[`gopDuration`\](#videostream), and `segmentDuration` must be + /// divisible by \[`gopDuration`\](#videostream). + core.String segmentDuration; + + SegmentSettings(); + + SegmentSettings.fromJson(core.Map _json) { + if (_json.containsKey('individualSegments')) { + individualSegments = _json['individualSegments'] as core.bool; + } + if (_json.containsKey('segmentDuration')) { + segmentDuration = _json['segmentDuration'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (individualSegments != null) { + _json['individualSegments'] = individualSegments; + } + if (segmentDuration != null) { + _json['segmentDuration'] = segmentDuration; + } + return _json; + } +} + +/// Sprite sheet configuration. +class SpriteSheet { + /// The maximum number of sprites per row in a sprite sheet. + /// + /// The default is 0, which indicates no maximum limit. + core.int columnCount; + + /// End time in seconds, relative to the output file timeline. + /// + /// When `end_time_offset` is not specified, the sprites are generated until + /// the end of the output file. + core.String endTimeOffset; + + /// File name prefix for the generated sprite sheets. + /// + /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting + /// from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`. + /// + /// Required. + core.String filePrefix; + + /// Format type. + /// + /// The default is `"jpeg"`. Supported formats: - 'jpeg' + core.String format; + + /// Starting from `0s`, create sprites at regular intervals. + /// + /// Specify the interval value in seconds. + core.String interval; + + /// The maximum number of rows per sprite sheet. + /// + /// When the sprite sheet is full, a new sprite sheet is created. The default + /// is 0, which indicates no maximum limit. + core.int rowCount; + + /// The height of sprite in pixels. + /// + /// Must be an even integer. + /// + /// Required. + core.int spriteHeightPixels; + + /// The width of sprite in pixels. + /// + /// Must be an even integer. + /// + /// Required. + core.int spriteWidthPixels; + + /// Start time in seconds, relative to the output file timeline. + /// + /// Determines the first sprite to pick. The default is `0s`. + core.String startTimeOffset; + + /// Total number of sprites. + /// + /// Create the specified number of sprites distributed evenly across the + /// timeline of the output media. The default is 100. + core.int totalCount; + + SpriteSheet(); + + SpriteSheet.fromJson(core.Map _json) { + if (_json.containsKey('columnCount')) { + columnCount = _json['columnCount'] as core.int; + } + if (_json.containsKey('endTimeOffset')) { + endTimeOffset = _json['endTimeOffset'] as core.String; + } + if (_json.containsKey('filePrefix')) { + filePrefix = _json['filePrefix'] as core.String; + } + if (_json.containsKey('format')) { + format = _json['format'] as core.String; + } + if (_json.containsKey('interval')) { + interval = _json['interval'] as core.String; + } + if (_json.containsKey('rowCount')) { + rowCount = _json['rowCount'] as core.int; + } + if (_json.containsKey('spriteHeightPixels')) { + spriteHeightPixels = _json['spriteHeightPixels'] as core.int; + } + if (_json.containsKey('spriteWidthPixels')) { + spriteWidthPixels = _json['spriteWidthPixels'] as core.int; + } + if (_json.containsKey('startTimeOffset')) { + startTimeOffset = _json['startTimeOffset'] as core.String; + } + if (_json.containsKey('totalCount')) { + totalCount = _json['totalCount'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (columnCount != null) { + _json['columnCount'] = columnCount; + } + if (endTimeOffset != null) { + _json['endTimeOffset'] = endTimeOffset; + } + if (filePrefix != null) { + _json['filePrefix'] = filePrefix; + } + if (format != null) { + _json['format'] = format; + } + if (interval != null) { + _json['interval'] = interval; + } + if (rowCount != null) { + _json['rowCount'] = rowCount; + } + if (spriteHeightPixels != null) { + _json['spriteHeightPixels'] = spriteHeightPixels; + } + if (spriteWidthPixels != null) { + _json['spriteWidthPixels'] = spriteWidthPixels; + } + if (startTimeOffset != null) { + _json['startTimeOffset'] = startTimeOffset; + } + if (totalCount != null) { + _json['totalCount'] = totalCount; + } + return _json; + } +} + +/// The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. +class TextAtom { + /// List of `Job.inputs` that should be embedded in this atom. + /// + /// Only one input is supported. + core.List<TextInput> inputs; + + /// The `EditAtom.key` that references atom with text inputs in the + /// `Job.edit_list`. + /// + /// Required. + core.String key; + + TextAtom(); + + TextAtom.fromJson(core.Map _json) { + if (_json.containsKey('inputs')) { + inputs = (_json['inputs'] as core.List) + .map<TextInput>((value) => + TextInput.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (inputs != null) { + _json['inputs'] = inputs.map((value) => value.toJson()).toList(); + } + if (key != null) { + _json['key'] = key; + } + return _json; + } +} + +/// Identifies which input file and track should be used. +class TextInput { + /// The `Input.key` that identifies the input file. + /// + /// Required. + core.String key; + + /// The zero-based index of the track in the input file. + /// + /// Required. + core.int track; + + TextInput(); + + TextInput.fromJson(core.Map _json) { + if (_json.containsKey('key')) { + key = _json['key'] as core.String; + } + if (_json.containsKey('track')) { + track = _json['track'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (key != null) { + _json['key'] = key; + } + if (track != null) { + _json['track'] = track; + } + return _json; + } +} + +/// Encoding of a text stream. +/// +/// For example, closed captions or subtitles. +class TextStream { + /// The codec for this text stream. + /// + /// The default is `"webvtt"`. Supported text codecs: - 'srt' - 'ttml' - + /// 'cea608' - 'cea708' - 'webvtt' + core.String codec; + + /// The BCP-47 language code, such as `"en-US"` or `"sr-Latn"`. + /// + /// For more information, see + /// https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + /// + /// Required. + core.String languageCode; + + /// The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. + core.List<TextAtom> mapping; + + TextStream(); + + TextStream.fromJson(core.Map _json) { + if (_json.containsKey('codec')) { + codec = _json['codec'] as core.String; + } + if (_json.containsKey('languageCode')) { + languageCode = _json['languageCode'] as core.String; + } + if (_json.containsKey('mapping')) { + mapping = (_json['mapping'] as core.List) + .map<TextAtom>((value) => + TextAtom.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (codec != null) { + _json['codec'] = codec; + } + if (languageCode != null) { + _json['languageCode'] = languageCode; + } + if (mapping != null) { + _json['mapping'] = mapping.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Video stream resource. +class VideoStream { + /// Specifies whether an open Group of Pictures (GOP) structure should be + /// allowed or not. + /// + /// The default is `false`. + core.bool allowOpenGop; + + /// Specify the intensity of the adaptive quantizer (AQ). + /// + /// Must be between 0 and 1, where 0 disables the quantizer and 1 maximizes + /// the quantizer. A higher value equals a lower bitrate but smoother image. + /// The default is 0. + core.double aqStrength; + + /// The number of consecutive B-frames. + /// + /// Must be greater than or equal to zero. Must be less than + /// `VideoStream.gop_frame_count` if set. The default is 0. + core.int bFrameCount; + + /// Allow B-pyramid for reference frame selection. + /// + /// This may not be supported on all decoders. The default is `false`. + core.bool bPyramid; + + /// The video bitrate in bits per second. + /// + /// Must be between 1 and 1,000,000,000. + /// + /// Required. + core.int bitrateBps; + + /// Codec type. + /// + /// The following codecs are supported: * `h264` (default) * `h265` * `vp9` + core.String codec; + + /// Target CRF level. + /// + /// Must be between 10 and 36, where 10 is the highest quality and 36 is the + /// most efficient compression. The default is 21. + core.int crfLevel; + + /// Use two-pass encoding strategy to achieve better video quality. + /// + /// `VideoStream.rate_control_mode` must be `"vbr"`. The default is `false`. + core.bool enableTwoPass; + + /// The entropy coder to use. + /// + /// The default is `"cabac"`. Supported entropy coders: - 'cavlc' - 'cabac' + core.String entropyCoder; + + /// The target video frame rate in frames per second (FPS). + /// + /// Must be less than or equal to 120. Will default to the input frame rate if + /// larger than the input frame rate. The API will generate an output FPS that + /// is divisible by the input FPS, and smaller or equal to the target FPS. The + /// following table shows the computed video FPS given the target FPS (in + /// parenthesis) and input FPS (in the first column): ``` | | (30) | (60) | + /// (25) | (50) | |--------|--------|--------|------|------| | 240 | Fail | + /// Fail | Fail | Fail | | 120 | 30 | 60 | 20 | 30 | | 100 | 25 | 50 | 20 | 30 + /// | | 50 | 25 | 50 | 20 | 30 | | 60 | 30 | 60 | 20 | 30 | | 59.94 | 29.97 | + /// 59.94 | 20 | 30 | | 48 | 24 | 48 | 20 | 30 | | 30 | 30 | 30 | 20 | 30 | | + /// 25 | 25 | 25 | 20 | 30 | | 24 | 24 | 24 | 20 | 30 | | 23.976 | 23.976 | + /// 23.976 | 20 | 30 | | 15 | 15 | 15 | 20 | 30 | | 12 | 12 | 12 | 20 | 30 | | + /// 10 | 10 | 10 | 20 | 30 | ``` + /// + /// Required. + core.double frameRate; + + /// Select the GOP size based on the specified duration. + /// + /// The default is `"3s"`. Note that `gopDuration` must be less than or equal + /// to \[`segmentDuration`\](#SegmentSettings), and + /// \[`segmentDuration`\](#SegmentSettings) must be divisible by + /// `gopDuration`. + core.String gopDuration; + + /// Select the GOP size based on the specified frame count. + /// + /// Must be greater than zero. + core.int gopFrameCount; + + /// The height of the video in pixels. + /// + /// Must be an even integer. When not specified, the height is adjusted to + /// match the specified width and input aspect ratio. If both are omitted, the + /// input height is used. + core.int heightPixels; + + /// Pixel format to use. + /// + /// The default is `"yuv420p"`. Supported pixel formats: - 'yuv420p' pixel + /// format. - 'yuv422p' pixel format. - 'yuv444p' pixel format. - 'yuv420p10' + /// 10-bit HDR pixel format. - 'yuv422p10' 10-bit HDR pixel format. - + /// 'yuv444p10' 10-bit HDR pixel format. - 'yuv420p12' 12-bit HDR pixel + /// format. - 'yuv422p12' 12-bit HDR pixel format. - 'yuv444p12' 12-bit HDR + /// pixel format. + core.String pixelFormat; + + /// Enforces the specified codec preset. + /// + /// The default is `veryfast`. The available options are FFmpeg-compatible. + /// Note that certain values for this field may cause the transcoder to + /// override other fields you set in the `VideoStream` message. + core.String preset; + + /// Enforces the specified codec profile. + /// + /// The following profiles are supported: * `baseline` * `main` * `high` + /// (default) The available options are FFmpeg-compatible. Note that certain + /// values for this field may cause the transcoder to override other fields + /// you set in the `VideoStream` message. + core.String profile; + + /// Specify the `rate_control_mode`. + /// + /// The default is `"vbr"`. Supported rate control modes: - 'vbr' - variable + /// bitrate - 'crf' - constant rate factor + core.String rateControlMode; + + /// Enforces the specified codec tune. + /// + /// The available options are FFmpeg-compatible. Note that certain values for + /// this field may cause the transcoder to override other fields you set in + /// the `VideoStream` message. + core.String tune; + + /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + /// + /// Must be greater than zero. The default is equal to 90% of + /// `VideoStream.vbv_size_bits`. + core.int vbvFullnessBits; + + /// Size of the Video Buffering Verifier (VBV) buffer in bits. + /// + /// Must be greater than zero. The default is equal to + /// `VideoStream.bitrate_bps`. + core.int vbvSizeBits; + + /// The width of the video in pixels. + /// + /// Must be an even integer. When not specified, the width is adjusted to + /// match the specified height and input aspect ratio. If both are omitted, + /// the input width is used. + core.int widthPixels; + + VideoStream(); + + VideoStream.fromJson(core.Map _json) { + if (_json.containsKey('allowOpenGop')) { + allowOpenGop = _json['allowOpenGop'] as core.bool; + } + if (_json.containsKey('aqStrength')) { + aqStrength = (_json['aqStrength'] as core.num).toDouble(); + } + if (_json.containsKey('bFrameCount')) { + bFrameCount = _json['bFrameCount'] as core.int; + } + if (_json.containsKey('bPyramid')) { + bPyramid = _json['bPyramid'] as core.bool; + } + if (_json.containsKey('bitrateBps')) { + bitrateBps = _json['bitrateBps'] as core.int; + } + if (_json.containsKey('codec')) { + codec = _json['codec'] as core.String; + } + if (_json.containsKey('crfLevel')) { + crfLevel = _json['crfLevel'] as core.int; + } + if (_json.containsKey('enableTwoPass')) { + enableTwoPass = _json['enableTwoPass'] as core.bool; + } + if (_json.containsKey('entropyCoder')) { + entropyCoder = _json['entropyCoder'] as core.String; + } + if (_json.containsKey('frameRate')) { + frameRate = (_json['frameRate'] as core.num).toDouble(); + } + if (_json.containsKey('gopDuration')) { + gopDuration = _json['gopDuration'] as core.String; + } + if (_json.containsKey('gopFrameCount')) { + gopFrameCount = _json['gopFrameCount'] as core.int; + } + if (_json.containsKey('heightPixels')) { + heightPixels = _json['heightPixels'] as core.int; + } + if (_json.containsKey('pixelFormat')) { + pixelFormat = _json['pixelFormat'] as core.String; + } + if (_json.containsKey('preset')) { + preset = _json['preset'] as core.String; + } + if (_json.containsKey('profile')) { + profile = _json['profile'] as core.String; + } + if (_json.containsKey('rateControlMode')) { + rateControlMode = _json['rateControlMode'] as core.String; + } + if (_json.containsKey('tune')) { + tune = _json['tune'] as core.String; + } + if (_json.containsKey('vbvFullnessBits')) { + vbvFullnessBits = _json['vbvFullnessBits'] as core.int; + } + if (_json.containsKey('vbvSizeBits')) { + vbvSizeBits = _json['vbvSizeBits'] as core.int; + } + if (_json.containsKey('widthPixels')) { + widthPixels = _json['widthPixels'] as core.int; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (allowOpenGop != null) { + _json['allowOpenGop'] = allowOpenGop; + } + if (aqStrength != null) { + _json['aqStrength'] = aqStrength; + } + if (bFrameCount != null) { + _json['bFrameCount'] = bFrameCount; + } + if (bPyramid != null) { + _json['bPyramid'] = bPyramid; + } + if (bitrateBps != null) { + _json['bitrateBps'] = bitrateBps; + } + if (codec != null) { + _json['codec'] = codec; + } + if (crfLevel != null) { + _json['crfLevel'] = crfLevel; + } + if (enableTwoPass != null) { + _json['enableTwoPass'] = enableTwoPass; + } + if (entropyCoder != null) { + _json['entropyCoder'] = entropyCoder; + } + if (frameRate != null) { + _json['frameRate'] = frameRate; + } + if (gopDuration != null) { + _json['gopDuration'] = gopDuration; + } + if (gopFrameCount != null) { + _json['gopFrameCount'] = gopFrameCount; + } + if (heightPixels != null) { + _json['heightPixels'] = heightPixels; + } + if (pixelFormat != null) { + _json['pixelFormat'] = pixelFormat; + } + if (preset != null) { + _json['preset'] = preset; + } + if (profile != null) { + _json['profile'] = profile; + } + if (rateControlMode != null) { + _json['rateControlMode'] = rateControlMode; + } + if (tune != null) { + _json['tune'] = tune; + } + if (vbvFullnessBits != null) { + _json['vbvFullnessBits'] = vbvFullnessBits; + } + if (vbvSizeBits != null) { + _json['vbvSizeBits'] = vbvSizeBits; + } + if (widthPixels != null) { + _json['widthPixels'] = widthPixels; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/workflowexecutions/v1beta.dart b/generated/googleapis_beta/lib/workflowexecutions/v1beta.dart new file mode 100644 index 0000000..ec98b37 --- /dev/null +++ b/generated/googleapis_beta/lib/workflowexecutions/v1beta.dart
@@ -0,0 +1,662 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Workflow Executions API - v1beta +/// +/// Execute workflows created with Workflows API. +/// +/// For more information, see <https://cloud.google.com/workflows> +/// +/// Create an instance of [WorkflowExecutionsApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsWorkflowsResource] +/// - [ProjectsLocationsWorkflowsExecutionsResource] +library workflowexecutions.v1beta; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Execute workflows created with Workflows API. +class WorkflowExecutionsApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + WorkflowExecutionsApi(http.Client client, + {core.String rootUrl = 'https://workflowexecutions.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsWorkflowsResource get workflows => + ProjectsLocationsWorkflowsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsWorkflowsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsWorkflowsExecutionsResource get executions => + ProjectsLocationsWorkflowsExecutionsResource(_requester); + + ProjectsLocationsWorkflowsResource(commons.ApiRequester client) + : _requester = client; +} + +class ProjectsLocationsWorkflowsExecutionsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsWorkflowsExecutionsResource(commons.ApiRequester client) + : _requester = client; + + /// Cancels an execution of the given name. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the execution to be cancelled. Format: + /// projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+/executions/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Execution]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Execution> cancel( + CancelExecutionRequest request, + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = + 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Execution.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Creates a new execution using the latest revision of the given workflow. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the workflow for which an execution should be + /// created. Format: + /// projects/{project}/locations/{location}/workflows/{workflow} The latest + /// revision of the workflow will be used. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Execution]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Execution> create( + Execution request, + core.String parent, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/executions'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Execution.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns an execution of the given name. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the execution to be retrieved. Format: + /// projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+/executions/\[^/\]+$`. + /// + /// [view] - Optional. A view defining which fields should be filled in the + /// returned execution. The API will default to the FULL view. + /// Possible string values are: + /// - "EXECUTION_VIEW_UNSPECIFIED" : The default / unset value. + /// - "BASIC" : Includes only basic metadata about the execution. Following + /// fields are returned: name, start_time, end_time, state and + /// workflow_revision_id. + /// - "FULL" : Includes all data. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Execution]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Execution> get( + core.String name, { + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Execution.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Returns a list of executions which belong to the workflow with the given + /// name. + /// + /// The method returns executions of all workflow revisions. Returned + /// executions are ordered by their start time (newest first). + /// + /// Request parameters: + /// + /// [parent] - Required. Name of the workflow for which the executions should + /// be listed. Format: + /// projects/{project}/locations/{location}/workflows/{workflow} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$`. + /// + /// [pageSize] - Maximum number of executions to return per call. Max + /// supported value depends on the selected Execution view: it's 10000 for + /// BASIC and 100 for FULL. The default value used if the field is not + /// specified is 100, regardless of the selected view. Values greater than the + /// max value will be coerced down to it. + /// + /// [pageToken] - A page token, received from a previous `ListExecutions` + /// call. Provide this to retrieve the subsequent page. When paginating, all + /// other parameters provided to `ListExecutions` must match the call that + /// provided the page token. + /// + /// [view] - Optional. A view defining which fields should be filled in the + /// returned executions. The API will default to the BASIC view. + /// Possible string values are: + /// - "EXECUTION_VIEW_UNSPECIFIED" : The default / unset value. + /// - "BASIC" : Includes only basic metadata about the execution. Following + /// fields are returned: name, start_time, end_time, state and + /// workflow_revision_id. + /// - "FULL" : Includes all data. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListExecutionsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListExecutionsResponse> list( + core.String parent, { + core.int pageSize, + core.String pageToken, + core.String view, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if (view != null) { + _queryParams['view'] = [view]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/executions'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListExecutionsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// Request for the CancelExecution method. +class CancelExecutionRequest { + CancelExecutionRequest(); + + CancelExecutionRequest.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// Error describes why the execution was abnormally terminated. +class Error { + /// Human readable stack trace string. + core.String context; + + /// Error message and data returned represented as a JSON string. + core.String payload; + + /// Stack trace with detailed information of where error was generated. + StackTrace stackTrace; + + Error(); + + Error.fromJson(core.Map _json) { + if (_json.containsKey('context')) { + context = _json['context'] as core.String; + } + if (_json.containsKey('payload')) { + payload = _json['payload'] as core.String; + } + if (_json.containsKey('stackTrace')) { + stackTrace = StackTrace.fromJson( + _json['stackTrace'] as core.Map<core.String, core.dynamic>); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (context != null) { + _json['context'] = context; + } + if (payload != null) { + _json['payload'] = payload; + } + if (stackTrace != null) { + _json['stackTrace'] = stackTrace.toJson(); + } + return _json; + } +} + +/// A running instance of a +/// \[Workflow\](/workflows/docs/reference/rest/v1beta/projects.locations.workflows). +class Execution { + /// Input parameters of the execution represented as a JSON string. + /// + /// The size limit is 32KB. *Note*: If you are using the REST API directly to + /// run your workflow, you must escape any JSON string value of `argument`. + /// Example: + /// `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + core.String argument; + + /// Marks the end of execution, successful or not. + /// + /// Output only. + core.String endTime; + + /// The error which caused the execution to finish prematurely. + /// + /// The value is only present if the execution's state is `FAILED` or + /// `CANCELLED`. + /// + /// Output only. + Error error; + + /// The resource name of the execution. + /// + /// Format: + /// projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + /// + /// Output only. + core.String name; + + /// Output of the execution represented as a JSON string. + /// + /// The value can only be present if the execution's state is `SUCCEEDED`. + /// + /// Output only. + core.String result; + + /// Marks the beginning of execution. + /// + /// Output only. + core.String startTime; + + /// Current state of the execution. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Invalid state. + /// - "ACTIVE" : The execution is in progress. + /// - "SUCCEEDED" : The execution finished successfully. + /// - "FAILED" : The execution failed with an error. + /// - "CANCELLED" : The execution was stopped intentionally. + core.String state; + + /// Revision of the workflow this execution is using. + /// + /// Output only. + core.String workflowRevisionId; + + Execution(); + + Execution.fromJson(core.Map _json) { + if (_json.containsKey('argument')) { + argument = _json['argument'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('error')) { + error = + Error.fromJson(_json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('result')) { + result = _json['result'] as core.String; + } + if (_json.containsKey('startTime')) { + startTime = _json['startTime'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('workflowRevisionId')) { + workflowRevisionId = _json['workflowRevisionId'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (argument != null) { + _json['argument'] = argument; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (name != null) { + _json['name'] = name; + } + if (result != null) { + _json['result'] = result; + } + if (startTime != null) { + _json['startTime'] = startTime; + } + if (state != null) { + _json['state'] = state; + } + if (workflowRevisionId != null) { + _json['workflowRevisionId'] = workflowRevisionId; + } + return _json; + } +} + +/// Response for the ListExecutions method. +class ListExecutionsResponse { + /// The executions which match the request. + core.List<Execution> executions; + + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + ListExecutionsResponse(); + + ListExecutionsResponse.fromJson(core.Map _json) { + if (_json.containsKey('executions')) { + executions = (_json['executions'] as core.List) + .map<Execution>((value) => + Execution.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (executions != null) { + _json['executions'] = executions.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// A collection of stack elements (frames) where an error occurred. +class StackTrace { + /// An array of Stack elements. + core.List<StackTraceElement> elements; + + StackTrace(); + + StackTrace.fromJson(core.Map _json) { + if (_json.containsKey('elements')) { + elements = (_json['elements'] as core.List) + .map<StackTraceElement>((value) => StackTraceElement.fromJson( + value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (elements != null) { + _json['elements'] = elements.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A single stack element (frame) where an error occurred. +class StackTraceElement { + /// The source code column position (of the line) the current instruction was + /// generated from. + core.String column; + + /// The source code line number the current instruction was generated from. + core.String line; + + /// The routine where the error occurred. + core.String routine; + + /// The step the error occurred at. + core.String step; + + StackTraceElement(); + + StackTraceElement.fromJson(core.Map _json) { + if (_json.containsKey('column')) { + column = _json['column'] as core.String; + } + if (_json.containsKey('line')) { + line = _json['line'] as core.String; + } + if (_json.containsKey('routine')) { + routine = _json['routine'] as core.String; + } + if (_json.containsKey('step')) { + step = _json['step'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (column != null) { + _json['column'] = column; + } + if (line != null) { + _json['line'] = line; + } + if (routine != null) { + _json['routine'] = routine; + } + if (step != null) { + _json['step'] = step; + } + return _json; + } +}
diff --git a/generated/googleapis_beta/lib/workflows/v1beta.dart b/generated/googleapis_beta/lib/workflows/v1beta.dart new file mode 100644 index 0000000..97a55c2 --- /dev/null +++ b/generated/googleapis_beta/lib/workflows/v1beta.dart
@@ -0,0 +1,1338 @@ +// This is a generated file (see the discoveryapis_generator project). + +// ignore_for_file: camel_case_types +// ignore_for_file: comment_references +// ignore_for_file: file_names +// ignore_for_file: library_names +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: prefer_final_locals +// ignore_for_file: prefer_interpolation_to_compose_strings +// ignore_for_file: unnecessary_brace_in_string_interps +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_lambdas +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unnecessary_string_interpolations + +/// Workflows API - v1beta +/// +/// Orchestrate Workflows consisting of Google Cloud APIs, SaaS APIs or private +/// API endpoints. +/// +/// For more information, see <https://cloud.google.com/workflows> +/// +/// Create an instance of [WorkflowsApi] to access these resources: +/// +/// - [ProjectsResource] +/// - [ProjectsLocationsResource] +/// - [ProjectsLocationsOperationsResource] +/// - [ProjectsLocationsWorkflowsResource] +library workflows.v1beta; + +import 'dart:async' as async; +import 'dart:convert' as convert; +import 'dart:core' as core; + +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; +import 'package:http/http.dart' as http; + +import '../src/user_agent.dart'; + +export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' + show ApiRequestError, DetailedApiRequestError; + +/// Orchestrate Workflows consisting of Google Cloud APIs, SaaS APIs or private +/// API endpoints. +class WorkflowsApi { + /// View and manage your data across Google Cloud Platform services + static const cloudPlatformScope = + 'https://www.googleapis.com/auth/cloud-platform'; + + final commons.ApiRequester _requester; + + ProjectsResource get projects => ProjectsResource(_requester); + + WorkflowsApi(http.Client client, + {core.String rootUrl = 'https://workflows.googleapis.com/', + core.String servicePath = ''}) + : _requester = + commons.ApiRequester(client, rootUrl, servicePath, userAgent); +} + +class ProjectsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsResource get locations => + ProjectsLocationsResource(_requester); + + ProjectsResource(commons.ApiRequester client) : _requester = client; +} + +class ProjectsLocationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource get operations => + ProjectsLocationsOperationsResource(_requester); + ProjectsLocationsWorkflowsResource get workflows => + ProjectsLocationsWorkflowsResource(_requester); + + ProjectsLocationsResource(commons.ApiRequester client) : _requester = client; + + /// Gets information about a location. + /// + /// Request parameters: + /// + /// [name] - Resource name for the location. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Location]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Location> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Location.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists information about the supported locations for this service. + /// + /// Request parameters: + /// + /// [name] - The resource that owns the locations collection, if applicable. + /// Value must have pattern `^projects/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListLocationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListLocationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/locations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListLocationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsOperationsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsOperationsResource(commons.ApiRequester client) + : _requester = client; + + /// Deletes a long-running operation. + /// + /// This method indicates that the client is no longer interested in the + /// operation result. It does not cancel the operation. If the server doesn't + /// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource to be deleted. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Empty]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Empty> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Empty.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets the latest state of a long-running operation. + /// + /// Clients can use this method to poll the operation result at intervals as + /// recommended by the API service. + /// + /// Request parameters: + /// + /// [name] - The name of the operation resource. + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists operations that match the specified filter in the request. + /// + /// If the server doesn't support this method, it returns `UNIMPLEMENTED`. + /// NOTE: the `name` binding allows API services to override the binding to + /// use different resource name schemes, such as `users / * /operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users / * }/operations"` to their service configuration. For + /// backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding is + /// the parent resource, without the operations collection id. + /// + /// Request parameters: + /// + /// [name] - The name of the operation's parent resource. + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - The standard list filter. + /// + /// [pageSize] - The standard list page size. + /// + /// [pageToken] - The standard list page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListOperationsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListOperationsResponse> list( + core.String name, { + core.String filter, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$name') + + '/operations'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListOperationsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } +} + +class ProjectsLocationsWorkflowsResource { + final commons.ApiRequester _requester; + + ProjectsLocationsWorkflowsResource(commons.ApiRequester client) + : _requester = client; + + /// Creates a new workflow. + /// + /// If a workflow with the specified name already exists in the specified + /// project and location, the long running operation will return + /// ALREADY_EXISTS error. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [parent] - Required. Project and location in which the workflow should be + /// created. Format: projects/{project}/locations/{location} + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [workflowId] - Required. The ID of the workflow to be created. It has to + /// fulfill the following requirements: * Must contain only letters, numbers, + /// underscores and hyphens. * Must start with a letter. * Must be between + /// 1-64 characters. * Must end with a number or a letter. * Must be unique + /// within the customer project and location. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> create( + Workflow request, + core.String parent, { + core.String workflowId, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (workflowId != null) { + _queryParams['workflowId'] = [workflowId]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/workflows'; + + final _response = _requester.request( + _url, + 'POST', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Deletes a workflow with the specified name. + /// + /// This method also cancels and deletes all running executions of the + /// workflow. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the workflow to be deleted. Format: + /// projects/{project}/locations/{location}/workflows/{workflow} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> delete( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'DELETE', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Gets details of a single Workflow. + /// + /// Request parameters: + /// + /// [name] - Required. Name of the workflow which information should be + /// retrieved. Format: + /// projects/{project}/locations/{location}/workflows/{workflow} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$`. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Workflow]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Workflow> get( + core.String name, { + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Workflow.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } + + /// Lists Workflows in a given project and location. + /// + /// The default order is not specified. + /// + /// Request parameters: + /// + /// [parent] - Required. Project and location from which the workflows should + /// be listed. Format: projects/{project}/locations/{location} + /// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`. + /// + /// [filter] - Filter to restrict results to specific workflows. + /// + /// [orderBy] - Comma-separated list of fields that that specify the order of + /// the results. Default sorting order for a field is ascending. To specify + /// descending order for a field, append a " desc" suffix. If not specified, + /// the results will be returned in an unspecified order. + /// + /// [pageSize] - Maximum number of workflows to return per call. The service + /// may return fewer than this value. If the value is not specified, a default + /// value of 500 will be used. The maximum permitted value is 1000 and values + /// greater than 1000 will be coerced down to 1000. + /// + /// [pageToken] - A page token, received from a previous `ListWorkflows` call. + /// Provide this to retrieve the subsequent page. When paginating, all other + /// parameters provided to `ListWorkflows` must match the call that provided + /// the page token. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [ListWorkflowsResponse]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<ListWorkflowsResponse> list( + core.String parent, { + core.String filter, + core.String orderBy, + core.int pageSize, + core.String pageToken, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (parent == null) { + throw core.ArgumentError('Parameter parent is required.'); + } + if (filter != null) { + _queryParams['filter'] = [filter]; + } + if (orderBy != null) { + _queryParams['orderBy'] = [orderBy]; + } + if (pageSize != null) { + _queryParams['pageSize'] = ['${pageSize}']; + } + if (pageToken != null) { + _queryParams['pageToken'] = [pageToken]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + + commons.Escaper.ecapeVariableReserved('$parent') + + '/workflows'; + + final _response = _requester.request( + _url, + 'GET', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => ListWorkflowsResponse.fromJson( + data as core.Map<core.String, core.dynamic>), + ); + } + + /// Updates an existing workflow. + /// + /// Running this method has no impact on already running executions of the + /// workflow. A new revision of the workflow may be created as a result of a + /// successful update operation. In that case, such revision will be used in + /// new workflow executions. + /// + /// [request] - The metadata request object. + /// + /// Request parameters: + /// + /// [name] - The resource name of the workflow. Format: + /// projects/{project}/locations/{location}/workflows/{workflow} + /// Value must have pattern + /// `^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$`. + /// + /// [updateMask] - List of fields to be updated. If not present, the entire + /// workflow will be updated. + /// + /// [$fields] - Selector specifying which fields to include in a partial + /// response. + /// + /// Completes with a [Operation]. + /// + /// Completes with a [commons.ApiRequestError] if the API endpoint returned an + /// error. + /// + /// If the used [http.Client] completes with an error when making a REST call, + /// this method will complete with the same error. + async.Future<Operation> patch( + Workflow request, + core.String name, { + core.String updateMask, + core.String $fields, + }) { + core.String _url; + final _queryParams = <core.String, core.List<core.String>>{}; + commons.Media _uploadMedia; + commons.UploadOptions _uploadOptions; + var _downloadOptions = commons.DownloadOptions.Metadata; + core.String _body; + + if (request != null) { + _body = convert.json.encode(request.toJson()); + } + if (name == null) { + throw core.ArgumentError('Parameter name is required.'); + } + if (updateMask != null) { + _queryParams['updateMask'] = [updateMask]; + } + if ($fields != null) { + _queryParams['fields'] = [$fields]; + } + + _url = 'v1beta/' + commons.Escaper.ecapeVariableReserved('$name'); + + final _response = _requester.request( + _url, + 'PATCH', + body: _body, + queryParams: _queryParams, + uploadOptions: _uploadOptions, + uploadMedia: _uploadMedia, + downloadOptions: _downloadOptions, + ); + return _response.then( + (data) => Operation.fromJson(data as core.Map<core.String, core.dynamic>), + ); + } +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. +/// +/// A typical example is to use it as the request or the response type of an API +/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns +/// (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON +/// object `{}`. +class Empty { + Empty(); + + Empty.fromJson( + // ignore: avoid_unused_constructor_parameters + core.Map _json); + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + return _json; + } +} + +/// The response message for Locations.ListLocations. +class ListLocationsResponse { + /// A list of locations that matches the specified filter in the request. + core.List<Location> locations; + + /// The standard List next-page token. + core.String nextPageToken; + + ListLocationsResponse(); + + ListLocationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('locations')) { + locations = (_json['locations'] as core.List) + .map<Location>((value) => + Location.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (locations != null) { + _json['locations'] = locations.map((value) => value.toJson()).toList(); + } + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + return _json; + } +} + +/// The response message for Operations.ListOperations. +class ListOperationsResponse { + /// The standard List next-page token. + core.String nextPageToken; + + /// A list of operations that matches the specified filter in the request. + core.List<Operation> operations; + + ListOperationsResponse(); + + ListOperationsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('operations')) { + operations = (_json['operations'] as core.List) + .map<Operation>((value) => + Operation.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (operations != null) { + _json['operations'] = operations.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// Response for the ListWorkflows method. +class ListWorkflowsResponse { + /// A token, which can be sent as `page_token` to retrieve the next page. + /// + /// If this field is omitted, there are no subsequent pages. + core.String nextPageToken; + + /// Unreachable resources. + core.List<core.String> unreachable; + + /// The workflows which match the request. + core.List<Workflow> workflows; + + ListWorkflowsResponse(); + + ListWorkflowsResponse.fromJson(core.Map _json) { + if (_json.containsKey('nextPageToken')) { + nextPageToken = _json['nextPageToken'] as core.String; + } + if (_json.containsKey('unreachable')) { + unreachable = (_json['unreachable'] as core.List) + .map<core.String>((value) => value as core.String) + .toList(); + } + if (_json.containsKey('workflows')) { + workflows = (_json['workflows'] as core.List) + .map<Workflow>((value) => + Workflow.fromJson(value as core.Map<core.String, core.dynamic>)) + .toList(); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (nextPageToken != null) { + _json['nextPageToken'] = nextPageToken; + } + if (unreachable != null) { + _json['unreachable'] = unreachable; + } + if (workflows != null) { + _json['workflows'] = workflows.map((value) => value.toJson()).toList(); + } + return _json; + } +} + +/// A resource that represents Google Cloud Platform location. +class Location { + /// The friendly name for this location, typically a nearby city name. + /// + /// For example, "Tokyo". + core.String displayName; + + /// Cross-service attributes for the location. + /// + /// For example {"cloud.googleapis.com/region": "us-east1"} + core.Map<core.String, core.String> labels; + + /// The canonical id for this location. + /// + /// For example: `"us-east1"`. + core.String locationId; + + /// Service-specific metadata. + /// + /// For example the available capacity at the given location. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// Resource name for the location, which may vary between implementations. + /// + /// For example: `"projects/example-project/locations/us-east1"` + core.String name; + + Location(); + + Location.fromJson(core.Map _json) { + if (_json.containsKey('displayName')) { + displayName = _json['displayName'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('locationId')) { + locationId = _json['locationId'] as core.String; + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (displayName != null) { + _json['displayName'] = displayName; + } + if (labels != null) { + _json['labels'] = labels; + } + if (locationId != null) { + _json['locationId'] = locationId; + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + return _json; + } +} + +/// This resource represents a long-running operation that is the result of a +/// network API call. +class Operation { + /// If the value is `false`, it means the operation is still in progress. + /// + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + core.bool done; + + /// The error result of the operation in case of failure or cancellation. + Status error; + + /// Service-specific metadata associated with the operation. + /// + /// It typically contains progress information and common metadata such as + /// create time. Some services might not provide such metadata. Any method + /// that returns a long-running operation should document the metadata type, + /// if any. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> metadata; + + /// The server-assigned name, which is only unique within the same service + /// that originally returns it. + /// + /// If you use the default HTTP mapping, the `name` should be a resource name + /// ending with `operations/{unique_id}`. + core.String name; + + /// The normal response of the operation in case of success. + /// + /// If the original method returns no data on success, such as `Delete`, the + /// response is `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` is + /// the original method name. For example, if the original method name is + /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.Map<core.String, core.Object> response; + + Operation(); + + Operation.fromJson(core.Map _json) { + if (_json.containsKey('done')) { + done = _json['done'] as core.bool; + } + if (_json.containsKey('error')) { + error = Status.fromJson( + _json['error'] as core.Map<core.String, core.dynamic>); + } + if (_json.containsKey('metadata')) { + metadata = + (_json['metadata'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('response')) { + response = + (_json['response'] as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + ); + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (done != null) { + _json['done'] = done; + } + if (error != null) { + _json['error'] = error.toJson(); + } + if (metadata != null) { + _json['metadata'] = metadata; + } + if (name != null) { + _json['name'] = name; + } + if (response != null) { + _json['response'] = response; + } + return _json; + } +} + +/// Represents the metadata of the long-running operation. +class OperationMetadata { + /// API version used to start the operation. + core.String apiVersion; + + /// The time the operation was created. + core.String createTime; + + /// The time the operation finished running. + core.String endTime; + + /// Server-defined resource path for the target of the operation. + core.String target; + + /// Name of the verb executed by the operation. + core.String verb; + + OperationMetadata(); + + OperationMetadata.fromJson(core.Map _json) { + if (_json.containsKey('apiVersion')) { + apiVersion = _json['apiVersion'] as core.String; + } + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('endTime')) { + endTime = _json['endTime'] as core.String; + } + if (_json.containsKey('target')) { + target = _json['target'] as core.String; + } + if (_json.containsKey('verb')) { + verb = _json['verb'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (apiVersion != null) { + _json['apiVersion'] = apiVersion; + } + if (createTime != null) { + _json['createTime'] = createTime; + } + if (endTime != null) { + _json['endTime'] = endTime; + } + if (target != null) { + _json['target'] = target; + } + if (verb != null) { + _json['verb'] = verb; + } + return _json; + } +} + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. +/// +/// It is used by [gRPC](https://github.com/grpc). Each `Status` message +/// contains three pieces of data: error code, error message, and error details. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +class Status { + /// The status code, which should be an enum value of google.rpc.Code. + core.int code; + + /// A list of messages that carry the error details. + /// + /// There is a common set of message types for APIs to use. + /// + /// The values for Object must be JSON objects. It can consist of `num`, + /// `String`, `bool` and `null` as well as `Map` and `List` values. + core.List<core.Map<core.String, core.Object>> details; + + /// A developer-facing error message, which should be in English. + /// + /// Any user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + core.String message; + + Status(); + + Status.fromJson(core.Map _json) { + if (_json.containsKey('code')) { + code = _json['code'] as core.int; + } + if (_json.containsKey('details')) { + details = (_json['details'] as core.List) + .map<core.Map<core.String, core.Object>>((value) => + (value as core.Map).cast<core.String, core.Object>().map( + (key, item) => core.MapEntry( + key, + item as core.Object, + ), + )) + .toList(); + } + if (_json.containsKey('message')) { + message = _json['message'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (code != null) { + _json['code'] = code; + } + if (details != null) { + _json['details'] = details; + } + if (message != null) { + _json['message'] = message; + } + return _json; + } +} + +/// Workflow program to be executed by Workflows. +class Workflow { + /// The timestamp of when the workflow was created. + /// + /// Output only. + core.String createTime; + + /// Description of the workflow provided by the user. + /// + /// Must be at most 1000 unicode characters long. + core.String description; + + /// Labels associated with this workflow. + /// + /// Labels can contain at most 64 entries. Keys and values can be no longer + /// than 63 characters and can only contain lowercase letters, numeric + /// characters, underscores and dashes. Label keys must start with a letter. + /// International characters are allowed. + core.Map<core.String, core.String> labels; + + /// The resource name of the workflow. + /// + /// Format: projects/{project}/locations/{location}/workflows/{workflow} + core.String name; + + /// The timestamp that the latest revision of the workflow was created. + /// + /// Output only. + core.String revisionCreateTime; + + /// The revision of the workflow. + /// + /// A new revision of a workflow is created as a result of updating the + /// following properties of a workflow: - Service account - Workflow code to + /// be executed The format is "000001-a4d", where the first 6 characters + /// define the zero-padded revision ordinal number. They are followed by a + /// hyphen and 3 hexadecimal random characters. + /// + /// Output only. + core.String revisionId; + + /// Name of the service account associated with the latest workflow version. + /// + /// This service account represents the identity of the workflow and + /// determines what permissions the workflow has. Format: + /// projects/{project}/serviceAccounts/{account} Using `-` as a wildcard for + /// the `{project}` will infer the project from the account. The `{account}` + /// value can be the `email` address or the `unique_id` of the service + /// account. If not provided, workflow will use the project's default service + /// account. Modifying this field for an existing workflow results in a new + /// workflow revision. + core.String serviceAccount; + + /// Workflow code to be executed. + /// + /// The size limit is 32KB. + core.String sourceContents; + + /// State of the workflow deployment. + /// + /// Output only. + /// Possible string values are: + /// - "STATE_UNSPECIFIED" : Invalid state. + /// - "ACTIVE" : The workflow has been deployed successfully and is serving. + core.String state; + + /// The last update timestamp of the workflow. + /// + /// Output only. + core.String updateTime; + + Workflow(); + + Workflow.fromJson(core.Map _json) { + if (_json.containsKey('createTime')) { + createTime = _json['createTime'] as core.String; + } + if (_json.containsKey('description')) { + description = _json['description'] as core.String; + } + if (_json.containsKey('labels')) { + labels = + (_json['labels'] as core.Map).cast<core.String, core.String>().map( + (key, item) => core.MapEntry( + key, + item as core.String, + ), + ); + } + if (_json.containsKey('name')) { + name = _json['name'] as core.String; + } + if (_json.containsKey('revisionCreateTime')) { + revisionCreateTime = _json['revisionCreateTime'] as core.String; + } + if (_json.containsKey('revisionId')) { + revisionId = _json['revisionId'] as core.String; + } + if (_json.containsKey('serviceAccount')) { + serviceAccount = _json['serviceAccount'] as core.String; + } + if (_json.containsKey('sourceContents')) { + sourceContents = _json['sourceContents'] as core.String; + } + if (_json.containsKey('state')) { + state = _json['state'] as core.String; + } + if (_json.containsKey('updateTime')) { + updateTime = _json['updateTime'] as core.String; + } + } + + core.Map<core.String, core.Object> toJson() { + final _json = <core.String, core.Object>{}; + if (createTime != null) { + _json['createTime'] = createTime; + } + if (description != null) { + _json['description'] = description; + } + if (labels != null) { + _json['labels'] = labels; + } + if (name != null) { + _json['name'] = name; + } + if (revisionCreateTime != null) { + _json['revisionCreateTime'] = revisionCreateTime; + } + if (revisionId != null) { + _json['revisionId'] = revisionId; + } + if (serviceAccount != null) { + _json['serviceAccount'] = serviceAccount; + } + if (sourceContents != null) { + _json['sourceContents'] = sourceContents; + } + if (state != null) { + _json['state'] = state; + } + if (updateTime != null) { + _json['updateTime'] = updateTime; + } + return _json; + } +}