diff --git a/packages/google-ads-datamanager/README.md b/packages/google-ads-datamanager/README.md index a3e07d1f8e6..a1888aea2a6 100644 --- a/packages/google-ads-datamanager/README.md +++ b/packages/google-ads-datamanager/README.md @@ -61,7 +61,25 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | ingest events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/ingestion_service.ingest_events.js) | | remove audience members | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/ingestion_service.remove_audience_members.js) | | retrieve request status | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/ingestion_service.retrieve_request_status.js) | +| retrieve insights | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/marketing_data_insights_service.retrieve_insights.js) | +| create partner link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.create_partner_link.js) | +| delete partner link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.delete_partner_link.js) | +| search partner links | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.search_partner_links.js) | | ads | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/snippet_metadata_google.ads.datamanager.v1.json) | +| create user list direct license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.create_user_list_direct_license.js) | +| get user list direct license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.get_user_list_direct_license.js) | +| list user list direct licenses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.list_user_list_direct_licenses.js) | +| update user list direct license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.update_user_list_direct_license.js) | +| create user list global license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.create_user_list_global_license.js) | +| get user list global license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.get_user_list_global_license.js) | +| list user list global license customer infos | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_license_customer_infos.js) | +| list user list global licenses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_licenses.js) | +| update user list global license | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.update_user_list_global_license.js) | +| create user list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_service.create_user_list.js) | +| delete user list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_service.delete_user_list.js) | +| get user list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_service.get_user_list.js) | +| list user lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_service.list_user_lists.js) | +| update user list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ads-datamanager/samples/generated/v1/user_list_service.update_user_list.js) | ## Supported Node.js Versions diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/age_range.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/age_range.proto new file mode 100644 index 00000000000..d0472fcfc8d --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/age_range.proto @@ -0,0 +1,52 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AgeRangeProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// The demographic age ranges +enum AgeRange { + // Not specified. + AGE_RANGE_UNSPECIFIED = 0; + + // Unknown. + AGE_RANGE_UNKNOWN = 1; + + // Between 18 and 24 years old. + AGE_RANGE_18_24 = 2; + + // Between 25 and 34 years old. + AGE_RANGE_25_34 = 3; + + // Between 35 and 44 years old. + AGE_RANGE_35_44 = 4; + + // Between 45 and 54 years old. + AGE_RANGE_45_54 = 5; + + // Between 55 and 64 years old. + AGE_RANGE_55_64 = 6; + + // 65 years old and beyond. + AGE_RANGE_65_UP = 7; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/audience.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/audience.proto index 8bbda875154..a4a0d368b32 100644 --- a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/audience.proto +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/audience.proto @@ -43,10 +43,21 @@ message AudienceMember { // [Publisher Advertiser Identity Reconciliation (PAIR) // IDs](//support.google.com/admanager/answer/15067908). + // + // This feature is only available to data partners. PairData pair_data = 4; // Data identifying the user's mobile devices. MobileData mobile_data = 5; + + // Data related to unique identifiers for a user, as defined by the + // advertiser. + UserIdData user_id_data = 6; + + // Data related to publisher provided identifiers. + // + // This feature is only available to data partners. + PpidData ppid_data = 7; } // Optional. The consent setting for the user. @@ -55,6 +66,8 @@ message AudienceMember { // [PAIR](//support.google.com/admanager/answer/15067908) IDs for the audience. // At least one PAIR ID is required. +// +// This feature is only available to data partners. message PairData { // Required. Cleanroom-provided PII data, hashed with SHA256, and encrypted // with an EC commutative cipher using publisher key for the @@ -71,3 +84,19 @@ message MobileData { // [AudienceMember][google.ads.datamanager.v1.AudienceMember]. repeated string mobile_ids = 1 [(google.api.field_behavior) = REQUIRED]; } + +// User id data holding the user id. +message UserIdData { + // Required. A unique identifier for a user, as defined by the + // advertiser. + string user_id = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Publisher provided identifiers data holding the ppids. At least one ppid is +// required. +// +// This feature is only available to data partners. +message PpidData { + // Required. The list of publisher provided identifiers for a user. + repeated string ppids = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/destination.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/destination.proto index 5cdb43a689e..40d204e187c 100644 --- a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/destination.proto +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/destination.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.ads.datamanager.v1; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Ads.DataManager.V1"; option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; @@ -25,6 +26,10 @@ option java_outer_classname = "DestinationProto"; option java_package = "com.google.ads.datamanager.v1"; option php_namespace = "Google\\Ads\\DataManager\\V1"; option ruby_package = "Google::Ads::DataManager::V1"; +option (google.api.resource_definition) = { + type: "datamanager.googleapis.com/Account" + pattern: "accountTypes/{account_type}/accounts/{account}" +}; // The Google product you're sending data to. For example, a Google // Ads account. @@ -83,6 +88,9 @@ message ProductAccount { // Google Analytics. GOOGLE_ANALYTICS_PROPERTY = 5; + + // Google Ad Manager audience link. + GOOGLE_AD_MANAGER_AUDIENCE_LINK = 6; } // Deprecated. Use diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/error.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/error.proto index 44c3ed5e79e..8abaf0ad934 100644 --- a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/error.proto +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/error.proto @@ -25,6 +25,7 @@ option php_namespace = "Google\\Ads\\DataManager\\V1"; option ruby_package = "Google::Ads::DataManager::V1"; // Error reasons for Data Manager API. +// NOTE: This enum is not frozen and new values may be added in the future. enum ErrorReason { // Do not use this default value. ERROR_REASON_UNSPECIFIED = 0; @@ -188,4 +189,151 @@ enum ErrorReason { // Too many elements in a list in the request. TOO_MANY_ELEMENTS = 51; + + // The resource already exists. + ALREADY_EXISTS = 52; + + // Attempted to set an immutable field for an update request. + IMMUTABLE_FIELD_FOR_UPDATE = 53; + + // The resource name is invalid. + INVALID_RESOURCE_NAME = 54; + + // The query filter is invalid. + INVALID_FILTER = 55; + + // The update mask is invalid. + INVALID_UPDATE_MASK = 56; + + // The page token is invalid. + INVALID_PAGE_TOKEN = 57; + + // Cannot update a license that has been disabled. + CANNOT_UPDATE_DISABLED_LICENSE = 58; + + // Sensitive user lists cannot be licensed to this client. + CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST = 59; + + // Cost too low for this license. + INSUFFICIENT_COST = 60; + + // Reseller license cannot be disabled since it is in use. + CANNOT_DISABLE_LICENSE = 61; + + // Invalid client account id. + INVALID_CLIENT_ACCOUNT_ID = 62; + + // Non-zero cost not allowed for this client account. + PRICING_ONLY_ZERO_COST_ALLOWED = 63; + + // Cost too high for this license. + PRICE_TOO_HIGH = 64; + + // Customer not allowed to create license. + CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE = 65; + + // Pricing end date is invalid for this license. + INVALID_PRICING_END_DATE = 66; + + // Logical user list with shared or licensed segment cannot be licensed. + CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT = 67; + + // Client customer's account type in the request does not match the customer's + // actual account type. + MISMATCHED_ACCOUNT_TYPE = 68; + + // License type does not support media share cost. + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE = 69; + + // Client customer type does not support media share cost. + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER = 70; + + // Invalid media share cost. + INVALID_MEDIA_SHARE_COST = 71; + + // Invalid cost type. + INVALID_COST_TYPE = 72; + + // UserList type does not support media share cost. + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST = 73; + + // Max cost is only allowed for cost_type MEDIA_SHARE. + MAX_COST_NOT_ALLOWED = 74; + + // Commerce audience can only be directly licensed. + COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED = 75; + + // The description is not valid. + INVALID_DESCRIPTION = 76; + + // The display name is not valid. + INVALID_DISPLAY_NAME = 77; + + // The display name is already being used for another user list for the + // account. + DISPLAY_NAME_ALREADY_USED = 78; + + // Ownership is required to modify the user list. + OWNERSHIP_REQUIRED_FOR_UPDATE = 79; + + // The user list type is read-only and does not support mutation. + USER_LIST_MUTATION_NOT_SUPPORTED = 80; + + // A user list which is privacy sensitive or legal rejected cannot be mutated + // by external users. + SENSITIVE_USER_LIST_IMMUTABLE = 81; + + // The remarketing user list's billable record field cannot be modified once + // it is set. + BILLABLE_RECORD_COUNT_IMMUTABLE = 82; + + // The user list name is reserved for system lists. + USER_LIST_NAME_RESERVED = 83; + + // The advertiser needs to be allowlisted to use remarketing lists created + // from advertiser uploaded data. + ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA = 84; + + // The partner audience source is not supported for the user list type. + UNSUPPORTED_PARTNER_AUDIENCE_SOURCE = 85; + + // Setting the `commerce_partner` field is only supported if the + // `partner_audience_source` is `COMMERCE_AUDIENCE`. + COMMERCE_PARTNER_NOT_ALLOWED = 86; + + // The `partner_audience_info` field is not supported for the user list type. + UNSUPPORTED_PARTNER_AUDIENCE_INFO = 87; + + // Partner Match user lists cannot be created by manager accounts. + PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED = 88; + + // The data partner is not allowlisted for THIRD_PARTY_PARTNER_DATA. + DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA = 89; + + // The advertiser has not accepted the partner's terms of service. + ADVERTISER_TOS_NOT_ACCEPTED = 90; + + // The advertiser is not allowlisted for THIRD_PARTY_PARTNER_DATA. + ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA = 91; + + // This user list type is not supported for this account. + USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT = 92; + + // The `commerce_partner` field is invalid. + INVALID_COMMERCE_PARTNER = 93; + + // The data provider is not allowlisted to create commerce audiences. + CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE = 94; + + // The user list upload key types are not supported. + UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES = 95; + + // The ingested user list info config is not supported. + UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG = 96; + + // The account types are not supported for the user list type. + UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE = 97; + + // The account types are not supported for the partner link. + UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK = 98; } diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/event.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/event.proto index 213af3f461c..0bd6ddd9c3a 100644 --- a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/event.proto +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/event.proto @@ -72,7 +72,7 @@ message Event { // Optional. The conversion value associated with the event, for value-based // conversions. - double conversion_value = 9 [(google.api.field_behavior) = OPTIONAL]; + optional double conversion_value = 9 [(google.api.field_behavior) = OPTIONAL]; // Optional. Signal for where the event happened (web, app, in-store, etc.). EventSource event_source = 10 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/gender.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/gender.proto new file mode 100644 index 00000000000..c4f1f70a2a3 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/gender.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "GenderProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// The type of demographic genders (for example, female). +enum Gender { + // Not specified. + GENDER_UNSPECIFIED = 0; + + // Unknown. + GENDER_UNKNOWN = 1; + + // Male. + GENDER_MALE = 2; + + // Female. + GENDER_FEMALE = 3; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/insights_service.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/insights_service.proto new file mode 100644 index 00000000000..514df3aac4a --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/insights_service.proto @@ -0,0 +1,152 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/age_range.proto"; +import "google/ads/datamanager/v1/gender.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "InsightsServiceProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Service to return insights on marketing data. +// +// This feature is only available to data partners. +service MarketingDataInsightsService { + option (google.api.default_host) = "datamanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/datamanager"; + + // Retrieves marketing data insights for a given user list. + // + // This feature is only available to data partners. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc RetrieveInsights(RetrieveInsightsRequest) + returns (RetrieveInsightsResponse) { + option (google.api.http) = { + post: "/v1/{parent=accountTypes/*/accounts/*}/insights:retrieve" + body: "*" + }; + } +} + +// Request message for DM API MarketingDataInsightsService.RetrieveInsights +message RetrieveInsightsRequest { + // Required. The parent account that owns the user list. + // Format: `accountTypes/{account_type}/accounts/{account}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Baseline for the insights requested. + Baseline baseline = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The user list ID for which insights are requested. + string user_list_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Baseline criteria against which insights are compared. +message Baseline { + // The baseline location of the request. Baseline location is on OR-list of + // ISO 3166-1 alpha-2 region codes of the requested regions. + message Location { + // List of ISO 3166-1 alpha-2 region codes. + repeated string region_codes = 1; + } + + // Baseline location against which insights are compared. + oneof baseline { + // The baseline location of the request. Baseline location is an OR-list + // of the requested regions. + Location baseline_location = 1; + + // If set to true, the service will try to automatically detect the + // baseline location for insights. + bool location_auto_detection_enabled = 2; + } +} + +// Response message for DM API MarketingDataInsightsService.RetrieveInsights +message RetrieveInsightsResponse { + // Insights for marketing data. + // + // This feature is only available to data partners. + message MarketingDataInsight { + // Possible dimensions for use in generating insights. + enum AudienceInsightsDimension { + // Not specified. + AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED = 0; + + // The value is unknown in this version. + AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN = 1; + + // An Affinity UserInterest. + AFFINITY_USER_INTEREST = 2; + + // An In-Market UserInterest. + IN_MARKET_USER_INTEREST = 3; + + // An age range. + AGE_RANGE = 4; + + // A gender. + GENDER = 5; + } + + // Insights for a collection of related attributes of the same dimension. + message MarketingDataInsightsAttribute { + // The user interest ID. + optional int64 user_interest_id = 1; + + // Measure of lift that the audience has for the attribute value as + // compared to the baseline. Range [0-1]. + optional float lift = 2; + + // Age range of the audience for which the lift is provided. + optional AgeRange age_range = 3; + + // Gender of the audience for which the lift is provided. + optional Gender gender = 4; + } + + // The dimension to which the insight belongs. + AudienceInsightsDimension dimension = 1; + + // Insights for values of a given dimension. + repeated MarketingDataInsightsAttribute attributes = 2; + } + + // Contains the insights for the marketing data. + repeated MarketingDataInsight marketing_data_insights = 1; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/partner_link_service.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/partner_link_service.proto new file mode 100644 index 00000000000..79a591b776c --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/partner_link_service.proto @@ -0,0 +1,224 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/destination.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "PartnerLinkServiceProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Service for managing partner links. +service PartnerLinkService { + option (google.api.default_host) = "datamanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/datamanager"; + + // Creates a partner link for the given account. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc CreatePartnerLink(CreatePartnerLinkRequest) returns (PartnerLink) { + option (google.api.http) = { + post: "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks" + body: "partner_link" + }; + option (google.api.method_signature) = "parent,partner_link"; + } + + // Deletes a partner link for the given account. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc DeletePartnerLink(DeletePartnerLinkRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accountTypes/*/accounts/*/partnerLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Searches for all partner links to and from a given account. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc SearchPartnerLinks(SearchPartnerLinksRequest) + returns (SearchPartnerLinksResponse) { + option (google.api.http) = { + get: "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks:search" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request to create a [PartnerLink][google.ads.datamanager.v1.PartnerLink] +// resource. Returns a +// [PartnerLink][google.ads.datamanager.v1.PartnerLink]. +message CreatePartnerLinkRequest { + // Required. The parent, which owns this collection of partner links. + // Format: accountTypes/{account_type}/accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/PartnerLink" + } + ]; + + // Required. The partner link to create. + PartnerLink partner_link = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a [PartnerLink][google.ads.datamanager.v1.PartnerLink] +// resource. Returns a [google.protobuf.Empty][google.protobuf.Empty]. +message DeletePartnerLinkRequest { + // Required. The resource name of the partner link to delete. + // Format: + // accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamanager.googleapis.com/PartnerLink" + } + ]; +} + +// Request to search for [PartnerLink][google.ads.datamanager.v1.PartnerLink] +// resources. Returns a +// [SearchPartnerLinksResponse][google.ads.datamanager.v1.SearchPartnerLinksResponse]. +message SearchPartnerLinksRequest { + // Required. Account to search for partner links. If no `filter` is specified, + // all partner links where this account is either the `owning_account` or + // `partner_account` are returned. + // + // Format: `accountTypes/{account_type}/accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/PartnerLink" + } + ]; + + // The maximum number of partner links to return. The service may return + // fewer than this value. + // If unspecified, at most 10 partner links will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous `SearchPartnerLinks` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `SearchPartnerLinks` + // must match the call that provided the page token. + string page_token = 3; + + // Optional. A [filter string](//google.aip.dev/160). All fields need to be on + // the left hand side of each condition (for example: `partner_link_id = + // 123456789`). + // + // Supported operations: + // + // - `AND` + // - `=` + // - `!=` + // + // Supported fields: + // + // - `partner_link_id` + // - `owning_account.account_type` + // - `owning_account.account_id` + // - `partner_account.account_type` + // - `partner_account.account_id` + // + // Example: + // `owning_account.account_type = "GOOGLE_ADS" OR partner_account.account_id = + // 987654321` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the +// [SearchPartnerLinksRequest][google.ads.datamanager.v1.SearchPartnerLinksRequest]. +message SearchPartnerLinksResponse { + // The partner links for the given account. + repeated PartnerLink partner_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// A partner link between an owning account and a partner account. +message PartnerLink { + option (google.api.resource) = { + type: "datamanager.googleapis.com/PartnerLink" + pattern: "accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}" + plural: "partnerLinks" + singular: "partnerLink" + }; + + // Identifier. The name of the partner link. + // Format: + // accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The partner link ID. + string partner_link_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The owning account granting access to the partner account. + ProductAccount owning_account = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The partner account granted access by the owning account. + ProductAccount partner_account = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/request_status_per_destination.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/request_status_per_destination.proto index 739851242af..64ca0cbe033 100644 --- a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/request_status_per_destination.proto +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/request_status_per_destination.proto @@ -60,6 +60,12 @@ message RequestStatusPerDestination { // The status of the pair data ingestion to the destination. IngestPairDataStatus pair_data_ingestion_status = 3; + + // The status of the user id data ingestion to the destination. + IngestUserIdDataStatus user_id_data_ingestion_status = 4; + + // The status of the ppid data ingestion to the destination. + IngestPpidDataStatus ppid_data_ingestion_status = 5; } } @@ -75,6 +81,12 @@ message RequestStatusPerDestination { // The status of the pair data removal from the destination. RemovePairDataStatus pair_data_removal_status = 3; + + // The status of the user id data removal from the destination. + RemoveUserIdDataStatus user_id_data_removal_status = 4; + + // The status of the ppid data removal from the destination. + RemovePpidDataStatus ppid_data_removal_status = 5; } } @@ -170,6 +182,60 @@ message RequestStatusPerDestination { int64 pair_id_count = 2; } + // The status of the user id data ingestion to the destination containing + // stats related to the ingestion. + message IngestUserIdDataStatus { + // The total count of audience members sent in the upload request for the + // destination. Includes all audience members in the request, regardless of + // whether they were successfully ingested or not. + int64 record_count = 1; + + // The total count of user ids sent in the upload request for the + // destination. Includes all user ids in the request, regardless of + // whether they were successfully ingested or not. + int64 user_id_count = 2; + } + + // The status of the user id data removal from the destination. + message RemoveUserIdDataStatus { + // The total count of audience members sent in the removal request. Includes + // all audience members in the request, regardless of whether they were + // successfully removed or not. + int64 record_count = 1; + + // The total count of user ids sent in the removal request. Includes all + // user ids in the request, regardless of whether they were successfully + // removed or not. + int64 user_id_count = 2; + } + + // The status of the ppid data ingestion to the destination containing stats + // related to the ingestion. + message IngestPpidDataStatus { + // The total count of audience members sent in the upload request for the + // destination. Includes all audience members in the request, regardless of + // whether they were successfully ingested or not. + int64 record_count = 1; + + // The total count of ppids sent in the upload request for the + // destination. Includes all ppids in the request, regardless of + // whether they were successfully ingested or not. + int64 ppid_count = 2; + } + + // The status of the ppid data removal from the destination. + message RemovePpidDataStatus { + // The total count of audience members sent in the removal request. Includes + // all audience members in the request, regardless of whether they were + // successfully removed or not. + int64 record_count = 1; + + // The total count of ppids sent in the removal request. Includes all + // ppids in the request, regardless of whether they were successfully + // removed or not. + int64 ppid_count = 2; + } + // A destination within a DM API request. Destination destination = 1; diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list.proto new file mode 100644 index 00000000000..0f15917653e --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list.proto @@ -0,0 +1,423 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// A user list resource. +message UserList { + option (google.api.resource) = { + type: "datamanager.googleapis.com/UserList" + pattern: "accountTypes/{account_type}/accounts/{account}/userLists/{user_list}" + plural: "userLists" + singular: "userList" + }; + + // Status of the user list. + enum MembershipStatus { + // Not specified. + MEMBERSHIP_STATUS_UNSPECIFIED = 0; + + // Open status - User list is accruing members and can be targeted to. + OPEN = 1; + + // Closed status - No new members being added. + CLOSED = 2; + } + + // Indicates the reason why the user list was closed. + // This enum is only used when a list is auto-closed by the system. + enum ClosingReason { + // Not specified. + CLOSING_REASON_UNSPECIFIED = 0; + + // The user list was closed because it has not been used in targeting + // recently. See https://support.google.com/google-ads/answer/2472738 + // for details. + UNUSED = 1; + } + + // Enum describing possible access reasons. + enum AccessReason { + // Not specified. + ACCESS_REASON_UNSPECIFIED = 0; + + // The resource is owned by the user. + OWNED = 1; + + // The resource is shared to the user. + SHARED = 2; + + // The resource is licensed to the user. + LICENSED = 3; + + // The user subscribed to the resource. + SUBSCRIBED = 4; + + // The resource is accessible to the user. + AFFILIATED = 5; + } + + // Indicates if this client still has access to the list. + enum AccessStatus { + // Not specified. + ACCESS_STATUS_UNSPECIFIED = 0; + + // The access is enabled. + ENABLED = 1; + + // The access is disabled. + DISABLED = 2; + } + + // Identifier. The resource name of the user list. + // Format: + // accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The unique ID of the user list. + int64 id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An option that indicates if a user may edit a list. + bool read_only = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the user list. + optional string display_name = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A description of the user list. + optional string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Membership status of this user list. + optional MembershipStatus membership_status = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An ID from external system. It is used by user list sellers to + // correlate IDs on their systems. + optional string integration_code = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The duration a user remains in the user list. + // Valid durations are exact multiples of 24 hours (86400 seconds). + // Providing a value that is not an exact multiple of 24 hours will result in + // an INVALID_ARGUMENT error. + google.protobuf.Duration membership_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The reason why this user list membership status is closed. + optional ClosingReason closing_reason = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason this account has been granted access to the list. + AccessReason access_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Indicates if this share is still enabled. When a user list is + // shared with the account this field is set to `ENABLED`. Later the user list + // owner can decide to revoke the share and make it `DISABLED`. + optional AccessStatus account_access_status = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Estimated number of members in this user list in different + // target networks. + SizeInfo size_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Eligibility information for different target networks. + TargetNetworkInfo target_network_info = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Additional information about the user list. + oneof user_list_info { + // Optional. Represents a user list that is populated by user ingested data. + IngestedUserListInfo ingested_user_list_info = 14 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Estimated number of members in this user list in different target networks. +message SizeInfo { + // Output only. Estimated number of members in this user list, on the Google + // Display Network. + int64 display_network_members_count = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Estimated number of members in this user list in the + // google.com domain. These are the members available for targeting in Search + // campaigns. + int64 search_network_members_count = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Eligibility information for different target networks. +message TargetNetworkInfo { + // Output only. Indicates this user list is eligible for Google Display + // Network. + bool eligible_for_display = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Indicates if this user list is eligible for Google Search + // Network. + optional bool eligible_for_search = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a user list that is populated by user provided data. +message IngestedUserListInfo { + // Enum containing the possible upload key types of a user list. + enum UploadKeyType { + // Not specified. + UPLOAD_KEY_TYPE_UNSPECIFIED = 0; + + // Customer info such as email address, phone number or physical address. + CONTACT_ID = 1; + + // Mobile advertising ids. + MOBILE_ID = 2; + + // Third party provided user ids. + USER_ID = 3; + + // Publisher advertiser identity reconciliation ids. + PAIR_ID = 4; + + // Data Management Platform IDs: + // - Google User ID + // - Partner Provided ID + // - Publisher Provided ID + // - iOS IDFA + // - Android advertising ID + // - Roku ID + // - Amazon Fire TV ID + // - Xbox or Microsoft ID + PSEUDONYMOUS_ID = 5; + } + + // Required. Immutable. Upload key types of this user list. + repeated UploadKeyType upload_key_types = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Additional information when `CONTACT_ID` is one of the + // `upload_key_types`. + ContactIdInfo contact_id_info = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information when `MOBILE_ID` is one of the + // `upload_key_types`. + MobileIdInfo mobile_id_info = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information when `USER_ID` is one of the + // `upload_key_types`. + UserIdInfo user_id_info = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information when `PAIR_ID` is one of the + // `upload_key_types`. + // + // This feature is only available to data partners. + PairIdInfo pair_id_info = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information for `PSEUDONYMOUS_ID` is one of the + // `upload_key_types`. + PseudonymousIdInfo pseudonymous_id_info = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information for partner audiences. + // + // This feature is only available to data partners. + PartnerAudienceInfo partner_audience_info = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional information when `CONTACT_ID` is one of the `upload_key_types`. +message ContactIdInfo { + // Optional. Immutable. Source of the upload data + optional DataSourceType data_source_type = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Match rate for customer match user lists. + int32 match_rate_percentage = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Additional information when `MOBILE_ID` is one of the `upload_key_types`. +message MobileIdInfo { + // Key space for mobile ID. + enum KeySpace { + // Not specified. + KEY_SPACE_UNSPECIFIED = 0; + + // The iOS keyspace. + IOS = 1; + + // The Android keyspace. + ANDROID = 2; + } + + // Optional. Immutable. Source of the upload data. + optional DataSourceType data_source_type = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The key space of mobile IDs. + optional KeySpace key_space = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. A string that uniquely identifies a mobile application + // from which the data was collected. + optional string app_id = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Additional information when `USER_ID` is one of the `upload_key_types`. +message UserIdInfo { + // Optional. Immutable. Source of the upload data. + optional DataSourceType data_source_type = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Additional information when `PAIR_ID` is one of the `upload_key_types`. +// +// This feature is only available to data partners. +message PairIdInfo { + // Required. Immutable. Identifies the publisher that the Publisher Advertiser + // Identity Reconciliation user list is reconciled with. This field is + // provided by the cleanroom provider and is only unique in the scope of that + // cleanroom. This cannot be used as a global identifier across multiple + // cleanrooms. + optional int64 publisher_id = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Descriptive name of the publisher to be displayed in the UI for a + // better targeting experience. + optional string publisher_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. This field denotes the percentage of membership match of this + // user list with the corresponding publisher's first party data. Must be + // between 0 and 100 inclusive. + int32 match_rate_percentage = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The count of the advertiser's first party data records that + // have been uploaded to a clean room provider. This does not signify the size + // of a PAIR user list. + int64 advertiser_identifier_count = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Identifies a unique advertiser to publisher + // relationship with one clean room provider or across multiple clean room + // providers. + optional string clean_room_identifier = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Additional information for partner audiences. +// +// This feature is only available to data partners. +message PartnerAudienceInfo { + // Partner audience source. + enum PartnerAudienceSource { + // Not specified. + PARTNER_AUDIENCE_SOURCE_UNSPECIFIED = 0; + + // Partner Audience source is commerce audience. + COMMERCE_AUDIENCE = 1; + + // Partner Audience source is linear TV audience. + LINEAR_TV_AUDIENCE = 2; + + // Partner Audience source is agency/provider audience. + AGENCY_PROVIDER_AUDIENCE = 3; + } + + // Required. Immutable. The source of the partner audience. + optional PartnerAudienceSource partner_audience_source = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The commerce partner name. + // Only allowed if `partner_audience_source` is `COMMERCE_AUDIENCE`. + optional string commerce_partner = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional information when `PSEUDONYMOUS_ID` is one of the +// `upload_key_types`. +message PseudonymousIdInfo { + // Sync status of the user list. + enum SyncStatus { + // Not specified. + SYNC_STATUS_UNSPECIFIED = 0; + + // The user list has been created as a placeholder. List contents and/or + // metadata are still being synced. The user list is not ready for use. + CREATED = 1; + + // The user list is ready for use. Contents and cookies have been synced + // correctly. + READY_FOR_USE = 2; + + // An error has occurred syncing user list contents and/or metadata. The + // user list cannot be used. + FAILED = 3; + } + + // Output only. Sync status of the user list. + optional SyncStatus sync_status = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. The number of billable records (e.g. uploaded or + // matched). + optional int64 billable_record_count = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Indicates source of upload data. +enum DataSourceType { + // Not specified. + DATA_SOURCE_TYPE_UNSPECIFIED = 0; + + // The uploaded data is first-party data. + DATA_SOURCE_TYPE_FIRST_PARTY = 1; + + // The uploaded data is from a third-party credit bureau. + DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU = 2; + + // The uploaded data is from a third-party voter file. + DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE = 3; + + // The uploaded data is third party partner data. + DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA = 4; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license.proto new file mode 100644 index 00000000000..44962539c41 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license.proto @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/user_list_license_client_account_type.proto"; +import "google/ads/datamanager/v1/user_list_license_metrics.proto"; +import "google/ads/datamanager/v1/user_list_license_pricing.proto"; +import "google/ads/datamanager/v1/user_list_license_status.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListDirectLicenseProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// A user list direct license. +// +// This feature is only available to data partners. +message UserListDirectLicense { + option (google.api.resource) = { + type: "datamanager.googleapis.com/UserListDirectLicense" + pattern: "accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}" + plural: "userListDirectLicenses" + singular: "userListDirectLicense" + }; + + // Identifier. The resource name of the user list direct license. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Immutable. ID of the user list being licensed. + optional int64 user_list_id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Name of the user list being licensed. + // + // This field is read-only. + string user_list_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Account type of client customer which the user list is being + // licensed to. + optional UserListLicenseClientAccountType client_account_type = 4 + [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. ID of client customer which the user list is being licensed to. + optional int64 client_account_id = 5 + [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Name of client customer which the user list is being licensed + // to. + // + // This field is read-only. + string client_account_display_name = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Status of UserListDirectLicense - ENABLED or DISABLED. + optional UserListLicenseStatus status = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. UserListDirectLicense pricing. + UserListLicensePricing pricing = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Pricing history of this user list license. + // + // This field is read-only. + repeated UserListLicensePricing historical_pricings = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics related to this license + // + // This field is read-only and only populated if the start and end dates are + // set in the ListUserListDirectLicenses call + UserListLicenseMetrics metrics = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license_service.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license_service.proto new file mode 100644 index 00000000000..4964f57d276 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_direct_license_service.proto @@ -0,0 +1,197 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/user_list_direct_license.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListDirectLicenseServiceProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Service for managing user list direct licenses. Delete is not a supported +// operation for UserListDirectLicenses. Callers should update the +// license status to DISABLED to instead to deactivate a license. +// +// This feature is only available to data partners. +service UserListDirectLicenseService { + option (google.api.default_host) = "datamanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/datamanager"; + + // Creates a user list direct license. + // + // This feature is only available to data partners. + rpc CreateUserListDirectLicense(CreateUserListDirectLicenseRequest) + returns (UserListDirectLicense) { + option (google.api.http) = { + post: "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses" + body: "user_list_direct_license" + }; + option (google.api.method_signature) = "parent,user_list_direct_license"; + } + + // Retrieves a user list direct license. + // + // This feature is only available to data partners. + rpc GetUserListDirectLicense(GetUserListDirectLicenseRequest) + returns (UserListDirectLicense) { + option (google.api.http) = { + get: "/v1/{name=accountTypes/*/accounts/*/userListDirectLicenses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user list direct license. + // + // This feature is only available to data partners. + rpc UpdateUserListDirectLicense(UpdateUserListDirectLicenseRequest) + returns (UserListDirectLicense) { + option (google.api.http) = { + patch: "/v1/{user_list_direct_license.name=accountTypes/*/accounts/*/userListDirectLicenses/*}" + body: "user_list_direct_license" + }; + option (google.api.method_signature) = + "user_list_direct_license,update_mask"; + } + + // Lists all user list direct licenses owned by the parent account. + // + // This feature is only available to data partners. + rpc ListUserListDirectLicenses(ListUserListDirectLicensesRequest) + returns (ListUserListDirectLicensesResponse) { + option (google.api.http) = { + get: "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request to create a +// [UserListDirectLicense][google.ads.datamanager.v1.UserListDirectLicense] +// resource. +message CreateUserListDirectLicenseRequest { + // Required. The account that owns the user list being licensed. Should be in + // the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserListDirectLicense" + } + ]; + + // Required. The user list direct license to create. + UserListDirectLicense user_list_direct_license = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to get a +// [UserListDirectLicense][google.ads.datamanager.v1.UserListDirectLicense] +// resource. +message GetUserListDirectLicenseRequest { + // Required. The resource name of the user list direct license. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamanager.googleapis.com/UserListDirectLicense" + } + ]; +} + +// Request to update a +// [UserListDirectLicense][google.ads.datamanager.v1.UserListDirectLicense] +// resource. +message UpdateUserListDirectLicenseRequest { + // Required. The licenses' `name` field is used to identify the license to + // update. + UserListDirectLicense user_list_direct_license = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. The special character `*` is not + // supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request to list all +// [UserListDirectLicense][google.ads.datamanager.v1.UserListDirectLicense] +// resources for a given account. +message ListUserListDirectLicensesRequest { + // Required. The account whose licenses are being queried. Should be in the + // format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserListDirectLicense" + } + ]; + + // Optional. Filters to apply to the list request. All fields need to be on + // the left hand side of each condition (for example: user_list_id = 123). + // + // **Supported Operations:** + // + // - `AND` + // - `=` + // - `!=` + // - `>` + // - `>=` + // - `<` + // - `<=` + // + // **Unsupported Fields:** + // + // - `name` (use get method instead) + // - `historical_pricings` and all its subfields + // - `pricing.start_time` + // - `pricing.end_time` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of licenses to return per page. The service + // may return fewer than this value. If unspecified, at most 50 licenses will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + // page. + // + // When paginating, all other parameters provided to + // `ListUserListDirectLicense` must match the call that provided the page + // token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the +// [ListUserListDirectLicensesRequest][google.ads.datamanager.v1.ListUserListDirectLicensesRequest]. +message ListUserListDirectLicensesResponse { + // The licenses for the given user list in the request. + repeated UserListDirectLicense user_list_direct_licenses = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license.proto new file mode 100644 index 00000000000..2e0f57ca3cc --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license.proto @@ -0,0 +1,139 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/user_list_global_license_type.proto"; +import "google/ads/datamanager/v1/user_list_license_client_account_type.proto"; +import "google/ads/datamanager/v1/user_list_license_metrics.proto"; +import "google/ads/datamanager/v1/user_list_license_pricing.proto"; +import "google/ads/datamanager/v1/user_list_license_status.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListGlobalLicenseProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// A user list global license. +// +// This feature is only available to data partners. +message UserListGlobalLicense { + option (google.api.resource) = { + type: "datamanager.googleapis.com/UserListGlobalLicense" + pattern: "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}" + plural: "userListGlobalLicenses" + singular: "userListGlobalLicense" + }; + + // Identifier. The resource name of the user list global license. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Immutable. ID of the user list being licensed. + optional int64 user_list_id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Name of the user list being licensed. + // + // This field is read-only. + string user_list_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Product type of client customer which the user list is being + // licensed to. + optional UserListGlobalLicenseType license_type = 4 + [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Status of UserListGlobalLicense - ENABLED or DISABLED. + optional UserListLicenseStatus status = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. UserListGlobalLicense pricing. + UserListLicensePricing pricing = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Pricing history of this user list license. + // + // This field is read-only. + repeated UserListLicensePricing historical_pricings = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics related to this license + // + // This field is read-only and only populated if the start and end dates are + // set in the ListUserListGlobalLicenses call + UserListLicenseMetrics metrics = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about a customer of a user list global license. This will +// automatically be created by the system when a customer purchases a global +// license. +message UserListGlobalLicenseCustomerInfo { + option (google.api.resource) = { + type: "datamanager.googleapis.com/UserListGlobalLicenseCustomerInfo" + pattern: "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}" + plural: "userListGlobalLicenseCustomerInfos" + singular: "userListGlobalLicenseCustomerInfo" + }; + + // Identifier. The resource name of the user list global license customer. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. ID of the user list being licensed. + int64 user_list_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the user list being licensed. + string user_list_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Product type of client customer which the user list is being + // licensed to. + UserListGlobalLicenseType license_type = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status of UserListDirectLicense - ENABLED or DISABLED. + UserListLicenseStatus status = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. UserListDirectLicense pricing. + UserListLicensePricing pricing = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Product type of client customer which the user list is being + // licensed to. + UserListLicenseClientAccountType client_account_type = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of client customer which the user list is being licensed + // to. + int64 client_account_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of client customer which the user list is being licensed + // to. + string client_account_display_name = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pricing history of this user list license. + repeated UserListLicensePricing historical_pricings = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics related to this license + // + // This field is only populated if the start and end dates are set in the + // ListUserListGlobalLicenseCustomerInfos call. + UserListLicenseMetrics metrics = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_service.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_service.proto new file mode 100644 index 00000000000..26d8335ae72 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_service.proto @@ -0,0 +1,275 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/user_list_global_license.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListGlobalLicenseServiceProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Service for managing user list global licenses. Delete is not a supported +// operation for UserListGlobalLicenses. Callers should update the +// license status to DISABLED to instead to deactivate a license. +// +// This feature is only available to data partners. +service UserListGlobalLicenseService { + option (google.api.default_host) = "datamanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/datamanager"; + + // Creates a user list global license. + // + // This feature is only available to data partners. + rpc CreateUserListGlobalLicense(CreateUserListGlobalLicenseRequest) + returns (UserListGlobalLicense) { + option (google.api.http) = { + post: "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses" + body: "user_list_global_license" + }; + option (google.api.method_signature) = "parent,user_list_global_license"; + } + + // Updates a user list global license. + // + // This feature is only available to data partners. + rpc UpdateUserListGlobalLicense(UpdateUserListGlobalLicenseRequest) + returns (UserListGlobalLicense) { + option (google.api.http) = { + patch: "/v1/{user_list_global_license.name=accountTypes/*/accounts/*/userListGlobalLicenses/*}" + body: "user_list_global_license" + }; + option (google.api.method_signature) = + "user_list_global_license,update_mask"; + } + + // Retrieves a user list global license. + // + // This feature is only available to data partners. + rpc GetUserListGlobalLicense(GetUserListGlobalLicenseRequest) + returns (UserListGlobalLicense) { + option (google.api.http) = { + get: "/v1/{name=accountTypes/*/accounts/*/userListGlobalLicenses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all user list global licenses owned by the parent account. + // + // This feature is only available to data partners. + rpc ListUserListGlobalLicenses(ListUserListGlobalLicensesRequest) + returns (ListUserListGlobalLicensesResponse) { + option (google.api.http) = { + get: "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all customer info for a user list global license. + // + // This feature is only available to data partners. + rpc ListUserListGlobalLicenseCustomerInfos( + ListUserListGlobalLicenseCustomerInfosRequest) + returns (ListUserListGlobalLicenseCustomerInfosResponse) { + option (google.api.http) = { + get: "/v1/{parent=accountTypes/*/accounts/*/userListGlobalLicenses/*}/userListGlobalLicenseCustomerInfos" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request to create a +// [UserListGlobalLicense][google.ads.datamanager.v1.UserListGlobalLicense] +// resource. +message CreateUserListGlobalLicenseRequest { + // Required. The account that owns the user list being licensed. Should be in + // the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserListGlobalLicense" + } + ]; + + // Required. The user list global license to create. + UserListGlobalLicense user_list_global_license = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update a +// [UserListGlobalLicense][google.ads.datamanager.v1.UserListGlobalLicense] +// resource. +message UpdateUserListGlobalLicenseRequest { + // Required. The licenses' `name` field is used to identify the license to + // update. + UserListGlobalLicense user_list_global_license = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. The special character `*` is not + // supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request to get a +// [UserListGlobalLicense][google.ads.datamanager.v1.UserListGlobalLicense] +// resource. +message GetUserListGlobalLicenseRequest { + // Required. The resource name of the user list global license. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamanager.googleapis.com/UserListGlobalLicense" + } + ]; +} + +// Request to list all +// [UserListGlobalLicense][google.ads.datamanager.v1.UserListGlobalLicense] +// resources for a given account. +message ListUserListGlobalLicensesRequest { + // Required. The account whose licenses are being queried. Should be in the + // format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserListGlobalLicense" + } + ]; + + // Optional. Filters to apply to the list request. All fields need to be on + // the left hand side of each condition (for example: user_list_id = 123). + // + // **Supported Operations:** + // + // - `AND` + // - `=` + // - `!=` + // - `>` + // - `>=` + // - `<` + // - `<=` + // + // **Unsupported Fields:** + // + // - `name` (use get method instead) + // - `historical_pricings` and all its subfields + // - `pricing.start_time` + // - `pricing.end_time` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of licenses to return. The service may return + // fewer than this value. If unspecified, at most 50 licenses will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListUserListGlobalLicense` call. Provide this to retrieve the subsequent + // page. + // + // When paginating, all other parameters provided to + // `ListUserListDirectLicense` must match the call that provided the page + // token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the +// [ListUserListGlobalLicensesRequest][google.ads.datamanager.v1.ListUserListGlobalLicensesRequest]. +message ListUserListGlobalLicensesResponse { + // The licenses for the given user list in the request. + repeated UserListGlobalLicense user_list_global_licenses = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to list all +// [UserListGlobalLicenseCustomerInfo][google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo] +// resources for a given user list global license. +message ListUserListGlobalLicenseCustomerInfosRequest { + // Required. The global license whose customer info are being queried. Should + // be in the format + // `accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID}/userListGlobalLicenses/{USER_LIST_GLOBAL_LICENSE_ID}`. + // To list all global license customer info under an account, replace the user + // list global license id with a '-' (for example, + // `accountTypes/DATA_PARTNER/accounts/123/userListGlobalLicenses/-`) + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserListGlobalLicenseCustomerInfo" + } + ]; + + // Optional. Filters to apply to the list request. All fields need to be on + // the left hand side of each condition (for example: user_list_id = 123). + // + // **Supported Operations:** + // + // - `AND` + // - `=` + // - `!=` + // - `>` + // - `>=` + // - `<` + // - `<=` + // + // **Unsupported Fields:** + // + // - `name` (use get method instead) + // - `historical_pricings` and all its subfields + // - `pricing.start_time` + // - `pricing.end_time` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of licenses to return. The service may return + // fewer than this value. If unspecified, at most 50 licenses will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + // page. + // + // When paginating, all other parameters provided to + // `ListUserListDirectLicense` must match the call that provided the page + // token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the +// [ListUserListGlobalLicensesCustomerInfoRequest][google.ads.datamanager.v1.ListUserListGlobalLicensesCustomerInfoRequest]. +message ListUserListGlobalLicenseCustomerInfosResponse { + // The customer information for the given license in the request. + repeated UserListGlobalLicenseCustomerInfo + user_list_global_license_customer_infos = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_type.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_type.proto new file mode 100644 index 00000000000..f85d9ed6b74 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_global_license_type.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListGlobalLicenseTypeProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// User list global license types. +enum UserListGlobalLicenseType { + // UNSPECIFIED. + USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED = 0; + + // Reseller license. + USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER = 1; + + // DataMart Sell Side license. + USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE = 2; + + // DataMart Buy Side license. + USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE = 3; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto new file mode 100644 index 00000000000..b116e0567f4 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto @@ -0,0 +1,43 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListLicenseClientAccountTypeProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Possible product of a client account for a user list license. +enum UserListLicenseClientAccountType { + // Unknown. + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN = 0; + + // Google Ads customer. + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS = 1; + + // Display & Video 360 partner. + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER = 2; + + // Display & Video 360 advertiser. + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER = 3; + + // Google Ad Manager audience link. + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK = 4; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_metrics.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_metrics.proto new file mode 100644 index 00000000000..0aceb2c6951 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_metrics.proto @@ -0,0 +1,53 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListLicenseMetricsProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Metrics related to a user list license. +message UserListLicenseMetrics { + // Output only. The number of clicks for the user list license. + int64 click_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of impressions for the user list license. + int64 impression_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revenue for the user list license in USD micros. + int64 revenue_usd_micros = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start date (inclusive) of the metrics in the format + // YYYYMMDD. For example, 20260102 represents January 2, 2026. If `end_date` + // is used in the filter, `start_date` is also required. If neither + // `start_date` nor `end_date` are included in the filter, the + // UserListLicenseMetrics fields will not be populated in the response. + int64 start_date = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end date (inclusive) of the metrics in the format + // YYYYMMDD. For example, 20260102 represents January 2, 2026. If `start_date` + // is used in the filter, `end_date` is also required. If neither `start_date` + // nor `end_date` are included in the filter, the UserListLicenseMetrics + // fields will not be populated in the response. + int64 end_date = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_pricing.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_pricing.proto new file mode 100644 index 00000000000..c8712b7de1a --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_pricing.proto @@ -0,0 +1,111 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListLicensePricingProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// A user list license pricing. +message UserListLicensePricing { + // User list pricing buyer approval state. + enum UserListPricingBuyerApprovalState { + // UNSPECIFIED. + USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED = 0; + + // User list client has not yet accepted the pricing terms set by the user + // list owner. + PENDING = 1; + + // User list client has accepted the pricing terms set by the user list + // owner. + APPROVED = 2; + + // User list client has rejected the pricing terms set by the user list + // owner. + REJECTED = 3; + } + + // User list pricing cost type. + enum UserListPricingCostType { + // Unspecified. + USER_LIST_PRICING_COST_TYPE_UNSPECIFIED = 0; + + // Cost per click. + CPC = 1; + + // Cost per mille (thousand impressions). + CPM = 2; + + // Media share. + MEDIA_SHARE = 3; + } + + // Output only. The ID of this pricing. + int64 pricing_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The cost associated with the model, in micro units (10^-6), in + // the currency specified by the currency_code field. For example, 2000000 + // means $2 if `currency_code` is `USD`. + optional int64 cost_micros = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The currency in which cost and max_cost is specified. Must be a + // three-letter currency code defined in ISO 4217. + optional string currency_code = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Start time of the pricing. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. End time of the pricing. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Whether this pricing is active. + bool pricing_active = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The buyer approval state of this pricing. + // + // This field is read-only. + UserListPricingBuyerApprovalState buyer_approval_state = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The cost type of this pricing. + // + // Can be set only in the `create` operation. Can't be updated for + // an existing license. + optional UserListPricingCostType cost_type = 7 + [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. The maximum CPM a commerce audience can be charged when the + // MEDIA_SHARE cost type is used. The value is in micro units (10^-6) and in + // the currency specified by the currency_code field. For example, 2000000 + // means $2 if `currency_code` is `USD`. + // + // This is only relevant when cost_type is MEDIA_SHARE. + // When cost_type is not MEDIA_SHARE, and this field is set, a + // MAX_COST_NOT_ALLOWED error will be returned. + // If not set or set to`0`, there is no cap. + optional int64 max_cost_micros = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_status.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_status.proto new file mode 100644 index 00000000000..5a16e961d04 --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_license_status.proto @@ -0,0 +1,37 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListLicenseStatusProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// User list license status. +enum UserListLicenseStatus { + // Unknown. + USER_LIST_LICENSE_STATUS_UNSPECIFIED = 0; + + // Active status - user list is still being licensed. + USER_LIST_LICENSE_STATUS_ENABLED = 1; + + // Inactive status - user list is no longer being licensed. + USER_LIST_LICENSE_STATUS_DISABLED = 2; +} diff --git a/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_service.proto b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_service.proto new file mode 100644 index 00000000000..8a7595f46df --- /dev/null +++ b/packages/google-ads-datamanager/protos/google/ads/datamanager/v1/user_list_service.proto @@ -0,0 +1,272 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ads.datamanager.v1; + +import "google/ads/datamanager/v1/user_list.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Ads.DataManager.V1"; +option go_package = "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "UserListServiceProto"; +option java_package = "com.google.ads.datamanager.v1"; +option php_namespace = "Google\\Ads\\DataManager\\V1"; +option ruby_package = "Google::Ads::DataManager::V1"; + +// Service for managing UserList resources. +service UserListService { + option (google.api.default_host) = "datamanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/datamanager"; + + // Gets a UserList. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc GetUserList(GetUserListRequest) returns (UserList) { + option (google.api.http) = { + get: "/v1/{name=accountTypes/*/accounts/*/userLists/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists UserLists. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc ListUserLists(ListUserListsRequest) returns (ListUserListsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accountTypes/*/accounts/*}/userLists" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a UserList. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc CreateUserList(CreateUserListRequest) returns (UserList) { + option (google.api.http) = { + post: "/v1/{parent=accountTypes/*/accounts/*}/userLists" + body: "user_list" + }; + option (google.api.method_signature) = "parent,user_list"; + } + + // Updates a UserList. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc UpdateUserList(UpdateUserListRequest) returns (UserList) { + option (google.api.http) = { + patch: "/v1/{user_list.name=accountTypes/*/accounts/*/userLists/*}" + body: "user_list" + }; + option (google.api.method_signature) = "user_list,update_mask"; + } + + // Deletes a UserList. + // + // Authorization Headers: + // + // This method supports the following optional headers to define how the API + // authorizes access for the request: + // + // * `login-account`: (Optional) The resource name of the account where the + // Google Account of the credentials is a user. If not set, defaults to the + // account of the request. Format: + // `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + // * `linked-account`: (Optional) The resource name of the account with an + // established product link to the `login-account`. Format: + // `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + rpc DeleteUserList(DeleteUserListRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accountTypes/*/accounts/*/userLists/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for GetUserList. +message GetUserListRequest { + // Required. The resource name of the UserList to retrieve. + // Format: + // accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamanager.googleapis.com/UserList" + } + ]; +} + +// Request message for ListUserLists. +message ListUserListsRequest { + // Required. The parent account which owns this collection of user lists. + // Format: accountTypes/{account_type}/accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserList" + } + ]; + + // Optional. The maximum number of user lists to return. The service may + // return fewer than this value. If unspecified, at most 50 user lists will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListUserLists` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListUserLists` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A [filter string](//google.aip.dev/160). All fields need to be on + // the left hand side of each condition (for example: `display_name = "list + // 1"`). + // + // Supported operations: + // + // - `AND` + // - `=` + // - `!=` + // - `>` + // - `>=` + // - `<` + // - `<=` + // - `:` (has) + // + // Supported fields: + // + // - `id` + // - `display_name` + // - `description` + // - `membership_status` + // - `integration_code` + // - `access_reason` + // - `ingested_user_list_info.upload_key_types` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListUserLists. +message ListUserListsResponse { + // The user lists from the specified account. + repeated UserList user_lists = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateUserList. +message CreateUserListRequest { + // Required. The parent account where this user list will be created. + // Format: accountTypes/{account_type}/accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamanager.googleapis.com/UserList" + } + ]; + + // Required. The user list to create. + UserList user_list = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, the request is validated but not executed. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for UpdateUserList. +message UpdateUserListRequest { + // Required. The user list to update. + // + // The user list's `name` field is used to identify the user list to update. + // Format: + // accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + UserList user_list = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the request is validated but not executed. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeleteUserList. +message DeleteUserListRequest { + // Required. The name of the user list to delete. + // Format: + // accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamanager.googleapis.com/UserList" + } + ]; + + // Optional. If true, the request is validated but not executed. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-ads-datamanager/protos/protos.d.ts b/packages/google-ads-datamanager/protos/protos.d.ts index 1df2fdf013e..db34d7f0bd5 100644 --- a/packages/google-ads-datamanager/protos/protos.d.ts +++ b/packages/google-ads-datamanager/protos/protos.d.ts @@ -26,6 +26,18 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** AgeRange enum. */ + enum AgeRange { + AGE_RANGE_UNSPECIFIED = 0, + AGE_RANGE_UNKNOWN = 1, + AGE_RANGE_18_24 = 2, + AGE_RANGE_25_34 = 3, + AGE_RANGE_35_44 = 4, + AGE_RANGE_45_54 = 5, + AGE_RANGE_55_64 = 6, + AGE_RANGE_65_UP = 7 + } + /** Properties of an AudienceMember. */ interface IAudienceMember { @@ -41,6 +53,12 @@ export namespace google { /** AudienceMember mobileData */ mobileData?: (google.ads.datamanager.v1.IMobileData|null); + /** AudienceMember userIdData */ + userIdData?: (google.ads.datamanager.v1.IUserIdData|null); + + /** AudienceMember ppidData */ + ppidData?: (google.ads.datamanager.v1.IPpidData|null); + /** AudienceMember consent */ consent?: (google.ads.datamanager.v1.IConsent|null); } @@ -66,11 +84,17 @@ export namespace google { /** AudienceMember mobileData. */ public mobileData?: (google.ads.datamanager.v1.IMobileData|null); + /** AudienceMember userIdData. */ + public userIdData?: (google.ads.datamanager.v1.IUserIdData|null); + + /** AudienceMember ppidData. */ + public ppidData?: (google.ads.datamanager.v1.IPpidData|null); + /** AudienceMember consent. */ public consent?: (google.ads.datamanager.v1.IConsent|null); /** AudienceMember data. */ - public data?: ("userData"|"pairData"|"mobileData"); + public data?: ("userData"|"pairData"|"mobileData"|"userIdData"|"ppidData"); /** * Creates a new AudienceMember instance using the specified properties. @@ -344,6 +368,200 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a UserIdData. */ + interface IUserIdData { + + /** UserIdData userId */ + userId?: (string|null); + } + + /** Represents a UserIdData. */ + class UserIdData implements IUserIdData { + + /** + * Constructs a new UserIdData. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserIdData); + + /** UserIdData userId. */ + public userId: string; + + /** + * Creates a new UserIdData instance using the specified properties. + * @param [properties] Properties to set + * @returns UserIdData instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserIdData): google.ads.datamanager.v1.UserIdData; + + /** + * Encodes the specified UserIdData message. Does not implicitly {@link google.ads.datamanager.v1.UserIdData.verify|verify} messages. + * @param message UserIdData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserIdData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserIdData message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserIdData.verify|verify} messages. + * @param message UserIdData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserIdData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserIdData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserIdData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserIdData; + + /** + * Decodes a UserIdData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserIdData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserIdData; + + /** + * Verifies a UserIdData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserIdData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserIdData + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserIdData; + + /** + * Creates a plain object from a UserIdData message. Also converts values to other types if specified. + * @param message UserIdData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserIdData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserIdData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserIdData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PpidData. */ + interface IPpidData { + + /** PpidData ppids */ + ppids?: (string[]|null); + } + + /** Represents a PpidData. */ + class PpidData implements IPpidData { + + /** + * Constructs a new PpidData. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IPpidData); + + /** PpidData ppids. */ + public ppids: string[]; + + /** + * Creates a new PpidData instance using the specified properties. + * @param [properties] Properties to set + * @returns PpidData instance + */ + public static create(properties?: google.ads.datamanager.v1.IPpidData): google.ads.datamanager.v1.PpidData; + + /** + * Encodes the specified PpidData message. Does not implicitly {@link google.ads.datamanager.v1.PpidData.verify|verify} messages. + * @param message PpidData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IPpidData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PpidData message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PpidData.verify|verify} messages. + * @param message PpidData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IPpidData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PpidData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PpidData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.PpidData; + + /** + * Decodes a PpidData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PpidData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.PpidData; + + /** + * Verifies a PpidData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PpidData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PpidData + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.PpidData; + + /** + * Creates a plain object from a PpidData message. Also converts values to other types if specified. + * @param message PpidData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.PpidData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PpidData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PpidData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Consent. */ interface IConsent { @@ -1362,7 +1580,8 @@ export namespace google { DISPLAY_VIDEO_PARTNER = 2, DISPLAY_VIDEO_ADVERTISER = 3, DATA_PARTNER = 4, - GOOGLE_ANALYTICS_PROPERTY = 5 + GOOGLE_ANALYTICS_PROPERTY = 5, + GOOGLE_AD_MANAGER_AUDIENCE_LINK = 6 } } @@ -1885,7 +2104,54 @@ export namespace google { INVALID_REQUEST_ID = 48, MULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT = 49, FIELD_VALUE_TOO_LONG = 50, - TOO_MANY_ELEMENTS = 51 + TOO_MANY_ELEMENTS = 51, + ALREADY_EXISTS = 52, + IMMUTABLE_FIELD_FOR_UPDATE = 53, + INVALID_RESOURCE_NAME = 54, + INVALID_FILTER = 55, + INVALID_UPDATE_MASK = 56, + INVALID_PAGE_TOKEN = 57, + CANNOT_UPDATE_DISABLED_LICENSE = 58, + CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST = 59, + INSUFFICIENT_COST = 60, + CANNOT_DISABLE_LICENSE = 61, + INVALID_CLIENT_ACCOUNT_ID = 62, + PRICING_ONLY_ZERO_COST_ALLOWED = 63, + PRICE_TOO_HIGH = 64, + CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE = 65, + INVALID_PRICING_END_DATE = 66, + CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT = 67, + MISMATCHED_ACCOUNT_TYPE = 68, + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE = 69, + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER = 70, + INVALID_MEDIA_SHARE_COST = 71, + INVALID_COST_TYPE = 72, + MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST = 73, + MAX_COST_NOT_ALLOWED = 74, + COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED = 75, + INVALID_DESCRIPTION = 76, + INVALID_DISPLAY_NAME = 77, + DISPLAY_NAME_ALREADY_USED = 78, + OWNERSHIP_REQUIRED_FOR_UPDATE = 79, + USER_LIST_MUTATION_NOT_SUPPORTED = 80, + SENSITIVE_USER_LIST_IMMUTABLE = 81, + BILLABLE_RECORD_COUNT_IMMUTABLE = 82, + USER_LIST_NAME_RESERVED = 83, + ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA = 84, + UNSUPPORTED_PARTNER_AUDIENCE_SOURCE = 85, + COMMERCE_PARTNER_NOT_ALLOWED = 86, + UNSUPPORTED_PARTNER_AUDIENCE_INFO = 87, + PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED = 88, + DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA = 89, + ADVERTISER_TOS_NOT_ACCEPTED = 90, + ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA = 91, + USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT = 92, + INVALID_COMMERCE_PARTNER = 93, + CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE = 94, + UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES = 95, + UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG = 96, + UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE = 97, + UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK = 98 } /** Properties of an Event. */ @@ -1983,7 +2249,7 @@ export namespace google { public currency: string; /** Event conversionValue. */ - public conversionValue: number; + public conversionValue?: (number|null); /** Event eventSource. */ public eventSource: (google.ads.datamanager.v1.EventSource|keyof typeof google.ads.datamanager.v1.EventSource); @@ -2767,6 +3033,14 @@ export namespace google { HIGH = 3 } + /** Gender enum. */ + enum Gender { + GENDER_UNSPECIFIED = 0, + GENDER_UNKNOWN = 1, + GENDER_MALE = 2, + GENDER_FEMALE = 3 + } + /** Represents an IngestionService */ class IngestionService extends $protobuf.rpc.Service { @@ -3906,6 +4180,12 @@ export namespace google { /** IngestAudienceMembersStatus pairDataIngestionStatus */ pairDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPairDataStatus|null); + + /** IngestAudienceMembersStatus userIdDataIngestionStatus */ + userIdDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus|null); + + /** IngestAudienceMembersStatus ppidDataIngestionStatus */ + ppidDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus|null); } /** Represents an IngestAudienceMembersStatus. */ @@ -3926,8 +4206,14 @@ export namespace google { /** IngestAudienceMembersStatus pairDataIngestionStatus. */ public pairDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPairDataStatus|null); + /** IngestAudienceMembersStatus userIdDataIngestionStatus. */ + public userIdDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus|null); + + /** IngestAudienceMembersStatus ppidDataIngestionStatus. */ + public ppidDataIngestionStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus|null); + /** IngestAudienceMembersStatus status. */ - public status?: ("userDataIngestionStatus"|"mobileDataIngestionStatus"|"pairDataIngestionStatus"); + public status?: ("userDataIngestionStatus"|"mobileDataIngestionStatus"|"pairDataIngestionStatus"|"userIdDataIngestionStatus"|"ppidDataIngestionStatus"); /** * Creates a new IngestAudienceMembersStatus instance using the specified properties. @@ -4018,6 +4304,12 @@ export namespace google { /** RemoveAudienceMembersStatus pairDataRemovalStatus */ pairDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePairDataStatus|null); + + /** RemoveAudienceMembersStatus userIdDataRemovalStatus */ + userIdDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus|null); + + /** RemoveAudienceMembersStatus ppidDataRemovalStatus */ + ppidDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus|null); } /** Represents a RemoveAudienceMembersStatus. */ @@ -4038,8 +4330,14 @@ export namespace google { /** RemoveAudienceMembersStatus pairDataRemovalStatus. */ public pairDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePairDataStatus|null); + /** RemoveAudienceMembersStatus userIdDataRemovalStatus. */ + public userIdDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus|null); + + /** RemoveAudienceMembersStatus ppidDataRemovalStatus. */ + public ppidDataRemovalStatus?: (google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus|null); + /** RemoveAudienceMembersStatus status. */ - public status?: ("userDataRemovalStatus"|"mobileDataRemovalStatus"|"pairDataRemovalStatus"); + public status?: ("userDataRemovalStatus"|"mobileDataRemovalStatus"|"pairDataRemovalStatus"|"userIdDataRemovalStatus"|"ppidDataRemovalStatus"); /** * Creates a new RemoveAudienceMembersStatus instance using the specified properties. @@ -4839,590 +5137,6823 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** MatchRateRange enum. */ - enum MatchRateRange { - MATCH_RATE_RANGE_UNKNOWN = 0, - MATCH_RATE_RANGE_NOT_ELIGIBLE = 1, - MATCH_RATE_RANGE_LESS_THAN_20 = 2, - MATCH_RATE_RANGE_20_TO_30 = 3, - MATCH_RATE_RANGE_31_TO_40 = 4, - MATCH_RATE_RANGE_41_TO_50 = 5, - MATCH_RATE_RANGE_51_TO_60 = 6, - MATCH_RATE_RANGE_61_TO_70 = 7, - MATCH_RATE_RANGE_71_TO_80 = 8, - MATCH_RATE_RANGE_81_TO_90 = 9, - MATCH_RATE_RANGE_91_TO_100 = 10 - } + /** Properties of an IngestUserIdDataStatus. */ + interface IIngestUserIdDataStatus { - /** Properties of an ErrorInfo. */ - interface IErrorInfo { + /** IngestUserIdDataStatus recordCount */ + recordCount?: (number|Long|string|null); - /** ErrorInfo errorCounts */ - errorCounts?: (google.ads.datamanager.v1.IErrorCount[]|null); - } + /** IngestUserIdDataStatus userIdCount */ + userIdCount?: (number|Long|string|null); + } - /** Represents an ErrorInfo. */ - class ErrorInfo implements IErrorInfo { + /** Represents an IngestUserIdDataStatus. */ + class IngestUserIdDataStatus implements IIngestUserIdDataStatus { - /** - * Constructs a new ErrorInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.ads.datamanager.v1.IErrorInfo); + /** + * Constructs a new IngestUserIdDataStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus); - /** ErrorInfo errorCounts. */ - public errorCounts: google.ads.datamanager.v1.IErrorCount[]; + /** IngestUserIdDataStatus recordCount. */ + public recordCount: (number|Long|string); - /** - * Creates a new ErrorInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ErrorInfo instance - */ - public static create(properties?: google.ads.datamanager.v1.IErrorInfo): google.ads.datamanager.v1.ErrorInfo; + /** IngestUserIdDataStatus userIdCount. */ + public userIdCount: (number|Long|string); - /** - * Encodes the specified ErrorInfo message. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. - * @param message ErrorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.ads.datamanager.v1.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new IngestUserIdDataStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestUserIdDataStatus instance + */ + public static create(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus): google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus; - /** - * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. - * @param message ErrorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.ads.datamanager.v1.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified IngestUserIdDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.verify|verify} messages. + * @param message IngestUserIdDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ErrorInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ErrorInfo; + /** + * Encodes the specified IngestUserIdDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.verify|verify} messages. + * @param message IngestUserIdDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ErrorInfo; + /** + * Decodes an IngestUserIdDataStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus; - /** - * Verifies an ErrorInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an IngestUserIdDataStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus; - /** - * Creates an ErrorInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ErrorInfo - */ - public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ErrorInfo; + /** + * Verifies an IngestUserIdDataStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** + /** + * Creates an IngestUserIdDataStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestUserIdDataStatus + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus; + + /** + * Creates a plain object from an IngestUserIdDataStatus message. Also converts values to other types if specified. + * @param message IngestUserIdDataStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestUserIdDataStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestUserIdDataStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveUserIdDataStatus. */ + interface IRemoveUserIdDataStatus { + + /** RemoveUserIdDataStatus recordCount */ + recordCount?: (number|Long|string|null); + + /** RemoveUserIdDataStatus userIdCount */ + userIdCount?: (number|Long|string|null); + } + + /** Represents a RemoveUserIdDataStatus. */ + class RemoveUserIdDataStatus implements IRemoveUserIdDataStatus { + + /** + * Constructs a new RemoveUserIdDataStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus); + + /** RemoveUserIdDataStatus recordCount. */ + public recordCount: (number|Long|string); + + /** RemoveUserIdDataStatus userIdCount. */ + public userIdCount: (number|Long|string); + + /** + * Creates a new RemoveUserIdDataStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveUserIdDataStatus instance + */ + public static create(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus): google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus; + + /** + * Encodes the specified RemoveUserIdDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.verify|verify} messages. + * @param message RemoveUserIdDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveUserIdDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.verify|verify} messages. + * @param message RemoveUserIdDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveUserIdDataStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus; + + /** + * Decodes a RemoveUserIdDataStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus; + + /** + * Verifies a RemoveUserIdDataStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveUserIdDataStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveUserIdDataStatus + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus; + + /** + * Creates a plain object from a RemoveUserIdDataStatus message. Also converts values to other types if specified. + * @param message RemoveUserIdDataStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveUserIdDataStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveUserIdDataStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestPpidDataStatus. */ + interface IIngestPpidDataStatus { + + /** IngestPpidDataStatus recordCount */ + recordCount?: (number|Long|string|null); + + /** IngestPpidDataStatus ppidCount */ + ppidCount?: (number|Long|string|null); + } + + /** Represents an IngestPpidDataStatus. */ + class IngestPpidDataStatus implements IIngestPpidDataStatus { + + /** + * Constructs a new IngestPpidDataStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus); + + /** IngestPpidDataStatus recordCount. */ + public recordCount: (number|Long|string); + + /** IngestPpidDataStatus ppidCount. */ + public ppidCount: (number|Long|string); + + /** + * Creates a new IngestPpidDataStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestPpidDataStatus instance + */ + public static create(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus): google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus; + + /** + * Encodes the specified IngestPpidDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.verify|verify} messages. + * @param message IngestPpidDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestPpidDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.verify|verify} messages. + * @param message IngestPpidDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestPpidDataStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestPpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus; + + /** + * Decodes an IngestPpidDataStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestPpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus; + + /** + * Verifies an IngestPpidDataStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestPpidDataStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestPpidDataStatus + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus; + + /** + * Creates a plain object from an IngestPpidDataStatus message. Also converts values to other types if specified. + * @param message IngestPpidDataStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestPpidDataStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestPpidDataStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemovePpidDataStatus. */ + interface IRemovePpidDataStatus { + + /** RemovePpidDataStatus recordCount */ + recordCount?: (number|Long|string|null); + + /** RemovePpidDataStatus ppidCount */ + ppidCount?: (number|Long|string|null); + } + + /** Represents a RemovePpidDataStatus. */ + class RemovePpidDataStatus implements IRemovePpidDataStatus { + + /** + * Constructs a new RemovePpidDataStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus); + + /** RemovePpidDataStatus recordCount. */ + public recordCount: (number|Long|string); + + /** RemovePpidDataStatus ppidCount. */ + public ppidCount: (number|Long|string); + + /** + * Creates a new RemovePpidDataStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePpidDataStatus instance + */ + public static create(properties?: google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus): google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus; + + /** + * Encodes the specified RemovePpidDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.verify|verify} messages. + * @param message RemovePpidDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePpidDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.verify|verify} messages. + * @param message RemovePpidDataStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePpidDataStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus; + + /** + * Decodes a RemovePpidDataStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus; + + /** + * Verifies a RemovePpidDataStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePpidDataStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePpidDataStatus + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus; + + /** + * Creates a plain object from a RemovePpidDataStatus message. Also converts values to other types if specified. + * @param message RemovePpidDataStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePpidDataStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemovePpidDataStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** MatchRateRange enum. */ + enum MatchRateRange { + MATCH_RATE_RANGE_UNKNOWN = 0, + MATCH_RATE_RANGE_NOT_ELIGIBLE = 1, + MATCH_RATE_RANGE_LESS_THAN_20 = 2, + MATCH_RATE_RANGE_20_TO_30 = 3, + MATCH_RATE_RANGE_31_TO_40 = 4, + MATCH_RATE_RANGE_41_TO_50 = 5, + MATCH_RATE_RANGE_51_TO_60 = 6, + MATCH_RATE_RANGE_61_TO_70 = 7, + MATCH_RATE_RANGE_71_TO_80 = 8, + MATCH_RATE_RANGE_81_TO_90 = 9, + MATCH_RATE_RANGE_91_TO_100 = 10 + } + + /** Properties of an ErrorInfo. */ + interface IErrorInfo { + + /** ErrorInfo errorCounts */ + errorCounts?: (google.ads.datamanager.v1.IErrorCount[]|null); + } + + /** Represents an ErrorInfo. */ + class ErrorInfo implements IErrorInfo { + + /** + * Constructs a new ErrorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IErrorInfo); + + /** ErrorInfo errorCounts. */ + public errorCounts: google.ads.datamanager.v1.IErrorCount[]; + + /** + * Creates a new ErrorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IErrorInfo): google.ads.datamanager.v1.ErrorInfo; + + /** + * Encodes the specified ErrorInfo message. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. + * @param message ErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. + * @param message ErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ErrorInfo; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ErrorInfo; + + /** + * Verifies an ErrorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ErrorInfo; + + /** * Creates a plain object from an ErrorInfo message. Also converts values to other types if specified. * @param message ErrorInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ads.datamanager.v1.ErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ads.datamanager.v1.ErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ErrorCount. */ + interface IErrorCount { + + /** ErrorCount recordCount */ + recordCount?: (number|Long|string|null); + + /** ErrorCount reason */ + reason?: (google.ads.datamanager.v1.ProcessingErrorReason|keyof typeof google.ads.datamanager.v1.ProcessingErrorReason|null); + } + + /** Represents an ErrorCount. */ + class ErrorCount implements IErrorCount { + + /** + * Constructs a new ErrorCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IErrorCount); + + /** ErrorCount recordCount. */ + public recordCount: (number|Long|string); + + /** ErrorCount reason. */ + public reason: (google.ads.datamanager.v1.ProcessingErrorReason|keyof typeof google.ads.datamanager.v1.ProcessingErrorReason); + + /** + * Creates a new ErrorCount instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorCount instance + */ + public static create(properties?: google.ads.datamanager.v1.IErrorCount): google.ads.datamanager.v1.ErrorCount; + + /** + * Encodes the specified ErrorCount message. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * @param message ErrorCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IErrorCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * @param message ErrorCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IErrorCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ErrorCount; + + /** + * Decodes an ErrorCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ErrorCount; + + /** + * Verifies an ErrorCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorCount + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ErrorCount; + + /** + * Creates a plain object from an ErrorCount message. Also converts values to other types if specified. + * @param message ErrorCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ErrorCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WarningInfo. */ + interface IWarningInfo { + + /** WarningInfo warningCounts */ + warningCounts?: (google.ads.datamanager.v1.IWarningCount[]|null); + } + + /** Represents a WarningInfo. */ + class WarningInfo implements IWarningInfo { + + /** + * Constructs a new WarningInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IWarningInfo); + + /** WarningInfo warningCounts. */ + public warningCounts: google.ads.datamanager.v1.IWarningCount[]; + + /** + * Creates a new WarningInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WarningInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IWarningInfo): google.ads.datamanager.v1.WarningInfo; + + /** + * Encodes the specified WarningInfo message. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * @param message WarningInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IWarningInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WarningInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * @param message WarningInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IWarningInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WarningInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WarningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.WarningInfo; + + /** + * Decodes a WarningInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WarningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.WarningInfo; + + /** + * Verifies a WarningInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WarningInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WarningInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.WarningInfo; + + /** + * Creates a plain object from a WarningInfo message. Also converts values to other types if specified. + * @param message WarningInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.WarningInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WarningInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WarningInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WarningCount. */ + interface IWarningCount { + + /** WarningCount recordCount */ + recordCount?: (number|Long|string|null); + + /** WarningCount reason */ + reason?: (google.ads.datamanager.v1.ProcessingWarningReason|keyof typeof google.ads.datamanager.v1.ProcessingWarningReason|null); + } + + /** Represents a WarningCount. */ + class WarningCount implements IWarningCount { + + /** + * Constructs a new WarningCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IWarningCount); + + /** WarningCount recordCount. */ + public recordCount: (number|Long|string); + + /** WarningCount reason. */ + public reason: (google.ads.datamanager.v1.ProcessingWarningReason|keyof typeof google.ads.datamanager.v1.ProcessingWarningReason); + + /** + * Creates a new WarningCount instance using the specified properties. + * @param [properties] Properties to set + * @returns WarningCount instance + */ + public static create(properties?: google.ads.datamanager.v1.IWarningCount): google.ads.datamanager.v1.WarningCount; + + /** + * Encodes the specified WarningCount message. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * @param message WarningCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IWarningCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WarningCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * @param message WarningCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IWarningCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WarningCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WarningCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.WarningCount; + + /** + * Decodes a WarningCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WarningCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.WarningCount; + + /** + * Verifies a WarningCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WarningCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WarningCount + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.WarningCount; + + /** + * Creates a plain object from a WarningCount message. Also converts values to other types if specified. + * @param message WarningCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.WarningCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WarningCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WarningCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProcessingErrorReason enum. */ + enum ProcessingErrorReason { + PROCESSING_ERROR_REASON_UNSPECIFIED = 0, + PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE = 1, + PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED = 2, + PROCESSING_ERROR_REASON_EVENT_TOO_OLD = 3, + PROCESSING_ERROR_REASON_DENIED_CONSENT = 4, + PROCESSING_ERROR_REASON_NO_CONSENT = 5, + PROCESSING_ERROR_REASON_UNKNOWN_CONSENT = 6, + PROCESSING_ERROR_REASON_DUPLICATE_GCLID = 7, + PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID = 8, + PROCESSING_ERROR_REASON_INVALID_GBRAID = 9, + PROCESSING_ERROR_REASON_INVALID_GCLID = 10, + PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID = 11, + PROCESSING_ERROR_REASON_INVALID_WBRAID = 12, + PROCESSING_ERROR_REASON_INTERNAL_ERROR = 13, + PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED = 14, + PROCESSING_ERROR_REASON_INVALID_EVENT = 15, + PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS = 16, + PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS = 17, + PROCESSING_ERROR_REASON_INVALID_FORMAT = 18, + PROCESSING_ERROR_REASON_DECRYPTION_ERROR = 19, + PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR = 20, + PROCESSING_ERROR_REASON_INVALID_WIP = 21, + PROCESSING_ERROR_REASON_INVALID_KEK = 22, + PROCESSING_ERROR_REASON_WIP_AUTH_FAILED = 23, + PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED = 24, + PROCESSING_ERROR_REASON_AWS_AUTH_FAILED = 27, + PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR = 25, + PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER = 26 + } + + /** ProcessingWarningReason enum. */ + enum ProcessingWarningReason { + PROCESSING_WARNING_REASON_UNSPECIFIED = 0, + PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED = 1, + PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR = 2, + PROCESSING_WARNING_REASON_DECRYPTION_ERROR = 3, + PROCESSING_WARNING_REASON_WIP_AUTH_FAILED = 4, + PROCESSING_WARNING_REASON_INVALID_WIP = 5, + PROCESSING_WARNING_REASON_INVALID_KEK = 6, + PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR = 7, + PROCESSING_WARNING_REASON_INTERNAL_ERROR = 8, + PROCESSING_WARNING_REASON_AWS_AUTH_FAILED = 9 + } + + /** Properties of a TermsOfService. */ + interface ITermsOfService { + + /** TermsOfService customerMatchTermsOfServiceStatus */ + customerMatchTermsOfServiceStatus?: (google.ads.datamanager.v1.TermsOfServiceStatus|keyof typeof google.ads.datamanager.v1.TermsOfServiceStatus|null); + } + + /** Represents a TermsOfService. */ + class TermsOfService implements ITermsOfService { + + /** + * Constructs a new TermsOfService. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ITermsOfService); + + /** TermsOfService customerMatchTermsOfServiceStatus. */ + public customerMatchTermsOfServiceStatus: (google.ads.datamanager.v1.TermsOfServiceStatus|keyof typeof google.ads.datamanager.v1.TermsOfServiceStatus); + + /** + * Creates a new TermsOfService instance using the specified properties. + * @param [properties] Properties to set + * @returns TermsOfService instance + */ + public static create(properties?: google.ads.datamanager.v1.ITermsOfService): google.ads.datamanager.v1.TermsOfService; + + /** + * Encodes the specified TermsOfService message. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * @param message TermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * @param message TermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TermsOfService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.TermsOfService; + + /** + * Decodes a TermsOfService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.TermsOfService; + + /** + * Verifies a TermsOfService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TermsOfService + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.TermsOfService; + + /** + * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. + * @param message TermsOfService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.TermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TermsOfService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TermsOfService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TermsOfServiceStatus enum. */ + enum TermsOfServiceStatus { + TERMS_OF_SERVICE_STATUS_UNSPECIFIED = 0, + ACCEPTED = 1, + REJECTED = 2 + } + + /** Represents a MarketingDataInsightsService */ + class MarketingDataInsightsService extends $protobuf.rpc.Service { + + /** + * Constructs a new MarketingDataInsightsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new MarketingDataInsightsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MarketingDataInsightsService; + + /** + * Calls RetrieveInsights. + * @param request RetrieveInsightsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveInsightsResponse + */ + public retrieveInsights(request: google.ads.datamanager.v1.IRetrieveInsightsRequest, callback: google.ads.datamanager.v1.MarketingDataInsightsService.RetrieveInsightsCallback): void; + + /** + * Calls RetrieveInsights. + * @param request RetrieveInsightsRequest message or plain object + * @returns Promise + */ + public retrieveInsights(request: google.ads.datamanager.v1.IRetrieveInsightsRequest): Promise; + } + + namespace MarketingDataInsightsService { + + /** + * Callback as used by {@link google.ads.datamanager.v1.MarketingDataInsightsService|retrieveInsights}. + * @param error Error, if any + * @param [response] RetrieveInsightsResponse + */ + type RetrieveInsightsCallback = (error: (Error|null), response?: google.ads.datamanager.v1.RetrieveInsightsResponse) => void; + } + + /** Properties of a RetrieveInsightsRequest. */ + interface IRetrieveInsightsRequest { + + /** RetrieveInsightsRequest parent */ + parent?: (string|null); + + /** RetrieveInsightsRequest baseline */ + baseline?: (google.ads.datamanager.v1.IBaseline|null); + + /** RetrieveInsightsRequest userListId */ + userListId?: (string|null); + } + + /** Represents a RetrieveInsightsRequest. */ + class RetrieveInsightsRequest implements IRetrieveInsightsRequest { + + /** + * Constructs a new RetrieveInsightsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IRetrieveInsightsRequest); + + /** RetrieveInsightsRequest parent. */ + public parent: string; + + /** RetrieveInsightsRequest baseline. */ + public baseline?: (google.ads.datamanager.v1.IBaseline|null); + + /** RetrieveInsightsRequest userListId. */ + public userListId: string; + + /** + * Creates a new RetrieveInsightsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveInsightsRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IRetrieveInsightsRequest): google.ads.datamanager.v1.RetrieveInsightsRequest; + + /** + * Encodes the specified RetrieveInsightsRequest message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsRequest.verify|verify} messages. + * @param message RetrieveInsightsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IRetrieveInsightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveInsightsRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsRequest.verify|verify} messages. + * @param message RetrieveInsightsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IRetrieveInsightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveInsightsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RetrieveInsightsRequest; + + /** + * Decodes a RetrieveInsightsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RetrieveInsightsRequest; + + /** + * Verifies a RetrieveInsightsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveInsightsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveInsightsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RetrieveInsightsRequest; + + /** + * Creates a plain object from a RetrieveInsightsRequest message. Also converts values to other types if specified. + * @param message RetrieveInsightsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RetrieveInsightsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveInsightsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveInsightsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Baseline. */ + interface IBaseline { + + /** Baseline baselineLocation */ + baselineLocation?: (google.ads.datamanager.v1.Baseline.ILocation|null); + + /** Baseline locationAutoDetectionEnabled */ + locationAutoDetectionEnabled?: (boolean|null); + } + + /** Represents a Baseline. */ + class Baseline implements IBaseline { + + /** + * Constructs a new Baseline. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IBaseline); + + /** Baseline baselineLocation. */ + public baselineLocation?: (google.ads.datamanager.v1.Baseline.ILocation|null); + + /** Baseline locationAutoDetectionEnabled. */ + public locationAutoDetectionEnabled?: (boolean|null); + + /** Baseline baseline. */ + public baseline?: ("baselineLocation"|"locationAutoDetectionEnabled"); + + /** + * Creates a new Baseline instance using the specified properties. + * @param [properties] Properties to set + * @returns Baseline instance + */ + public static create(properties?: google.ads.datamanager.v1.IBaseline): google.ads.datamanager.v1.Baseline; + + /** + * Encodes the specified Baseline message. Does not implicitly {@link google.ads.datamanager.v1.Baseline.verify|verify} messages. + * @param message Baseline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IBaseline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Baseline message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.Baseline.verify|verify} messages. + * @param message Baseline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IBaseline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Baseline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Baseline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.Baseline; + + /** + * Decodes a Baseline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Baseline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.Baseline; + + /** + * Verifies a Baseline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Baseline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Baseline + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.Baseline; + + /** + * Creates a plain object from a Baseline message. Also converts values to other types if specified. + * @param message Baseline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.Baseline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Baseline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Baseline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Baseline { + + /** Properties of a Location. */ + interface ILocation { + + /** Location regionCodes */ + regionCodes?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.Baseline.ILocation); + + /** Location regionCodes. */ + public regionCodes: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.ads.datamanager.v1.Baseline.ILocation): google.ads.datamanager.v1.Baseline.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.ads.datamanager.v1.Baseline.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.Baseline.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.Baseline.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.Baseline.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.Baseline.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.Baseline.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.Baseline.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.Baseline.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RetrieveInsightsResponse. */ + interface IRetrieveInsightsResponse { + + /** RetrieveInsightsResponse marketingDataInsights */ + marketingDataInsights?: (google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight[]|null); + } + + /** Represents a RetrieveInsightsResponse. */ + class RetrieveInsightsResponse implements IRetrieveInsightsResponse { + + /** + * Constructs a new RetrieveInsightsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IRetrieveInsightsResponse); + + /** RetrieveInsightsResponse marketingDataInsights. */ + public marketingDataInsights: google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight[]; + + /** + * Creates a new RetrieveInsightsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveInsightsResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.IRetrieveInsightsResponse): google.ads.datamanager.v1.RetrieveInsightsResponse; + + /** + * Encodes the specified RetrieveInsightsResponse message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.verify|verify} messages. + * @param message RetrieveInsightsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IRetrieveInsightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveInsightsResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.verify|verify} messages. + * @param message RetrieveInsightsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IRetrieveInsightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveInsightsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RetrieveInsightsResponse; + + /** + * Decodes a RetrieveInsightsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RetrieveInsightsResponse; + + /** + * Verifies a RetrieveInsightsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveInsightsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveInsightsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RetrieveInsightsResponse; + + /** + * Creates a plain object from a RetrieveInsightsResponse message. Also converts values to other types if specified. + * @param message RetrieveInsightsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RetrieveInsightsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveInsightsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveInsightsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RetrieveInsightsResponse { + + /** Properties of a MarketingDataInsight. */ + interface IMarketingDataInsight { + + /** MarketingDataInsight dimension */ + dimension?: (google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension|keyof typeof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension|null); + + /** MarketingDataInsight attributes */ + attributes?: (google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute[]|null); + } + + /** Represents a MarketingDataInsight. */ + class MarketingDataInsight implements IMarketingDataInsight { + + /** + * Constructs a new MarketingDataInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight); + + /** MarketingDataInsight dimension. */ + public dimension: (google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension|keyof typeof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension); + + /** MarketingDataInsight attributes. */ + public attributes: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute[]; + + /** + * Creates a new MarketingDataInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns MarketingDataInsight instance + */ + public static create(properties?: google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight; + + /** + * Encodes the specified MarketingDataInsight message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.verify|verify} messages. + * @param message MarketingDataInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarketingDataInsight message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.verify|verify} messages. + * @param message MarketingDataInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarketingDataInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarketingDataInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight; + + /** + * Decodes a MarketingDataInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarketingDataInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight; + + /** + * Verifies a MarketingDataInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarketingDataInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarketingDataInsight + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight; + + /** + * Creates a plain object from a MarketingDataInsight message. Also converts values to other types if specified. + * @param message MarketingDataInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarketingDataInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarketingDataInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MarketingDataInsight { + + /** AudienceInsightsDimension enum. */ + enum AudienceInsightsDimension { + AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED = 0, + AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN = 1, + AFFINITY_USER_INTEREST = 2, + IN_MARKET_USER_INTEREST = 3, + AGE_RANGE = 4, + GENDER = 5 + } + + /** Properties of a MarketingDataInsightsAttribute. */ + interface IMarketingDataInsightsAttribute { + + /** MarketingDataInsightsAttribute userInterestId */ + userInterestId?: (number|Long|string|null); + + /** MarketingDataInsightsAttribute lift */ + lift?: (number|null); + + /** MarketingDataInsightsAttribute ageRange */ + ageRange?: (google.ads.datamanager.v1.AgeRange|keyof typeof google.ads.datamanager.v1.AgeRange|null); + + /** MarketingDataInsightsAttribute gender */ + gender?: (google.ads.datamanager.v1.Gender|keyof typeof google.ads.datamanager.v1.Gender|null); + } + + /** Represents a MarketingDataInsightsAttribute. */ + class MarketingDataInsightsAttribute implements IMarketingDataInsightsAttribute { + + /** + * Constructs a new MarketingDataInsightsAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute); + + /** MarketingDataInsightsAttribute userInterestId. */ + public userInterestId?: (number|Long|string|null); + + /** MarketingDataInsightsAttribute lift. */ + public lift?: (number|null); + + /** MarketingDataInsightsAttribute ageRange. */ + public ageRange?: (google.ads.datamanager.v1.AgeRange|keyof typeof google.ads.datamanager.v1.AgeRange|null); + + /** MarketingDataInsightsAttribute gender. */ + public gender?: (google.ads.datamanager.v1.Gender|keyof typeof google.ads.datamanager.v1.Gender|null); + + /** + * Creates a new MarketingDataInsightsAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns MarketingDataInsightsAttribute instance + */ + public static create(properties?: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute; + + /** + * Encodes the specified MarketingDataInsightsAttribute message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.verify|verify} messages. + * @param message MarketingDataInsightsAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarketingDataInsightsAttribute message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.verify|verify} messages. + * @param message MarketingDataInsightsAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarketingDataInsightsAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarketingDataInsightsAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute; + + /** + * Decodes a MarketingDataInsightsAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarketingDataInsightsAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute; + + /** + * Verifies a MarketingDataInsightsAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarketingDataInsightsAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarketingDataInsightsAttribute + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute; + + /** + * Creates a plain object from a MarketingDataInsightsAttribute message. Also converts values to other types if specified. + * @param message MarketingDataInsightsAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarketingDataInsightsAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarketingDataInsightsAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Represents a PartnerLinkService */ + class PartnerLinkService extends $protobuf.rpc.Service { + + /** + * Constructs a new PartnerLinkService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new PartnerLinkService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PartnerLinkService; + + /** + * Calls CreatePartnerLink. + * @param request CreatePartnerLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PartnerLink + */ + public createPartnerLink(request: google.ads.datamanager.v1.ICreatePartnerLinkRequest, callback: google.ads.datamanager.v1.PartnerLinkService.CreatePartnerLinkCallback): void; + + /** + * Calls CreatePartnerLink. + * @param request CreatePartnerLinkRequest message or plain object + * @returns Promise + */ + public createPartnerLink(request: google.ads.datamanager.v1.ICreatePartnerLinkRequest): Promise; + + /** + * Calls DeletePartnerLink. + * @param request DeletePartnerLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePartnerLink(request: google.ads.datamanager.v1.IDeletePartnerLinkRequest, callback: google.ads.datamanager.v1.PartnerLinkService.DeletePartnerLinkCallback): void; + + /** + * Calls DeletePartnerLink. + * @param request DeletePartnerLinkRequest message or plain object + * @returns Promise + */ + public deletePartnerLink(request: google.ads.datamanager.v1.IDeletePartnerLinkRequest): Promise; + + /** + * Calls SearchPartnerLinks. + * @param request SearchPartnerLinksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchPartnerLinksResponse + */ + public searchPartnerLinks(request: google.ads.datamanager.v1.ISearchPartnerLinksRequest, callback: google.ads.datamanager.v1.PartnerLinkService.SearchPartnerLinksCallback): void; + + /** + * Calls SearchPartnerLinks. + * @param request SearchPartnerLinksRequest message or plain object + * @returns Promise + */ + public searchPartnerLinks(request: google.ads.datamanager.v1.ISearchPartnerLinksRequest): Promise; + } + + namespace PartnerLinkService { + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|createPartnerLink}. + * @param error Error, if any + * @param [response] PartnerLink + */ + type CreatePartnerLinkCallback = (error: (Error|null), response?: google.ads.datamanager.v1.PartnerLink) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|deletePartnerLink}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePartnerLinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|searchPartnerLinks}. + * @param error Error, if any + * @param [response] SearchPartnerLinksResponse + */ + type SearchPartnerLinksCallback = (error: (Error|null), response?: google.ads.datamanager.v1.SearchPartnerLinksResponse) => void; + } + + /** Properties of a CreatePartnerLinkRequest. */ + interface ICreatePartnerLinkRequest { + + /** CreatePartnerLinkRequest parent */ + parent?: (string|null); + + /** CreatePartnerLinkRequest partnerLink */ + partnerLink?: (google.ads.datamanager.v1.IPartnerLink|null); + } + + /** Represents a CreatePartnerLinkRequest. */ + class CreatePartnerLinkRequest implements ICreatePartnerLinkRequest { + + /** + * Constructs a new CreatePartnerLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ICreatePartnerLinkRequest); + + /** CreatePartnerLinkRequest parent. */ + public parent: string; + + /** CreatePartnerLinkRequest partnerLink. */ + public partnerLink?: (google.ads.datamanager.v1.IPartnerLink|null); + + /** + * Creates a new CreatePartnerLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePartnerLinkRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.ICreatePartnerLinkRequest): google.ads.datamanager.v1.CreatePartnerLinkRequest; + + /** + * Encodes the specified CreatePartnerLinkRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreatePartnerLinkRequest.verify|verify} messages. + * @param message CreatePartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ICreatePartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePartnerLinkRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreatePartnerLinkRequest.verify|verify} messages. + * @param message CreatePartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ICreatePartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePartnerLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.CreatePartnerLinkRequest; + + /** + * Decodes a CreatePartnerLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.CreatePartnerLinkRequest; + + /** + * Verifies a CreatePartnerLinkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePartnerLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.CreatePartnerLinkRequest; + + /** + * Creates a plain object from a CreatePartnerLinkRequest message. Also converts values to other types if specified. + * @param message CreatePartnerLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.CreatePartnerLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePartnerLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePartnerLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePartnerLinkRequest. */ + interface IDeletePartnerLinkRequest { + + /** DeletePartnerLinkRequest name */ + name?: (string|null); + } + + /** Represents a DeletePartnerLinkRequest. */ + class DeletePartnerLinkRequest implements IDeletePartnerLinkRequest { + + /** + * Constructs a new DeletePartnerLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IDeletePartnerLinkRequest); + + /** DeletePartnerLinkRequest name. */ + public name: string; + + /** + * Creates a new DeletePartnerLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePartnerLinkRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IDeletePartnerLinkRequest): google.ads.datamanager.v1.DeletePartnerLinkRequest; + + /** + * Encodes the specified DeletePartnerLinkRequest message. Does not implicitly {@link google.ads.datamanager.v1.DeletePartnerLinkRequest.verify|verify} messages. + * @param message DeletePartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IDeletePartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePartnerLinkRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.DeletePartnerLinkRequest.verify|verify} messages. + * @param message DeletePartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IDeletePartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePartnerLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.DeletePartnerLinkRequest; + + /** + * Decodes a DeletePartnerLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.DeletePartnerLinkRequest; + + /** + * Verifies a DeletePartnerLinkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePartnerLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.DeletePartnerLinkRequest; + + /** + * Creates a plain object from a DeletePartnerLinkRequest message. Also converts values to other types if specified. + * @param message DeletePartnerLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.DeletePartnerLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePartnerLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePartnerLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchPartnerLinksRequest. */ + interface ISearchPartnerLinksRequest { + + /** SearchPartnerLinksRequest parent */ + parent?: (string|null); + + /** SearchPartnerLinksRequest pageSize */ + pageSize?: (number|null); + + /** SearchPartnerLinksRequest pageToken */ + pageToken?: (string|null); + + /** SearchPartnerLinksRequest filter */ + filter?: (string|null); + } + + /** Represents a SearchPartnerLinksRequest. */ + class SearchPartnerLinksRequest implements ISearchPartnerLinksRequest { + + /** + * Constructs a new SearchPartnerLinksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ISearchPartnerLinksRequest); + + /** SearchPartnerLinksRequest parent. */ + public parent: string; + + /** SearchPartnerLinksRequest pageSize. */ + public pageSize: number; + + /** SearchPartnerLinksRequest pageToken. */ + public pageToken: string; + + /** SearchPartnerLinksRequest filter. */ + public filter: string; + + /** + * Creates a new SearchPartnerLinksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchPartnerLinksRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.ISearchPartnerLinksRequest): google.ads.datamanager.v1.SearchPartnerLinksRequest; + + /** + * Encodes the specified SearchPartnerLinksRequest message. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksRequest.verify|verify} messages. + * @param message SearchPartnerLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ISearchPartnerLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchPartnerLinksRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksRequest.verify|verify} messages. + * @param message SearchPartnerLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ISearchPartnerLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchPartnerLinksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.SearchPartnerLinksRequest; + + /** + * Decodes a SearchPartnerLinksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.SearchPartnerLinksRequest; + + /** + * Verifies a SearchPartnerLinksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchPartnerLinksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchPartnerLinksRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.SearchPartnerLinksRequest; + + /** + * Creates a plain object from a SearchPartnerLinksRequest message. Also converts values to other types if specified. + * @param message SearchPartnerLinksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.SearchPartnerLinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchPartnerLinksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchPartnerLinksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchPartnerLinksResponse. */ + interface ISearchPartnerLinksResponse { + + /** SearchPartnerLinksResponse partnerLinks */ + partnerLinks?: (google.ads.datamanager.v1.IPartnerLink[]|null); + + /** SearchPartnerLinksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchPartnerLinksResponse. */ + class SearchPartnerLinksResponse implements ISearchPartnerLinksResponse { + + /** + * Constructs a new SearchPartnerLinksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ISearchPartnerLinksResponse); + + /** SearchPartnerLinksResponse partnerLinks. */ + public partnerLinks: google.ads.datamanager.v1.IPartnerLink[]; + + /** SearchPartnerLinksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchPartnerLinksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchPartnerLinksResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.ISearchPartnerLinksResponse): google.ads.datamanager.v1.SearchPartnerLinksResponse; + + /** + * Encodes the specified SearchPartnerLinksResponse message. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksResponse.verify|verify} messages. + * @param message SearchPartnerLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ISearchPartnerLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchPartnerLinksResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksResponse.verify|verify} messages. + * @param message SearchPartnerLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ISearchPartnerLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchPartnerLinksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.SearchPartnerLinksResponse; + + /** + * Decodes a SearchPartnerLinksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.SearchPartnerLinksResponse; + + /** + * Verifies a SearchPartnerLinksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchPartnerLinksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchPartnerLinksResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.SearchPartnerLinksResponse; + + /** + * Creates a plain object from a SearchPartnerLinksResponse message. Also converts values to other types if specified. + * @param message SearchPartnerLinksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.SearchPartnerLinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchPartnerLinksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchPartnerLinksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartnerLink. */ + interface IPartnerLink { + + /** PartnerLink name */ + name?: (string|null); + + /** PartnerLink partnerLinkId */ + partnerLinkId?: (string|null); + + /** PartnerLink owningAccount */ + owningAccount?: (google.ads.datamanager.v1.IProductAccount|null); + + /** PartnerLink partnerAccount */ + partnerAccount?: (google.ads.datamanager.v1.IProductAccount|null); + } + + /** Represents a PartnerLink. */ + class PartnerLink implements IPartnerLink { + + /** + * Constructs a new PartnerLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IPartnerLink); + + /** PartnerLink name. */ + public name: string; + + /** PartnerLink partnerLinkId. */ + public partnerLinkId: string; + + /** PartnerLink owningAccount. */ + public owningAccount?: (google.ads.datamanager.v1.IProductAccount|null); + + /** PartnerLink partnerAccount. */ + public partnerAccount?: (google.ads.datamanager.v1.IProductAccount|null); + + /** + * Creates a new PartnerLink instance using the specified properties. + * @param [properties] Properties to set + * @returns PartnerLink instance + */ + public static create(properties?: google.ads.datamanager.v1.IPartnerLink): google.ads.datamanager.v1.PartnerLink; + + /** + * Encodes the specified PartnerLink message. Does not implicitly {@link google.ads.datamanager.v1.PartnerLink.verify|verify} messages. + * @param message PartnerLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IPartnerLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartnerLink message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PartnerLink.verify|verify} messages. + * @param message PartnerLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IPartnerLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartnerLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.PartnerLink; + + /** + * Decodes a PartnerLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.PartnerLink; + + /** + * Verifies a PartnerLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartnerLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartnerLink + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.PartnerLink; + + /** + * Creates a plain object from a PartnerLink message. Also converts values to other types if specified. + * @param message PartnerLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.PartnerLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartnerLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartnerLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserList. */ + interface IUserList { + + /** UserList name */ + name?: (string|null); + + /** UserList id */ + id?: (number|Long|string|null); + + /** UserList readOnly */ + readOnly?: (boolean|null); + + /** UserList displayName */ + displayName?: (string|null); + + /** UserList description */ + description?: (string|null); + + /** UserList membershipStatus */ + membershipStatus?: (google.ads.datamanager.v1.UserList.MembershipStatus|keyof typeof google.ads.datamanager.v1.UserList.MembershipStatus|null); + + /** UserList integrationCode */ + integrationCode?: (string|null); + + /** UserList membershipDuration */ + membershipDuration?: (google.protobuf.IDuration|null); + + /** UserList closingReason */ + closingReason?: (google.ads.datamanager.v1.UserList.ClosingReason|keyof typeof google.ads.datamanager.v1.UserList.ClosingReason|null); + + /** UserList accessReason */ + accessReason?: (google.ads.datamanager.v1.UserList.AccessReason|keyof typeof google.ads.datamanager.v1.UserList.AccessReason|null); + + /** UserList accountAccessStatus */ + accountAccessStatus?: (google.ads.datamanager.v1.UserList.AccessStatus|keyof typeof google.ads.datamanager.v1.UserList.AccessStatus|null); + + /** UserList sizeInfo */ + sizeInfo?: (google.ads.datamanager.v1.ISizeInfo|null); + + /** UserList targetNetworkInfo */ + targetNetworkInfo?: (google.ads.datamanager.v1.ITargetNetworkInfo|null); + + /** UserList ingestedUserListInfo */ + ingestedUserListInfo?: (google.ads.datamanager.v1.IIngestedUserListInfo|null); + } + + /** Represents a UserList. */ + class UserList implements IUserList { + + /** + * Constructs a new UserList. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserList); + + /** UserList name. */ + public name: string; + + /** UserList id. */ + public id: (number|Long|string); + + /** UserList readOnly. */ + public readOnly: boolean; + + /** UserList displayName. */ + public displayName?: (string|null); + + /** UserList description. */ + public description?: (string|null); + + /** UserList membershipStatus. */ + public membershipStatus?: (google.ads.datamanager.v1.UserList.MembershipStatus|keyof typeof google.ads.datamanager.v1.UserList.MembershipStatus|null); + + /** UserList integrationCode. */ + public integrationCode?: (string|null); + + /** UserList membershipDuration. */ + public membershipDuration?: (google.protobuf.IDuration|null); + + /** UserList closingReason. */ + public closingReason?: (google.ads.datamanager.v1.UserList.ClosingReason|keyof typeof google.ads.datamanager.v1.UserList.ClosingReason|null); + + /** UserList accessReason. */ + public accessReason: (google.ads.datamanager.v1.UserList.AccessReason|keyof typeof google.ads.datamanager.v1.UserList.AccessReason); + + /** UserList accountAccessStatus. */ + public accountAccessStatus?: (google.ads.datamanager.v1.UserList.AccessStatus|keyof typeof google.ads.datamanager.v1.UserList.AccessStatus|null); + + /** UserList sizeInfo. */ + public sizeInfo?: (google.ads.datamanager.v1.ISizeInfo|null); + + /** UserList targetNetworkInfo. */ + public targetNetworkInfo?: (google.ads.datamanager.v1.ITargetNetworkInfo|null); + + /** UserList ingestedUserListInfo. */ + public ingestedUserListInfo?: (google.ads.datamanager.v1.IIngestedUserListInfo|null); + + /** UserList userListInfo. */ + public userListInfo?: "ingestedUserListInfo"; + + /** + * Creates a new UserList instance using the specified properties. + * @param [properties] Properties to set + * @returns UserList instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserList): google.ads.datamanager.v1.UserList; + + /** + * Encodes the specified UserList message. Does not implicitly {@link google.ads.datamanager.v1.UserList.verify|verify} messages. + * @param message UserList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserList message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserList.verify|verify} messages. + * @param message UserList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserList; + + /** + * Decodes a UserList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserList; + + /** + * Verifies a UserList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserList + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserList; + + /** + * Creates a plain object from a UserList message. Also converts values to other types if specified. + * @param message UserList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UserList { + + /** MembershipStatus enum. */ + enum MembershipStatus { + MEMBERSHIP_STATUS_UNSPECIFIED = 0, + OPEN = 1, + CLOSED = 2 + } + + /** ClosingReason enum. */ + enum ClosingReason { + CLOSING_REASON_UNSPECIFIED = 0, + UNUSED = 1 + } + + /** AccessReason enum. */ + enum AccessReason { + ACCESS_REASON_UNSPECIFIED = 0, + OWNED = 1, + SHARED = 2, + LICENSED = 3, + SUBSCRIBED = 4, + AFFILIATED = 5 + } + + /** AccessStatus enum. */ + enum AccessStatus { + ACCESS_STATUS_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a SizeInfo. */ + interface ISizeInfo { + + /** SizeInfo displayNetworkMembersCount */ + displayNetworkMembersCount?: (number|Long|string|null); + + /** SizeInfo searchNetworkMembersCount */ + searchNetworkMembersCount?: (number|Long|string|null); + } + + /** Represents a SizeInfo. */ + class SizeInfo implements ISizeInfo { + + /** + * Constructs a new SizeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ISizeInfo); + + /** SizeInfo displayNetworkMembersCount. */ + public displayNetworkMembersCount: (number|Long|string); + + /** SizeInfo searchNetworkMembersCount. */ + public searchNetworkMembersCount: (number|Long|string); + + /** + * Creates a new SizeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SizeInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.ISizeInfo): google.ads.datamanager.v1.SizeInfo; + + /** + * Encodes the specified SizeInfo message. Does not implicitly {@link google.ads.datamanager.v1.SizeInfo.verify|verify} messages. + * @param message SizeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ISizeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SizeInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SizeInfo.verify|verify} messages. + * @param message SizeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ISizeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SizeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SizeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.SizeInfo; + + /** + * Decodes a SizeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SizeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.SizeInfo; + + /** + * Verifies a SizeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SizeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SizeInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.SizeInfo; + + /** + * Creates a plain object from a SizeInfo message. Also converts values to other types if specified. + * @param message SizeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.SizeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SizeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SizeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetNetworkInfo. */ + interface ITargetNetworkInfo { + + /** TargetNetworkInfo eligibleForDisplay */ + eligibleForDisplay?: (boolean|null); + + /** TargetNetworkInfo eligibleForSearch */ + eligibleForSearch?: (boolean|null); + } + + /** Represents a TargetNetworkInfo. */ + class TargetNetworkInfo implements ITargetNetworkInfo { + + /** + * Constructs a new TargetNetworkInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ITargetNetworkInfo); + + /** TargetNetworkInfo eligibleForDisplay. */ + public eligibleForDisplay: boolean; + + /** TargetNetworkInfo eligibleForSearch. */ + public eligibleForSearch?: (boolean|null); + + /** + * Creates a new TargetNetworkInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetNetworkInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.ITargetNetworkInfo): google.ads.datamanager.v1.TargetNetworkInfo; + + /** + * Encodes the specified TargetNetworkInfo message. Does not implicitly {@link google.ads.datamanager.v1.TargetNetworkInfo.verify|verify} messages. + * @param message TargetNetworkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ITargetNetworkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetNetworkInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TargetNetworkInfo.verify|verify} messages. + * @param message TargetNetworkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ITargetNetworkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetNetworkInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.TargetNetworkInfo; + + /** + * Decodes a TargetNetworkInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.TargetNetworkInfo; + + /** + * Verifies a TargetNetworkInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetNetworkInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetNetworkInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.TargetNetworkInfo; + + /** + * Creates a plain object from a TargetNetworkInfo message. Also converts values to other types if specified. + * @param message TargetNetworkInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.TargetNetworkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetNetworkInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetNetworkInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestedUserListInfo. */ + interface IIngestedUserListInfo { + + /** IngestedUserListInfo uploadKeyTypes */ + uploadKeyTypes?: (google.ads.datamanager.v1.IngestedUserListInfo.UploadKeyType[]|null); + + /** IngestedUserListInfo contactIdInfo */ + contactIdInfo?: (google.ads.datamanager.v1.IContactIdInfo|null); + + /** IngestedUserListInfo mobileIdInfo */ + mobileIdInfo?: (google.ads.datamanager.v1.IMobileIdInfo|null); + + /** IngestedUserListInfo userIdInfo */ + userIdInfo?: (google.ads.datamanager.v1.IUserIdInfo|null); + + /** IngestedUserListInfo pairIdInfo */ + pairIdInfo?: (google.ads.datamanager.v1.IPairIdInfo|null); + + /** IngestedUserListInfo pseudonymousIdInfo */ + pseudonymousIdInfo?: (google.ads.datamanager.v1.IPseudonymousIdInfo|null); + + /** IngestedUserListInfo partnerAudienceInfo */ + partnerAudienceInfo?: (google.ads.datamanager.v1.IPartnerAudienceInfo|null); + } + + /** Represents an IngestedUserListInfo. */ + class IngestedUserListInfo implements IIngestedUserListInfo { + + /** + * Constructs a new IngestedUserListInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IIngestedUserListInfo); + + /** IngestedUserListInfo uploadKeyTypes. */ + public uploadKeyTypes: google.ads.datamanager.v1.IngestedUserListInfo.UploadKeyType[]; + + /** IngestedUserListInfo contactIdInfo. */ + public contactIdInfo?: (google.ads.datamanager.v1.IContactIdInfo|null); + + /** IngestedUserListInfo mobileIdInfo. */ + public mobileIdInfo?: (google.ads.datamanager.v1.IMobileIdInfo|null); + + /** IngestedUserListInfo userIdInfo. */ + public userIdInfo?: (google.ads.datamanager.v1.IUserIdInfo|null); + + /** IngestedUserListInfo pairIdInfo. */ + public pairIdInfo?: (google.ads.datamanager.v1.IPairIdInfo|null); + + /** IngestedUserListInfo pseudonymousIdInfo. */ + public pseudonymousIdInfo?: (google.ads.datamanager.v1.IPseudonymousIdInfo|null); + + /** IngestedUserListInfo partnerAudienceInfo. */ + public partnerAudienceInfo?: (google.ads.datamanager.v1.IPartnerAudienceInfo|null); + + /** + * Creates a new IngestedUserListInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestedUserListInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IIngestedUserListInfo): google.ads.datamanager.v1.IngestedUserListInfo; + + /** + * Encodes the specified IngestedUserListInfo message. Does not implicitly {@link google.ads.datamanager.v1.IngestedUserListInfo.verify|verify} messages. + * @param message IngestedUserListInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IIngestedUserListInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestedUserListInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.IngestedUserListInfo.verify|verify} messages. + * @param message IngestedUserListInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IIngestedUserListInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestedUserListInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestedUserListInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.IngestedUserListInfo; + + /** + * Decodes an IngestedUserListInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestedUserListInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.IngestedUserListInfo; + + /** + * Verifies an IngestedUserListInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestedUserListInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestedUserListInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.IngestedUserListInfo; + + /** + * Creates a plain object from an IngestedUserListInfo message. Also converts values to other types if specified. + * @param message IngestedUserListInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.IngestedUserListInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestedUserListInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestedUserListInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestedUserListInfo { + + /** UploadKeyType enum. */ + enum UploadKeyType { + UPLOAD_KEY_TYPE_UNSPECIFIED = 0, + CONTACT_ID = 1, + MOBILE_ID = 2, + USER_ID = 3, + PAIR_ID = 4, + PSEUDONYMOUS_ID = 5 + } + } + + /** Properties of a ContactIdInfo. */ + interface IContactIdInfo { + + /** ContactIdInfo dataSourceType */ + dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + + /** ContactIdInfo matchRatePercentage */ + matchRatePercentage?: (number|null); + } + + /** Represents a ContactIdInfo. */ + class ContactIdInfo implements IContactIdInfo { + + /** + * Constructs a new ContactIdInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IContactIdInfo); + + /** ContactIdInfo dataSourceType. */ + public dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + + /** ContactIdInfo matchRatePercentage. */ + public matchRatePercentage: number; + + /** + * Creates a new ContactIdInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactIdInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IContactIdInfo): google.ads.datamanager.v1.ContactIdInfo; + + /** + * Encodes the specified ContactIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.ContactIdInfo.verify|verify} messages. + * @param message ContactIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IContactIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContactIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ContactIdInfo.verify|verify} messages. + * @param message ContactIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IContactIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContactIdInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ContactIdInfo; + + /** + * Decodes a ContactIdInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ContactIdInfo; + + /** + * Verifies a ContactIdInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContactIdInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactIdInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ContactIdInfo; + + /** + * Creates a plain object from a ContactIdInfo message. Also converts values to other types if specified. + * @param message ContactIdInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ContactIdInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContactIdInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContactIdInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MobileIdInfo. */ + interface IMobileIdInfo { + + /** MobileIdInfo dataSourceType */ + dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + + /** MobileIdInfo keySpace */ + keySpace?: (google.ads.datamanager.v1.MobileIdInfo.KeySpace|keyof typeof google.ads.datamanager.v1.MobileIdInfo.KeySpace|null); + + /** MobileIdInfo appId */ + appId?: (string|null); + } + + /** Represents a MobileIdInfo. */ + class MobileIdInfo implements IMobileIdInfo { + + /** + * Constructs a new MobileIdInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IMobileIdInfo); + + /** MobileIdInfo dataSourceType. */ + public dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + + /** MobileIdInfo keySpace. */ + public keySpace?: (google.ads.datamanager.v1.MobileIdInfo.KeySpace|keyof typeof google.ads.datamanager.v1.MobileIdInfo.KeySpace|null); + + /** MobileIdInfo appId. */ + public appId?: (string|null); + + /** + * Creates a new MobileIdInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MobileIdInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IMobileIdInfo): google.ads.datamanager.v1.MobileIdInfo; + + /** + * Encodes the specified MobileIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.MobileIdInfo.verify|verify} messages. + * @param message MobileIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IMobileIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MobileIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.MobileIdInfo.verify|verify} messages. + * @param message MobileIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IMobileIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MobileIdInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MobileIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.MobileIdInfo; + + /** + * Decodes a MobileIdInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MobileIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.MobileIdInfo; + + /** + * Verifies a MobileIdInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MobileIdInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MobileIdInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.MobileIdInfo; + + /** + * Creates a plain object from a MobileIdInfo message. Also converts values to other types if specified. + * @param message MobileIdInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.MobileIdInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MobileIdInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MobileIdInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MobileIdInfo { + + /** KeySpace enum. */ + enum KeySpace { + KEY_SPACE_UNSPECIFIED = 0, + IOS = 1, + ANDROID = 2 + } + } + + /** Properties of a UserIdInfo. */ + interface IUserIdInfo { + + /** UserIdInfo dataSourceType */ + dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + } + + /** Represents a UserIdInfo. */ + class UserIdInfo implements IUserIdInfo { + + /** + * Constructs a new UserIdInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserIdInfo); + + /** UserIdInfo dataSourceType. */ + public dataSourceType?: (google.ads.datamanager.v1.DataSourceType|keyof typeof google.ads.datamanager.v1.DataSourceType|null); + + /** + * Creates a new UserIdInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserIdInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserIdInfo): google.ads.datamanager.v1.UserIdInfo; + + /** + * Encodes the specified UserIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.UserIdInfo.verify|verify} messages. + * @param message UserIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserIdInfo.verify|verify} messages. + * @param message UserIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserIdInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserIdInfo; + + /** + * Decodes a UserIdInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserIdInfo; + + /** + * Verifies a UserIdInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserIdInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserIdInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserIdInfo; + + /** + * Creates a plain object from a UserIdInfo message. Also converts values to other types if specified. + * @param message UserIdInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserIdInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserIdInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserIdInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PairIdInfo. */ + interface IPairIdInfo { + + /** PairIdInfo publisherId */ + publisherId?: (number|Long|string|null); + + /** PairIdInfo publisherName */ + publisherName?: (string|null); + + /** PairIdInfo matchRatePercentage */ + matchRatePercentage?: (number|null); + + /** PairIdInfo advertiserIdentifierCount */ + advertiserIdentifierCount?: (number|Long|string|null); + + /** PairIdInfo cleanRoomIdentifier */ + cleanRoomIdentifier?: (string|null); + } + + /** Represents a PairIdInfo. */ + class PairIdInfo implements IPairIdInfo { + + /** + * Constructs a new PairIdInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IPairIdInfo); + + /** PairIdInfo publisherId. */ + public publisherId?: (number|Long|string|null); + + /** PairIdInfo publisherName. */ + public publisherName?: (string|null); + + /** PairIdInfo matchRatePercentage. */ + public matchRatePercentage: number; + + /** PairIdInfo advertiserIdentifierCount. */ + public advertiserIdentifierCount: (number|Long|string); + + /** PairIdInfo cleanRoomIdentifier. */ + public cleanRoomIdentifier?: (string|null); + + /** + * Creates a new PairIdInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PairIdInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IPairIdInfo): google.ads.datamanager.v1.PairIdInfo; + + /** + * Encodes the specified PairIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.PairIdInfo.verify|verify} messages. + * @param message PairIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IPairIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PairIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PairIdInfo.verify|verify} messages. + * @param message PairIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IPairIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PairIdInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PairIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.PairIdInfo; + + /** + * Decodes a PairIdInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PairIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.PairIdInfo; + + /** + * Verifies a PairIdInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PairIdInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PairIdInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.PairIdInfo; + + /** + * Creates a plain object from a PairIdInfo message. Also converts values to other types if specified. + * @param message PairIdInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.PairIdInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PairIdInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PairIdInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartnerAudienceInfo. */ + interface IPartnerAudienceInfo { + + /** PartnerAudienceInfo partnerAudienceSource */ + partnerAudienceSource?: (google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|keyof typeof google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|null); + + /** PartnerAudienceInfo commercePartner */ + commercePartner?: (string|null); + } + + /** Represents a PartnerAudienceInfo. */ + class PartnerAudienceInfo implements IPartnerAudienceInfo { + + /** + * Constructs a new PartnerAudienceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IPartnerAudienceInfo); + + /** PartnerAudienceInfo partnerAudienceSource. */ + public partnerAudienceSource?: (google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|keyof typeof google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|null); + + /** PartnerAudienceInfo commercePartner. */ + public commercePartner?: (string|null); + + /** + * Creates a new PartnerAudienceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PartnerAudienceInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IPartnerAudienceInfo): google.ads.datamanager.v1.PartnerAudienceInfo; + + /** + * Encodes the specified PartnerAudienceInfo message. Does not implicitly {@link google.ads.datamanager.v1.PartnerAudienceInfo.verify|verify} messages. + * @param message PartnerAudienceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IPartnerAudienceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartnerAudienceInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PartnerAudienceInfo.verify|verify} messages. + * @param message PartnerAudienceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IPartnerAudienceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartnerAudienceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartnerAudienceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.PartnerAudienceInfo; + + /** + * Decodes a PartnerAudienceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartnerAudienceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.PartnerAudienceInfo; + + /** + * Verifies a PartnerAudienceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartnerAudienceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartnerAudienceInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.PartnerAudienceInfo; + + /** + * Creates a plain object from a PartnerAudienceInfo message. Also converts values to other types if specified. + * @param message PartnerAudienceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.PartnerAudienceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartnerAudienceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartnerAudienceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartnerAudienceInfo { + + /** PartnerAudienceSource enum. */ + enum PartnerAudienceSource { + PARTNER_AUDIENCE_SOURCE_UNSPECIFIED = 0, + COMMERCE_AUDIENCE = 1, + LINEAR_TV_AUDIENCE = 2, + AGENCY_PROVIDER_AUDIENCE = 3 + } + } + + /** Properties of a PseudonymousIdInfo. */ + interface IPseudonymousIdInfo { + + /** PseudonymousIdInfo syncStatus */ + syncStatus?: (google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|keyof typeof google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|null); + + /** PseudonymousIdInfo billableRecordCount */ + billableRecordCount?: (number|Long|string|null); + } + + /** Represents a PseudonymousIdInfo. */ + class PseudonymousIdInfo implements IPseudonymousIdInfo { + + /** + * Constructs a new PseudonymousIdInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IPseudonymousIdInfo); + + /** PseudonymousIdInfo syncStatus. */ + public syncStatus?: (google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|keyof typeof google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|null); + + /** PseudonymousIdInfo billableRecordCount. */ + public billableRecordCount?: (number|Long|string|null); + + /** + * Creates a new PseudonymousIdInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PseudonymousIdInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IPseudonymousIdInfo): google.ads.datamanager.v1.PseudonymousIdInfo; + + /** + * Encodes the specified PseudonymousIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.PseudonymousIdInfo.verify|verify} messages. + * @param message PseudonymousIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IPseudonymousIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PseudonymousIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PseudonymousIdInfo.verify|verify} messages. + * @param message PseudonymousIdInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IPseudonymousIdInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PseudonymousIdInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PseudonymousIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.PseudonymousIdInfo; + + /** + * Decodes a PseudonymousIdInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PseudonymousIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.PseudonymousIdInfo; + + /** + * Verifies a PseudonymousIdInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PseudonymousIdInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PseudonymousIdInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.PseudonymousIdInfo; + + /** + * Creates a plain object from a PseudonymousIdInfo message. Also converts values to other types if specified. + * @param message PseudonymousIdInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.PseudonymousIdInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PseudonymousIdInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PseudonymousIdInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PseudonymousIdInfo { + + /** SyncStatus enum. */ + enum SyncStatus { + SYNC_STATUS_UNSPECIFIED = 0, + CREATED = 1, + READY_FOR_USE = 2, + FAILED = 3 + } + } + + /** DataSourceType enum. */ + enum DataSourceType { + DATA_SOURCE_TYPE_UNSPECIFIED = 0, + DATA_SOURCE_TYPE_FIRST_PARTY = 1, + DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU = 2, + DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE = 3, + DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA = 4 + } + + /** Properties of a UserListDirectLicense. */ + interface IUserListDirectLicense { + + /** UserListDirectLicense name */ + name?: (string|null); + + /** UserListDirectLicense userListId */ + userListId?: (number|Long|string|null); + + /** UserListDirectLicense userListDisplayName */ + userListDisplayName?: (string|null); + + /** UserListDirectLicense clientAccountType */ + clientAccountType?: (google.ads.datamanager.v1.UserListLicenseClientAccountType|keyof typeof google.ads.datamanager.v1.UserListLicenseClientAccountType|null); + + /** UserListDirectLicense clientAccountId */ + clientAccountId?: (number|Long|string|null); + + /** UserListDirectLicense clientAccountDisplayName */ + clientAccountDisplayName?: (string|null); + + /** UserListDirectLicense status */ + status?: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus|null); + + /** UserListDirectLicense pricing */ + pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListDirectLicense historicalPricings */ + historicalPricings?: (google.ads.datamanager.v1.IUserListLicensePricing[]|null); + + /** UserListDirectLicense metrics */ + metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + } + + /** Represents a UserListDirectLicense. */ + class UserListDirectLicense implements IUserListDirectLicense { + + /** + * Constructs a new UserListDirectLicense. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserListDirectLicense); + + /** UserListDirectLicense name. */ + public name: string; + + /** UserListDirectLicense userListId. */ + public userListId?: (number|Long|string|null); + + /** UserListDirectLicense userListDisplayName. */ + public userListDisplayName: string; + + /** UserListDirectLicense clientAccountType. */ + public clientAccountType?: (google.ads.datamanager.v1.UserListLicenseClientAccountType|keyof typeof google.ads.datamanager.v1.UserListLicenseClientAccountType|null); + + /** UserListDirectLicense clientAccountId. */ + public clientAccountId?: (number|Long|string|null); + + /** UserListDirectLicense clientAccountDisplayName. */ + public clientAccountDisplayName: string; + + /** UserListDirectLicense status. */ + public status?: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus|null); + + /** UserListDirectLicense pricing. */ + public pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListDirectLicense historicalPricings. */ + public historicalPricings: google.ads.datamanager.v1.IUserListLicensePricing[]; + + /** UserListDirectLicense metrics. */ + public metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + + /** + * Creates a new UserListDirectLicense instance using the specified properties. + * @param [properties] Properties to set + * @returns UserListDirectLicense instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserListDirectLicense): google.ads.datamanager.v1.UserListDirectLicense; + + /** + * Encodes the specified UserListDirectLicense message. Does not implicitly {@link google.ads.datamanager.v1.UserListDirectLicense.verify|verify} messages. + * @param message UserListDirectLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserListDirectLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserListDirectLicense message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListDirectLicense.verify|verify} messages. + * @param message UserListDirectLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserListDirectLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserListDirectLicense message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserListDirectLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserListDirectLicense; + + /** + * Decodes a UserListDirectLicense message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserListDirectLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserListDirectLicense; + + /** + * Verifies a UserListDirectLicense message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserListDirectLicense message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserListDirectLicense + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserListDirectLicense; + + /** + * Creates a plain object from a UserListDirectLicense message. Also converts values to other types if specified. + * @param message UserListDirectLicense + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserListDirectLicense, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserListDirectLicense to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserListDirectLicense + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** UserListLicenseClientAccountType enum. */ + enum UserListLicenseClientAccountType { + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN = 0, + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS = 1, + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER = 2, + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER = 3, + USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK = 4 + } + + /** Properties of a UserListLicenseMetrics. */ + interface IUserListLicenseMetrics { + + /** UserListLicenseMetrics clickCount */ + clickCount?: (number|Long|string|null); + + /** UserListLicenseMetrics impressionCount */ + impressionCount?: (number|Long|string|null); + + /** UserListLicenseMetrics revenueUsdMicros */ + revenueUsdMicros?: (number|Long|string|null); + + /** UserListLicenseMetrics startDate */ + startDate?: (number|Long|string|null); + + /** UserListLicenseMetrics endDate */ + endDate?: (number|Long|string|null); + } + + /** Represents a UserListLicenseMetrics. */ + class UserListLicenseMetrics implements IUserListLicenseMetrics { + + /** + * Constructs a new UserListLicenseMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserListLicenseMetrics); + + /** UserListLicenseMetrics clickCount. */ + public clickCount: (number|Long|string); + + /** UserListLicenseMetrics impressionCount. */ + public impressionCount: (number|Long|string); + + /** UserListLicenseMetrics revenueUsdMicros. */ + public revenueUsdMicros: (number|Long|string); + + /** UserListLicenseMetrics startDate. */ + public startDate: (number|Long|string); + + /** UserListLicenseMetrics endDate. */ + public endDate: (number|Long|string); + + /** + * Creates a new UserListLicenseMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns UserListLicenseMetrics instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserListLicenseMetrics): google.ads.datamanager.v1.UserListLicenseMetrics; + + /** + * Encodes the specified UserListLicenseMetrics message. Does not implicitly {@link google.ads.datamanager.v1.UserListLicenseMetrics.verify|verify} messages. + * @param message UserListLicenseMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserListLicenseMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserListLicenseMetrics message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListLicenseMetrics.verify|verify} messages. + * @param message UserListLicenseMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserListLicenseMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserListLicenseMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserListLicenseMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserListLicenseMetrics; + + /** + * Decodes a UserListLicenseMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserListLicenseMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserListLicenseMetrics; + + /** + * Verifies a UserListLicenseMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserListLicenseMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserListLicenseMetrics + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserListLicenseMetrics; + + /** + * Creates a plain object from a UserListLicenseMetrics message. Also converts values to other types if specified. + * @param message UserListLicenseMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserListLicenseMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserListLicenseMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserListLicenseMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserListLicensePricing. */ + interface IUserListLicensePricing { + + /** UserListLicensePricing pricingId */ + pricingId?: (number|Long|string|null); + + /** UserListLicensePricing costMicros */ + costMicros?: (number|Long|string|null); + + /** UserListLicensePricing currencyCode */ + currencyCode?: (string|null); + + /** UserListLicensePricing startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UserListLicensePricing endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** UserListLicensePricing pricingActive */ + pricingActive?: (boolean|null); + + /** UserListLicensePricing buyerApprovalState */ + buyerApprovalState?: (google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState|keyof typeof google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState|null); + + /** UserListLicensePricing costType */ + costType?: (google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|keyof typeof google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|null); + + /** UserListLicensePricing maxCostMicros */ + maxCostMicros?: (number|Long|string|null); + } + + /** Represents a UserListLicensePricing. */ + class UserListLicensePricing implements IUserListLicensePricing { + + /** + * Constructs a new UserListLicensePricing. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserListLicensePricing); + + /** UserListLicensePricing pricingId. */ + public pricingId: (number|Long|string); + + /** UserListLicensePricing costMicros. */ + public costMicros?: (number|Long|string|null); + + /** UserListLicensePricing currencyCode. */ + public currencyCode?: (string|null); + + /** UserListLicensePricing startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UserListLicensePricing endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** UserListLicensePricing pricingActive. */ + public pricingActive: boolean; + + /** UserListLicensePricing buyerApprovalState. */ + public buyerApprovalState: (google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState|keyof typeof google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState); + + /** UserListLicensePricing costType. */ + public costType?: (google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|keyof typeof google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|null); + + /** UserListLicensePricing maxCostMicros. */ + public maxCostMicros?: (number|Long|string|null); + + /** + * Creates a new UserListLicensePricing instance using the specified properties. + * @param [properties] Properties to set + * @returns UserListLicensePricing instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserListLicensePricing): google.ads.datamanager.v1.UserListLicensePricing; + + /** + * Encodes the specified UserListLicensePricing message. Does not implicitly {@link google.ads.datamanager.v1.UserListLicensePricing.verify|verify} messages. + * @param message UserListLicensePricing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserListLicensePricing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserListLicensePricing message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListLicensePricing.verify|verify} messages. + * @param message UserListLicensePricing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserListLicensePricing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserListLicensePricing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserListLicensePricing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserListLicensePricing; + + /** + * Decodes a UserListLicensePricing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserListLicensePricing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserListLicensePricing; + + /** + * Verifies a UserListLicensePricing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserListLicensePricing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserListLicensePricing + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserListLicensePricing; + + /** + * Creates a plain object from a UserListLicensePricing message. Also converts values to other types if specified. + * @param message UserListLicensePricing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserListLicensePricing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserListLicensePricing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserListLicensePricing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UserListLicensePricing { + + /** UserListPricingBuyerApprovalState enum. */ + enum UserListPricingBuyerApprovalState { + USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED = 0, + PENDING = 1, + APPROVED = 2, + REJECTED = 3 + } + + /** UserListPricingCostType enum. */ + enum UserListPricingCostType { + USER_LIST_PRICING_COST_TYPE_UNSPECIFIED = 0, + CPC = 1, + CPM = 2, + MEDIA_SHARE = 3 + } + } + + /** UserListLicenseStatus enum. */ + enum UserListLicenseStatus { + USER_LIST_LICENSE_STATUS_UNSPECIFIED = 0, + USER_LIST_LICENSE_STATUS_ENABLED = 1, + USER_LIST_LICENSE_STATUS_DISABLED = 2 + } + + /** Represents a UserListDirectLicenseService */ + class UserListDirectLicenseService extends $protobuf.rpc.Service { + + /** + * Constructs a new UserListDirectLicenseService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new UserListDirectLicenseService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserListDirectLicenseService; + + /** + * Calls CreateUserListDirectLicense. + * @param request CreateUserListDirectLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListDirectLicense + */ + public createUserListDirectLicense(request: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, callback: google.ads.datamanager.v1.UserListDirectLicenseService.CreateUserListDirectLicenseCallback): void; + + /** + * Calls CreateUserListDirectLicense. + * @param request CreateUserListDirectLicenseRequest message or plain object + * @returns Promise + */ + public createUserListDirectLicense(request: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest): Promise; + + /** + * Calls GetUserListDirectLicense. + * @param request GetUserListDirectLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListDirectLicense + */ + public getUserListDirectLicense(request: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, callback: google.ads.datamanager.v1.UserListDirectLicenseService.GetUserListDirectLicenseCallback): void; + + /** + * Calls GetUserListDirectLicense. + * @param request GetUserListDirectLicenseRequest message or plain object + * @returns Promise + */ + public getUserListDirectLicense(request: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest): Promise; + + /** + * Calls UpdateUserListDirectLicense. + * @param request UpdateUserListDirectLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListDirectLicense + */ + public updateUserListDirectLicense(request: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, callback: google.ads.datamanager.v1.UserListDirectLicenseService.UpdateUserListDirectLicenseCallback): void; + + /** + * Calls UpdateUserListDirectLicense. + * @param request UpdateUserListDirectLicenseRequest message or plain object + * @returns Promise + */ + public updateUserListDirectLicense(request: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest): Promise; + + /** + * Calls ListUserListDirectLicenses. + * @param request ListUserListDirectLicensesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUserListDirectLicensesResponse + */ + public listUserListDirectLicenses(request: google.ads.datamanager.v1.IListUserListDirectLicensesRequest, callback: google.ads.datamanager.v1.UserListDirectLicenseService.ListUserListDirectLicensesCallback): void; + + /** + * Calls ListUserListDirectLicenses. + * @param request ListUserListDirectLicensesRequest message or plain object + * @returns Promise + */ + public listUserListDirectLicenses(request: google.ads.datamanager.v1.IListUserListDirectLicensesRequest): Promise; + } + + namespace UserListDirectLicenseService { + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|createUserListDirectLicense}. + * @param error Error, if any + * @param [response] UserListDirectLicense + */ + type CreateUserListDirectLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListDirectLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|getUserListDirectLicense}. + * @param error Error, if any + * @param [response] UserListDirectLicense + */ + type GetUserListDirectLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListDirectLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|updateUserListDirectLicense}. + * @param error Error, if any + * @param [response] UserListDirectLicense + */ + type UpdateUserListDirectLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListDirectLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|listUserListDirectLicenses}. + * @param error Error, if any + * @param [response] ListUserListDirectLicensesResponse + */ + type ListUserListDirectLicensesCallback = (error: (Error|null), response?: google.ads.datamanager.v1.ListUserListDirectLicensesResponse) => void; + } + + /** Properties of a CreateUserListDirectLicenseRequest. */ + interface ICreateUserListDirectLicenseRequest { + + /** CreateUserListDirectLicenseRequest parent */ + parent?: (string|null); + + /** CreateUserListDirectLicenseRequest userListDirectLicense */ + userListDirectLicense?: (google.ads.datamanager.v1.IUserListDirectLicense|null); + } + + /** Represents a CreateUserListDirectLicenseRequest. */ + class CreateUserListDirectLicenseRequest implements ICreateUserListDirectLicenseRequest { + + /** + * Constructs a new CreateUserListDirectLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest); + + /** CreateUserListDirectLicenseRequest parent. */ + public parent: string; + + /** CreateUserListDirectLicenseRequest userListDirectLicense. */ + public userListDirectLicense?: (google.ads.datamanager.v1.IUserListDirectLicense|null); + + /** + * Creates a new CreateUserListDirectLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserListDirectLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest): google.ads.datamanager.v1.CreateUserListDirectLicenseRequest; + + /** + * Encodes the specified CreateUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListDirectLicenseRequest.verify|verify} messages. + * @param message CreateUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListDirectLicenseRequest.verify|verify} messages. + * @param message CreateUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserListDirectLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.CreateUserListDirectLicenseRequest; + + /** + * Decodes a CreateUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.CreateUserListDirectLicenseRequest; + + /** + * Verifies a CreateUserListDirectLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserListDirectLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.CreateUserListDirectLicenseRequest; + + /** + * Creates a plain object from a CreateUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @param message CreateUserListDirectLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.CreateUserListDirectLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserListDirectLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserListDirectLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUserListDirectLicenseRequest. */ + interface IGetUserListDirectLicenseRequest { + + /** GetUserListDirectLicenseRequest name */ + name?: (string|null); + } + + /** Represents a GetUserListDirectLicenseRequest. */ + class GetUserListDirectLicenseRequest implements IGetUserListDirectLicenseRequest { + + /** + * Constructs a new GetUserListDirectLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest); + + /** GetUserListDirectLicenseRequest name. */ + public name: string; + + /** + * Creates a new GetUserListDirectLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserListDirectLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest): google.ads.datamanager.v1.GetUserListDirectLicenseRequest; + + /** + * Encodes the specified GetUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListDirectLicenseRequest.verify|verify} messages. + * @param message GetUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListDirectLicenseRequest.verify|verify} messages. + * @param message GetUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserListDirectLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.GetUserListDirectLicenseRequest; + + /** + * Decodes a GetUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.GetUserListDirectLicenseRequest; + + /** + * Verifies a GetUserListDirectLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserListDirectLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.GetUserListDirectLicenseRequest; + + /** + * Creates a plain object from a GetUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @param message GetUserListDirectLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.GetUserListDirectLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserListDirectLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserListDirectLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserListDirectLicenseRequest. */ + interface IUpdateUserListDirectLicenseRequest { + + /** UpdateUserListDirectLicenseRequest userListDirectLicense */ + userListDirectLicense?: (google.ads.datamanager.v1.IUserListDirectLicense|null); + + /** UpdateUserListDirectLicenseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateUserListDirectLicenseRequest. */ + class UpdateUserListDirectLicenseRequest implements IUpdateUserListDirectLicenseRequest { + + /** + * Constructs a new UpdateUserListDirectLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest); + + /** UpdateUserListDirectLicenseRequest userListDirectLicense. */ + public userListDirectLicense?: (google.ads.datamanager.v1.IUserListDirectLicense|null); + + /** UpdateUserListDirectLicenseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateUserListDirectLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserListDirectLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest): google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest; + + /** + * Encodes the specified UpdateUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.verify|verify} messages. + * @param message UpdateUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.verify|verify} messages. + * @param message UpdateUserListDirectLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserListDirectLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest; + + /** + * Decodes an UpdateUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest; + + /** + * Verifies an UpdateUserListDirectLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserListDirectLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest; + + /** + * Creates a plain object from an UpdateUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @param message UpdateUserListDirectLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserListDirectLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserListDirectLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListDirectLicensesRequest. */ + interface IListUserListDirectLicensesRequest { + + /** ListUserListDirectLicensesRequest parent */ + parent?: (string|null); + + /** ListUserListDirectLicensesRequest filter */ + filter?: (string|null); + + /** ListUserListDirectLicensesRequest pageSize */ + pageSize?: (number|null); + + /** ListUserListDirectLicensesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUserListDirectLicensesRequest. */ + class ListUserListDirectLicensesRequest implements IListUserListDirectLicensesRequest { + + /** + * Constructs a new ListUserListDirectLicensesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListDirectLicensesRequest); + + /** ListUserListDirectLicensesRequest parent. */ + public parent: string; + + /** ListUserListDirectLicensesRequest filter. */ + public filter: string; + + /** ListUserListDirectLicensesRequest pageSize. */ + public pageSize: number; + + /** ListUserListDirectLicensesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUserListDirectLicensesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListDirectLicensesRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListDirectLicensesRequest): google.ads.datamanager.v1.ListUserListDirectLicensesRequest; + + /** + * Encodes the specified ListUserListDirectLicensesRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesRequest.verify|verify} messages. + * @param message ListUserListDirectLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListDirectLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListDirectLicensesRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesRequest.verify|verify} messages. + * @param message ListUserListDirectLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListDirectLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListDirectLicensesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListDirectLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListDirectLicensesRequest; + + /** + * Decodes a ListUserListDirectLicensesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListDirectLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListDirectLicensesRequest; + + /** + * Verifies a ListUserListDirectLicensesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListDirectLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListDirectLicensesRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListDirectLicensesRequest; + + /** + * Creates a plain object from a ListUserListDirectLicensesRequest message. Also converts values to other types if specified. + * @param message ListUserListDirectLicensesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListDirectLicensesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListDirectLicensesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListDirectLicensesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListDirectLicensesResponse. */ + interface IListUserListDirectLicensesResponse { + + /** ListUserListDirectLicensesResponse userListDirectLicenses */ + userListDirectLicenses?: (google.ads.datamanager.v1.IUserListDirectLicense[]|null); + + /** ListUserListDirectLicensesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListUserListDirectLicensesResponse. */ + class ListUserListDirectLicensesResponse implements IListUserListDirectLicensesResponse { + + /** + * Constructs a new ListUserListDirectLicensesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListDirectLicensesResponse); + + /** ListUserListDirectLicensesResponse userListDirectLicenses. */ + public userListDirectLicenses: google.ads.datamanager.v1.IUserListDirectLicense[]; + + /** ListUserListDirectLicensesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListUserListDirectLicensesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListDirectLicensesResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListDirectLicensesResponse): google.ads.datamanager.v1.ListUserListDirectLicensesResponse; + + /** + * Encodes the specified ListUserListDirectLicensesResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesResponse.verify|verify} messages. + * @param message ListUserListDirectLicensesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListDirectLicensesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListDirectLicensesResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesResponse.verify|verify} messages. + * @param message ListUserListDirectLicensesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListDirectLicensesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListDirectLicensesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListDirectLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListDirectLicensesResponse; + + /** + * Decodes a ListUserListDirectLicensesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListDirectLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListDirectLicensesResponse; + + /** + * Verifies a ListUserListDirectLicensesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListDirectLicensesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListDirectLicensesResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListDirectLicensesResponse; + + /** + * Creates a plain object from a ListUserListDirectLicensesResponse message. Also converts values to other types if specified. + * @param message ListUserListDirectLicensesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListDirectLicensesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListDirectLicensesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListDirectLicensesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserListGlobalLicense. */ + interface IUserListGlobalLicense { + + /** UserListGlobalLicense name */ + name?: (string|null); + + /** UserListGlobalLicense userListId */ + userListId?: (number|Long|string|null); + + /** UserListGlobalLicense userListDisplayName */ + userListDisplayName?: (string|null); + + /** UserListGlobalLicense licenseType */ + licenseType?: (google.ads.datamanager.v1.UserListGlobalLicenseType|keyof typeof google.ads.datamanager.v1.UserListGlobalLicenseType|null); + + /** UserListGlobalLicense status */ + status?: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus|null); + + /** UserListGlobalLicense pricing */ + pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListGlobalLicense historicalPricings */ + historicalPricings?: (google.ads.datamanager.v1.IUserListLicensePricing[]|null); + + /** UserListGlobalLicense metrics */ + metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + } + + /** Represents a UserListGlobalLicense. */ + class UserListGlobalLicense implements IUserListGlobalLicense { + + /** + * Constructs a new UserListGlobalLicense. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserListGlobalLicense); + + /** UserListGlobalLicense name. */ + public name: string; + + /** UserListGlobalLicense userListId. */ + public userListId?: (number|Long|string|null); + + /** UserListGlobalLicense userListDisplayName. */ + public userListDisplayName: string; + + /** UserListGlobalLicense licenseType. */ + public licenseType?: (google.ads.datamanager.v1.UserListGlobalLicenseType|keyof typeof google.ads.datamanager.v1.UserListGlobalLicenseType|null); + + /** UserListGlobalLicense status. */ + public status?: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus|null); + + /** UserListGlobalLicense pricing. */ + public pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListGlobalLicense historicalPricings. */ + public historicalPricings: google.ads.datamanager.v1.IUserListLicensePricing[]; + + /** UserListGlobalLicense metrics. */ + public metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + + /** + * Creates a new UserListGlobalLicense instance using the specified properties. + * @param [properties] Properties to set + * @returns UserListGlobalLicense instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserListGlobalLicense): google.ads.datamanager.v1.UserListGlobalLicense; + + /** + * Encodes the specified UserListGlobalLicense message. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicense.verify|verify} messages. + * @param message UserListGlobalLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserListGlobalLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserListGlobalLicense message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicense.verify|verify} messages. + * @param message UserListGlobalLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserListGlobalLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserListGlobalLicense message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserListGlobalLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserListGlobalLicense; + + /** + * Decodes a UserListGlobalLicense message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserListGlobalLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserListGlobalLicense; + + /** + * Verifies a UserListGlobalLicense message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserListGlobalLicense message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserListGlobalLicense + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserListGlobalLicense; + + /** + * Creates a plain object from a UserListGlobalLicense message. Also converts values to other types if specified. + * @param message UserListGlobalLicense + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserListGlobalLicense, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserListGlobalLicense to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserListGlobalLicense + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserListGlobalLicenseCustomerInfo. */ + interface IUserListGlobalLicenseCustomerInfo { + + /** UserListGlobalLicenseCustomerInfo name */ + name?: (string|null); + + /** UserListGlobalLicenseCustomerInfo userListId */ + userListId?: (number|Long|string|null); + + /** UserListGlobalLicenseCustomerInfo userListDisplayName */ + userListDisplayName?: (string|null); + + /** UserListGlobalLicenseCustomerInfo licenseType */ + licenseType?: (google.ads.datamanager.v1.UserListGlobalLicenseType|keyof typeof google.ads.datamanager.v1.UserListGlobalLicenseType|null); + + /** UserListGlobalLicenseCustomerInfo status */ + status?: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus|null); + + /** UserListGlobalLicenseCustomerInfo pricing */ + pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListGlobalLicenseCustomerInfo clientAccountType */ + clientAccountType?: (google.ads.datamanager.v1.UserListLicenseClientAccountType|keyof typeof google.ads.datamanager.v1.UserListLicenseClientAccountType|null); + + /** UserListGlobalLicenseCustomerInfo clientAccountId */ + clientAccountId?: (number|Long|string|null); + + /** UserListGlobalLicenseCustomerInfo clientAccountDisplayName */ + clientAccountDisplayName?: (string|null); + + /** UserListGlobalLicenseCustomerInfo historicalPricings */ + historicalPricings?: (google.ads.datamanager.v1.IUserListLicensePricing[]|null); + + /** UserListGlobalLicenseCustomerInfo metrics */ + metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + } + + /** Represents a UserListGlobalLicenseCustomerInfo. */ + class UserListGlobalLicenseCustomerInfo implements IUserListGlobalLicenseCustomerInfo { + + /** + * Constructs a new UserListGlobalLicenseCustomerInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo); + + /** UserListGlobalLicenseCustomerInfo name. */ + public name: string; + + /** UserListGlobalLicenseCustomerInfo userListId. */ + public userListId: (number|Long|string); + + /** UserListGlobalLicenseCustomerInfo userListDisplayName. */ + public userListDisplayName: string; + + /** UserListGlobalLicenseCustomerInfo licenseType. */ + public licenseType: (google.ads.datamanager.v1.UserListGlobalLicenseType|keyof typeof google.ads.datamanager.v1.UserListGlobalLicenseType); + + /** UserListGlobalLicenseCustomerInfo status. */ + public status: (google.ads.datamanager.v1.UserListLicenseStatus|keyof typeof google.ads.datamanager.v1.UserListLicenseStatus); + + /** UserListGlobalLicenseCustomerInfo pricing. */ + public pricing?: (google.ads.datamanager.v1.IUserListLicensePricing|null); + + /** UserListGlobalLicenseCustomerInfo clientAccountType. */ + public clientAccountType: (google.ads.datamanager.v1.UserListLicenseClientAccountType|keyof typeof google.ads.datamanager.v1.UserListLicenseClientAccountType); + + /** UserListGlobalLicenseCustomerInfo clientAccountId. */ + public clientAccountId: (number|Long|string); + + /** UserListGlobalLicenseCustomerInfo clientAccountDisplayName. */ + public clientAccountDisplayName: string; + + /** UserListGlobalLicenseCustomerInfo historicalPricings. */ + public historicalPricings: google.ads.datamanager.v1.IUserListLicensePricing[]; + + /** UserListGlobalLicenseCustomerInfo metrics. */ + public metrics?: (google.ads.datamanager.v1.IUserListLicenseMetrics|null); + + /** + * Creates a new UserListGlobalLicenseCustomerInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserListGlobalLicenseCustomerInfo instance + */ + public static create(properties?: google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo): google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo; + + /** + * Encodes the specified UserListGlobalLicenseCustomerInfo message. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.verify|verify} messages. + * @param message UserListGlobalLicenseCustomerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserListGlobalLicenseCustomerInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.verify|verify} messages. + * @param message UserListGlobalLicenseCustomerInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserListGlobalLicenseCustomerInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserListGlobalLicenseCustomerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo; + + /** + * Decodes a UserListGlobalLicenseCustomerInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserListGlobalLicenseCustomerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo; + + /** + * Verifies a UserListGlobalLicenseCustomerInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserListGlobalLicenseCustomerInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserListGlobalLicenseCustomerInfo + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo; + + /** + * Creates a plain object from a UserListGlobalLicenseCustomerInfo message. Also converts values to other types if specified. + * @param message UserListGlobalLicenseCustomerInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserListGlobalLicenseCustomerInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserListGlobalLicenseCustomerInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** UserListGlobalLicenseType enum. */ + enum UserListGlobalLicenseType { + USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED = 0, + USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER = 1, + USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE = 2, + USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE = 3 + } + + /** Represents a UserListGlobalLicenseService */ + class UserListGlobalLicenseService extends $protobuf.rpc.Service { + + /** + * Constructs a new UserListGlobalLicenseService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new UserListGlobalLicenseService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserListGlobalLicenseService; + + /** + * Calls CreateUserListGlobalLicense. + * @param request CreateUserListGlobalLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListGlobalLicense + */ + public createUserListGlobalLicense(request: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, callback: google.ads.datamanager.v1.UserListGlobalLicenseService.CreateUserListGlobalLicenseCallback): void; + + /** + * Calls CreateUserListGlobalLicense. + * @param request CreateUserListGlobalLicenseRequest message or plain object + * @returns Promise + */ + public createUserListGlobalLicense(request: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest): Promise; + + /** + * Calls UpdateUserListGlobalLicense. + * @param request UpdateUserListGlobalLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListGlobalLicense + */ + public updateUserListGlobalLicense(request: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, callback: google.ads.datamanager.v1.UserListGlobalLicenseService.UpdateUserListGlobalLicenseCallback): void; + + /** + * Calls UpdateUserListGlobalLicense. + * @param request UpdateUserListGlobalLicenseRequest message or plain object + * @returns Promise + */ + public updateUserListGlobalLicense(request: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest): Promise; + + /** + * Calls GetUserListGlobalLicense. + * @param request GetUserListGlobalLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserListGlobalLicense + */ + public getUserListGlobalLicense(request: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, callback: google.ads.datamanager.v1.UserListGlobalLicenseService.GetUserListGlobalLicenseCallback): void; + + /** + * Calls GetUserListGlobalLicense. + * @param request GetUserListGlobalLicenseRequest message or plain object + * @returns Promise + */ + public getUserListGlobalLicense(request: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest): Promise; + + /** + * Calls ListUserListGlobalLicenses. + * @param request ListUserListGlobalLicensesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUserListGlobalLicensesResponse + */ + public listUserListGlobalLicenses(request: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, callback: google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicensesCallback): void; + + /** + * Calls ListUserListGlobalLicenses. + * @param request ListUserListGlobalLicensesRequest message or plain object + * @returns Promise + */ + public listUserListGlobalLicenses(request: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest): Promise; + + /** + * Calls ListUserListGlobalLicenseCustomerInfos. + * @param request ListUserListGlobalLicenseCustomerInfosRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUserListGlobalLicenseCustomerInfosResponse + */ + public listUserListGlobalLicenseCustomerInfos(request: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, callback: google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenseCustomerInfosCallback): void; + + /** + * Calls ListUserListGlobalLicenseCustomerInfos. + * @param request ListUserListGlobalLicenseCustomerInfosRequest message or plain object + * @returns Promise + */ + public listUserListGlobalLicenseCustomerInfos(request: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest): Promise; + } + + namespace UserListGlobalLicenseService { + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|createUserListGlobalLicense}. + * @param error Error, if any + * @param [response] UserListGlobalLicense + */ + type CreateUserListGlobalLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListGlobalLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|updateUserListGlobalLicense}. + * @param error Error, if any + * @param [response] UserListGlobalLicense + */ + type UpdateUserListGlobalLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListGlobalLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|getUserListGlobalLicense}. + * @param error Error, if any + * @param [response] UserListGlobalLicense + */ + type GetUserListGlobalLicenseCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserListGlobalLicense) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|listUserListGlobalLicenses}. + * @param error Error, if any + * @param [response] ListUserListGlobalLicensesResponse + */ + type ListUserListGlobalLicensesCallback = (error: (Error|null), response?: google.ads.datamanager.v1.ListUserListGlobalLicensesResponse) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|listUserListGlobalLicenseCustomerInfos}. + * @param error Error, if any + * @param [response] ListUserListGlobalLicenseCustomerInfosResponse + */ + type ListUserListGlobalLicenseCustomerInfosCallback = (error: (Error|null), response?: google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse) => void; + } + + /** Properties of a CreateUserListGlobalLicenseRequest. */ + interface ICreateUserListGlobalLicenseRequest { + + /** CreateUserListGlobalLicenseRequest parent */ + parent?: (string|null); + + /** CreateUserListGlobalLicenseRequest userListGlobalLicense */ + userListGlobalLicense?: (google.ads.datamanager.v1.IUserListGlobalLicense|null); + } + + /** Represents a CreateUserListGlobalLicenseRequest. */ + class CreateUserListGlobalLicenseRequest implements ICreateUserListGlobalLicenseRequest { + + /** + * Constructs a new CreateUserListGlobalLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest); + + /** CreateUserListGlobalLicenseRequest parent. */ + public parent: string; + + /** CreateUserListGlobalLicenseRequest userListGlobalLicense. */ + public userListGlobalLicense?: (google.ads.datamanager.v1.IUserListGlobalLicense|null); + + /** + * Creates a new CreateUserListGlobalLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserListGlobalLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest): google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest; + + /** + * Encodes the specified CreateUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest.verify|verify} messages. + * @param message CreateUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest.verify|verify} messages. + * @param message CreateUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserListGlobalLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest; + + /** + * Decodes a CreateUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest; + + /** + * Verifies a CreateUserListGlobalLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserListGlobalLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest; + + /** + * Creates a plain object from a CreateUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @param message CreateUserListGlobalLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserListGlobalLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserListGlobalLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserListGlobalLicenseRequest. */ + interface IUpdateUserListGlobalLicenseRequest { + + /** UpdateUserListGlobalLicenseRequest userListGlobalLicense */ + userListGlobalLicense?: (google.ads.datamanager.v1.IUserListGlobalLicense|null); + + /** UpdateUserListGlobalLicenseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateUserListGlobalLicenseRequest. */ + class UpdateUserListGlobalLicenseRequest implements IUpdateUserListGlobalLicenseRequest { + + /** + * Constructs a new UpdateUserListGlobalLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest); + + /** UpdateUserListGlobalLicenseRequest userListGlobalLicense. */ + public userListGlobalLicense?: (google.ads.datamanager.v1.IUserListGlobalLicense|null); + + /** UpdateUserListGlobalLicenseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateUserListGlobalLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserListGlobalLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest): google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest; + + /** + * Encodes the specified UpdateUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.verify|verify} messages. + * @param message UpdateUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.verify|verify} messages. + * @param message UpdateUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserListGlobalLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest; + + /** + * Decodes an UpdateUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest; + + /** + * Verifies an UpdateUserListGlobalLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserListGlobalLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest; + + /** + * Creates a plain object from an UpdateUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @param message UpdateUserListGlobalLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserListGlobalLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserListGlobalLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUserListGlobalLicenseRequest. */ + interface IGetUserListGlobalLicenseRequest { + + /** GetUserListGlobalLicenseRequest name */ + name?: (string|null); + } + + /** Represents a GetUserListGlobalLicenseRequest. */ + class GetUserListGlobalLicenseRequest implements IGetUserListGlobalLicenseRequest { + + /** + * Constructs a new GetUserListGlobalLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest); + + /** GetUserListGlobalLicenseRequest name. */ + public name: string; + + /** + * Creates a new GetUserListGlobalLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserListGlobalLicenseRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest): google.ads.datamanager.v1.GetUserListGlobalLicenseRequest; + + /** + * Encodes the specified GetUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListGlobalLicenseRequest.verify|verify} messages. + * @param message GetUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListGlobalLicenseRequest.verify|verify} messages. + * @param message GetUserListGlobalLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserListGlobalLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.GetUserListGlobalLicenseRequest; + + /** + * Decodes a GetUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.GetUserListGlobalLicenseRequest; + + /** + * Verifies a GetUserListGlobalLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserListGlobalLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.GetUserListGlobalLicenseRequest; + + /** + * Creates a plain object from a GetUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @param message GetUserListGlobalLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.GetUserListGlobalLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserListGlobalLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserListGlobalLicenseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListGlobalLicensesRequest. */ + interface IListUserListGlobalLicensesRequest { + + /** ListUserListGlobalLicensesRequest parent */ + parent?: (string|null); + + /** ListUserListGlobalLicensesRequest filter */ + filter?: (string|null); + + /** ListUserListGlobalLicensesRequest pageSize */ + pageSize?: (number|null); + + /** ListUserListGlobalLicensesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUserListGlobalLicensesRequest. */ + class ListUserListGlobalLicensesRequest implements IListUserListGlobalLicensesRequest { + + /** + * Constructs a new ListUserListGlobalLicensesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest); + + /** ListUserListGlobalLicensesRequest parent. */ + public parent: string; + + /** ListUserListGlobalLicensesRequest filter. */ + public filter: string; + + /** ListUserListGlobalLicensesRequest pageSize. */ + public pageSize: number; + + /** ListUserListGlobalLicensesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUserListGlobalLicensesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListGlobalLicensesRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest): google.ads.datamanager.v1.ListUserListGlobalLicensesRequest; + + /** + * Encodes the specified ListUserListGlobalLicensesRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesRequest.verify|verify} messages. + * @param message ListUserListGlobalLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListGlobalLicensesRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesRequest.verify|verify} messages. + * @param message ListUserListGlobalLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListGlobalLicensesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListGlobalLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListGlobalLicensesRequest; + + /** + * Decodes a ListUserListGlobalLicensesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListGlobalLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListGlobalLicensesRequest; + + /** + * Verifies a ListUserListGlobalLicensesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListGlobalLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListGlobalLicensesRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListGlobalLicensesRequest; + + /** + * Creates a plain object from a ListUserListGlobalLicensesRequest message. Also converts values to other types if specified. + * @param message ListUserListGlobalLicensesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListGlobalLicensesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListGlobalLicensesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListGlobalLicensesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListGlobalLicensesResponse. */ + interface IListUserListGlobalLicensesResponse { + + /** ListUserListGlobalLicensesResponse userListGlobalLicenses */ + userListGlobalLicenses?: (google.ads.datamanager.v1.IUserListGlobalLicense[]|null); + + /** ListUserListGlobalLicensesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListUserListGlobalLicensesResponse. */ + class ListUserListGlobalLicensesResponse implements IListUserListGlobalLicensesResponse { + + /** + * Constructs a new ListUserListGlobalLicensesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListGlobalLicensesResponse); + + /** ListUserListGlobalLicensesResponse userListGlobalLicenses. */ + public userListGlobalLicenses: google.ads.datamanager.v1.IUserListGlobalLicense[]; + + /** ListUserListGlobalLicensesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListUserListGlobalLicensesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListGlobalLicensesResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListGlobalLicensesResponse): google.ads.datamanager.v1.ListUserListGlobalLicensesResponse; + + /** + * Encodes the specified ListUserListGlobalLicensesResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.verify|verify} messages. + * @param message ListUserListGlobalLicensesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListGlobalLicensesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListGlobalLicensesResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.verify|verify} messages. + * @param message ListUserListGlobalLicensesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListGlobalLicensesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListGlobalLicensesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListGlobalLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListGlobalLicensesResponse; + + /** + * Decodes a ListUserListGlobalLicensesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListGlobalLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListGlobalLicensesResponse; + + /** + * Verifies a ListUserListGlobalLicensesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListGlobalLicensesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListGlobalLicensesResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListGlobalLicensesResponse; + + /** + * Creates a plain object from a ListUserListGlobalLicensesResponse message. Also converts values to other types if specified. + * @param message ListUserListGlobalLicensesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListGlobalLicensesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListGlobalLicensesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListGlobalLicensesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListGlobalLicenseCustomerInfosRequest. */ + interface IListUserListGlobalLicenseCustomerInfosRequest { + + /** ListUserListGlobalLicenseCustomerInfosRequest parent */ + parent?: (string|null); + + /** ListUserListGlobalLicenseCustomerInfosRequest filter */ + filter?: (string|null); + + /** ListUserListGlobalLicenseCustomerInfosRequest pageSize */ + pageSize?: (number|null); + + /** ListUserListGlobalLicenseCustomerInfosRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUserListGlobalLicenseCustomerInfosRequest. */ + class ListUserListGlobalLicenseCustomerInfosRequest implements IListUserListGlobalLicenseCustomerInfosRequest { + + /** + * Constructs a new ListUserListGlobalLicenseCustomerInfosRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest); + + /** ListUserListGlobalLicenseCustomerInfosRequest parent. */ + public parent: string; + + /** ListUserListGlobalLicenseCustomerInfosRequest filter. */ + public filter: string; + + /** ListUserListGlobalLicenseCustomerInfosRequest pageSize. */ + public pageSize: number; + + /** ListUserListGlobalLicenseCustomerInfosRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUserListGlobalLicenseCustomerInfosRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListGlobalLicenseCustomerInfosRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest.verify|verify} messages. + * @param message ListUserListGlobalLicenseCustomerInfosRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest.verify|verify} messages. + * @param message ListUserListGlobalLicenseCustomerInfosRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListGlobalLicenseCustomerInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListGlobalLicenseCustomerInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest; + + /** + * Verifies a ListUserListGlobalLicenseCustomerInfosRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListGlobalLicenseCustomerInfosRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListGlobalLicenseCustomerInfosRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest; + + /** + * Creates a plain object from a ListUserListGlobalLicenseCustomerInfosRequest message. Also converts values to other types if specified. + * @param message ListUserListGlobalLicenseCustomerInfosRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListGlobalLicenseCustomerInfosRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListGlobalLicenseCustomerInfosRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListGlobalLicenseCustomerInfosResponse. */ + interface IListUserListGlobalLicenseCustomerInfosResponse { + + /** ListUserListGlobalLicenseCustomerInfosResponse userListGlobalLicenseCustomerInfos */ + userListGlobalLicenseCustomerInfos?: (google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[]|null); + + /** ListUserListGlobalLicenseCustomerInfosResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListUserListGlobalLicenseCustomerInfosResponse. */ + class ListUserListGlobalLicenseCustomerInfosResponse implements IListUserListGlobalLicenseCustomerInfosResponse { + + /** + * Constructs a new ListUserListGlobalLicenseCustomerInfosResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse); + + /** ListUserListGlobalLicenseCustomerInfosResponse userListGlobalLicenseCustomerInfos. */ + public userListGlobalLicenseCustomerInfos: google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[]; + + /** ListUserListGlobalLicenseCustomerInfosResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListUserListGlobalLicenseCustomerInfosResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListGlobalLicenseCustomerInfosResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.verify|verify} messages. + * @param message ListUserListGlobalLicenseCustomerInfosResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.verify|verify} messages. + * @param message ListUserListGlobalLicenseCustomerInfosResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListGlobalLicenseCustomerInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListGlobalLicenseCustomerInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse; + + /** + * Verifies a ListUserListGlobalLicenseCustomerInfosResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListGlobalLicenseCustomerInfosResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListGlobalLicenseCustomerInfosResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse; + + /** + * Creates a plain object from a ListUserListGlobalLicenseCustomerInfosResponse message. Also converts values to other types if specified. + * @param message ListUserListGlobalLicenseCustomerInfosResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListGlobalLicenseCustomerInfosResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListGlobalLicenseCustomerInfosResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a UserListService */ + class UserListService extends $protobuf.rpc.Service { + + /** + * Constructs a new UserListService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new UserListService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UserListService; + + /** + * Calls GetUserList. + * @param request GetUserListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserList + */ + public getUserList(request: google.ads.datamanager.v1.IGetUserListRequest, callback: google.ads.datamanager.v1.UserListService.GetUserListCallback): void; + + /** + * Calls GetUserList. + * @param request GetUserListRequest message or plain object + * @returns Promise + */ + public getUserList(request: google.ads.datamanager.v1.IGetUserListRequest): Promise; + + /** + * Calls ListUserLists. + * @param request ListUserListsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUserListsResponse + */ + public listUserLists(request: google.ads.datamanager.v1.IListUserListsRequest, callback: google.ads.datamanager.v1.UserListService.ListUserListsCallback): void; + + /** + * Calls ListUserLists. + * @param request ListUserListsRequest message or plain object + * @returns Promise + */ + public listUserLists(request: google.ads.datamanager.v1.IListUserListsRequest): Promise; + + /** + * Calls CreateUserList. + * @param request CreateUserListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserList + */ + public createUserList(request: google.ads.datamanager.v1.ICreateUserListRequest, callback: google.ads.datamanager.v1.UserListService.CreateUserListCallback): void; + + /** + * Calls CreateUserList. + * @param request CreateUserListRequest message or plain object + * @returns Promise + */ + public createUserList(request: google.ads.datamanager.v1.ICreateUserListRequest): Promise; + + /** + * Calls UpdateUserList. + * @param request UpdateUserListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserList + */ + public updateUserList(request: google.ads.datamanager.v1.IUpdateUserListRequest, callback: google.ads.datamanager.v1.UserListService.UpdateUserListCallback): void; + + /** + * Calls UpdateUserList. + * @param request UpdateUserListRequest message or plain object + * @returns Promise + */ + public updateUserList(request: google.ads.datamanager.v1.IUpdateUserListRequest): Promise; + + /** + * Calls DeleteUserList. + * @param request DeleteUserListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUserList(request: google.ads.datamanager.v1.IDeleteUserListRequest, callback: google.ads.datamanager.v1.UserListService.DeleteUserListCallback): void; + + /** + * Calls DeleteUserList. + * @param request DeleteUserListRequest message or plain object + * @returns Promise + */ + public deleteUserList(request: google.ads.datamanager.v1.IDeleteUserListRequest): Promise; + } + + namespace UserListService { + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|getUserList}. + * @param error Error, if any + * @param [response] UserList + */ + type GetUserListCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserList) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|listUserLists}. + * @param error Error, if any + * @param [response] ListUserListsResponse + */ + type ListUserListsCallback = (error: (Error|null), response?: google.ads.datamanager.v1.ListUserListsResponse) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|createUserList}. + * @param error Error, if any + * @param [response] UserList + */ + type CreateUserListCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserList) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|updateUserList}. + * @param error Error, if any + * @param [response] UserList + */ + type UpdateUserListCallback = (error: (Error|null), response?: google.ads.datamanager.v1.UserList) => void; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|deleteUserList}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserListCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetUserListRequest. */ + interface IGetUserListRequest { + + /** GetUserListRequest name */ + name?: (string|null); + } + + /** Represents a GetUserListRequest. */ + class GetUserListRequest implements IGetUserListRequest { + + /** + * Constructs a new GetUserListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IGetUserListRequest); + + /** GetUserListRequest name. */ + public name: string; + + /** + * Creates a new GetUserListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserListRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.IGetUserListRequest): google.ads.datamanager.v1.GetUserListRequest; + + /** + * Encodes the specified GetUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListRequest.verify|verify} messages. + * @param message GetUserListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IGetUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListRequest.verify|verify} messages. + * @param message GetUserListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IGetUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.GetUserListRequest; + + /** + * Decodes a GetUserListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.GetUserListRequest; + + /** + * Verifies a GetUserListRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserListRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.GetUserListRequest; + + /** + * Creates a plain object from a GetUserListRequest message. Also converts values to other types if specified. + * @param message GetUserListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.GetUserListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ErrorInfo to JSON. + * Converts this GetUserListRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ErrorInfo + * Gets the default type url for GetUserListRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ErrorCount. */ - interface IErrorCount { + /** Properties of a ListUserListsRequest. */ + interface IListUserListsRequest { - /** ErrorCount recordCount */ - recordCount?: (number|Long|string|null); + /** ListUserListsRequest parent */ + parent?: (string|null); - /** ErrorCount reason */ - reason?: (google.ads.datamanager.v1.ProcessingErrorReason|keyof typeof google.ads.datamanager.v1.ProcessingErrorReason|null); + /** ListUserListsRequest pageSize */ + pageSize?: (number|null); + + /** ListUserListsRequest pageToken */ + pageToken?: (string|null); + + /** ListUserListsRequest filter */ + filter?: (string|null); } - /** Represents an ErrorCount. */ - class ErrorCount implements IErrorCount { + /** Represents a ListUserListsRequest. */ + class ListUserListsRequest implements IListUserListsRequest { /** - * Constructs a new ErrorCount. + * Constructs a new ListUserListsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ads.datamanager.v1.IErrorCount); + constructor(properties?: google.ads.datamanager.v1.IListUserListsRequest); - /** ErrorCount recordCount. */ - public recordCount: (number|Long|string); + /** ListUserListsRequest parent. */ + public parent: string; - /** ErrorCount reason. */ - public reason: (google.ads.datamanager.v1.ProcessingErrorReason|keyof typeof google.ads.datamanager.v1.ProcessingErrorReason); + /** ListUserListsRequest pageSize. */ + public pageSize: number; + + /** ListUserListsRequest pageToken. */ + public pageToken: string; + + /** ListUserListsRequest filter. */ + public filter: string; /** - * Creates a new ErrorCount instance using the specified properties. + * Creates a new ListUserListsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ErrorCount instance + * @returns ListUserListsRequest instance */ - public static create(properties?: google.ads.datamanager.v1.IErrorCount): google.ads.datamanager.v1.ErrorCount; + public static create(properties?: google.ads.datamanager.v1.IListUserListsRequest): google.ads.datamanager.v1.ListUserListsRequest; /** - * Encodes the specified ErrorCount message. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. - * @param message ErrorCount message or plain object to encode + * Encodes the specified ListUserListsRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsRequest.verify|verify} messages. + * @param message ListUserListsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ads.datamanager.v1.IErrorCount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ads.datamanager.v1.IListUserListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ErrorCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. - * @param message ErrorCount message or plain object to encode + * Encodes the specified ListUserListsRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsRequest.verify|verify} messages. + * @param message ListUserListsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ads.datamanager.v1.IErrorCount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ErrorCount message from the specified reader or buffer. + * Decodes a ListUserListsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ErrorCount + * @returns ListUserListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListsRequest; + + /** + * Decodes a ListUserListsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListsRequest; + + /** + * Verifies a ListUserListsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListsRequest; + + /** + * Creates a plain object from a ListUserListsRequest message. Also converts values to other types if specified. + * @param message ListUserListsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUserListsResponse. */ + interface IListUserListsResponse { + + /** ListUserListsResponse userLists */ + userLists?: (google.ads.datamanager.v1.IUserList[]|null); + + /** ListUserListsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListUserListsResponse. */ + class ListUserListsResponse implements IListUserListsResponse { + + /** + * Constructs a new ListUserListsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.IListUserListsResponse); + + /** ListUserListsResponse userLists. */ + public userLists: google.ads.datamanager.v1.IUserList[]; + + /** ListUserListsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListUserListsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUserListsResponse instance + */ + public static create(properties?: google.ads.datamanager.v1.IListUserListsResponse): google.ads.datamanager.v1.ListUserListsResponse; + + /** + * Encodes the specified ListUserListsResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsResponse.verify|verify} messages. + * @param message ListUserListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.IListUserListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUserListsResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsResponse.verify|verify} messages. + * @param message ListUserListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.IListUserListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUserListsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUserListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ListUserListsResponse; + + /** + * Decodes a ListUserListsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUserListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ListUserListsResponse; + + /** + * Verifies a ListUserListsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUserListsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUserListsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ListUserListsResponse; + + /** + * Creates a plain object from a ListUserListsResponse message. Also converts values to other types if specified. + * @param message ListUserListsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ads.datamanager.v1.ListUserListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUserListsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUserListsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserListRequest. */ + interface ICreateUserListRequest { + + /** CreateUserListRequest parent */ + parent?: (string|null); + + /** CreateUserListRequest userList */ + userList?: (google.ads.datamanager.v1.IUserList|null); + + /** CreateUserListRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateUserListRequest. */ + class CreateUserListRequest implements ICreateUserListRequest { + + /** + * Constructs a new CreateUserListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ads.datamanager.v1.ICreateUserListRequest); + + /** CreateUserListRequest parent. */ + public parent: string; + + /** CreateUserListRequest userList. */ + public userList?: (google.ads.datamanager.v1.IUserList|null); + + /** CreateUserListRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateUserListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserListRequest instance + */ + public static create(properties?: google.ads.datamanager.v1.ICreateUserListRequest): google.ads.datamanager.v1.CreateUserListRequest; + + /** + * Encodes the specified CreateUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListRequest.verify|verify} messages. + * @param message CreateUserListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ads.datamanager.v1.ICreateUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListRequest.verify|verify} messages. + * @param message CreateUserListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ads.datamanager.v1.ICreateUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.ErrorCount; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.CreateUserListRequest; /** - * Decodes an ErrorCount message from the specified reader or buffer, length delimited. + * Decodes a CreateUserListRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ErrorCount + * @returns CreateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.ErrorCount; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.CreateUserListRequest; /** - * Verifies an ErrorCount message. + * Verifies a CreateUserListRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ErrorCount message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserListRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ErrorCount + * @returns CreateUserListRequest */ - public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.ErrorCount; + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.CreateUserListRequest; /** - * Creates a plain object from an ErrorCount message. Also converts values to other types if specified. - * @param message ErrorCount + * Creates a plain object from a CreateUserListRequest message. Also converts values to other types if specified. + * @param message CreateUserListRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ads.datamanager.v1.ErrorCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ads.datamanager.v1.CreateUserListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ErrorCount to JSON. + * Converts this CreateUserListRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ErrorCount + * Gets the default type url for CreateUserListRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WarningInfo. */ - interface IWarningInfo { + /** Properties of an UpdateUserListRequest. */ + interface IUpdateUserListRequest { - /** WarningInfo warningCounts */ - warningCounts?: (google.ads.datamanager.v1.IWarningCount[]|null); + /** UpdateUserListRequest userList */ + userList?: (google.ads.datamanager.v1.IUserList|null); + + /** UpdateUserListRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserListRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a WarningInfo. */ - class WarningInfo implements IWarningInfo { + /** Represents an UpdateUserListRequest. */ + class UpdateUserListRequest implements IUpdateUserListRequest { /** - * Constructs a new WarningInfo. + * Constructs a new UpdateUserListRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ads.datamanager.v1.IWarningInfo); + constructor(properties?: google.ads.datamanager.v1.IUpdateUserListRequest); - /** WarningInfo warningCounts. */ - public warningCounts: google.ads.datamanager.v1.IWarningCount[]; + /** UpdateUserListRequest userList. */ + public userList?: (google.ads.datamanager.v1.IUserList|null); + + /** UpdateUserListRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserListRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new WarningInfo instance using the specified properties. + * Creates a new UpdateUserListRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WarningInfo instance + * @returns UpdateUserListRequest instance */ - public static create(properties?: google.ads.datamanager.v1.IWarningInfo): google.ads.datamanager.v1.WarningInfo; + public static create(properties?: google.ads.datamanager.v1.IUpdateUserListRequest): google.ads.datamanager.v1.UpdateUserListRequest; /** - * Encodes the specified WarningInfo message. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. - * @param message WarningInfo message or plain object to encode + * Encodes the specified UpdateUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListRequest.verify|verify} messages. + * @param message UpdateUserListRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ads.datamanager.v1.IWarningInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ads.datamanager.v1.IUpdateUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WarningInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. - * @param message WarningInfo message or plain object to encode + * Encodes the specified UpdateUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListRequest.verify|verify} messages. + * @param message UpdateUserListRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ads.datamanager.v1.IWarningInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ads.datamanager.v1.IUpdateUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WarningInfo message from the specified reader or buffer. + * Decodes an UpdateUserListRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WarningInfo + * @returns UpdateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.WarningInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.UpdateUserListRequest; /** - * Decodes a WarningInfo message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserListRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WarningInfo + * @returns UpdateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.WarningInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.UpdateUserListRequest; /** - * Verifies a WarningInfo message. + * Verifies an UpdateUserListRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WarningInfo message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserListRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WarningInfo + * @returns UpdateUserListRequest */ - public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.WarningInfo; + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.UpdateUserListRequest; /** - * Creates a plain object from a WarningInfo message. Also converts values to other types if specified. - * @param message WarningInfo + * Creates a plain object from an UpdateUserListRequest message. Also converts values to other types if specified. + * @param message UpdateUserListRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ads.datamanager.v1.WarningInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ads.datamanager.v1.UpdateUserListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WarningInfo to JSON. + * Converts this UpdateUserListRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WarningInfo + * Gets the default type url for UpdateUserListRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WarningCount. */ - interface IWarningCount { + /** Properties of a DeleteUserListRequest. */ + interface IDeleteUserListRequest { - /** WarningCount recordCount */ - recordCount?: (number|Long|string|null); + /** DeleteUserListRequest name */ + name?: (string|null); - /** WarningCount reason */ - reason?: (google.ads.datamanager.v1.ProcessingWarningReason|keyof typeof google.ads.datamanager.v1.ProcessingWarningReason|null); + /** DeleteUserListRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a WarningCount. */ - class WarningCount implements IWarningCount { + /** Represents a DeleteUserListRequest. */ + class DeleteUserListRequest implements IDeleteUserListRequest { /** - * Constructs a new WarningCount. + * Constructs a new DeleteUserListRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ads.datamanager.v1.IWarningCount); + constructor(properties?: google.ads.datamanager.v1.IDeleteUserListRequest); - /** WarningCount recordCount. */ - public recordCount: (number|Long|string); + /** DeleteUserListRequest name. */ + public name: string; - /** WarningCount reason. */ - public reason: (google.ads.datamanager.v1.ProcessingWarningReason|keyof typeof google.ads.datamanager.v1.ProcessingWarningReason); + /** DeleteUserListRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new WarningCount instance using the specified properties. + * Creates a new DeleteUserListRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WarningCount instance + * @returns DeleteUserListRequest instance */ - public static create(properties?: google.ads.datamanager.v1.IWarningCount): google.ads.datamanager.v1.WarningCount; + public static create(properties?: google.ads.datamanager.v1.IDeleteUserListRequest): google.ads.datamanager.v1.DeleteUserListRequest; /** - * Encodes the specified WarningCount message. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. - * @param message WarningCount message or plain object to encode + * Encodes the specified DeleteUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.DeleteUserListRequest.verify|verify} messages. + * @param message DeleteUserListRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ads.datamanager.v1.IWarningCount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ads.datamanager.v1.IDeleteUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WarningCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. - * @param message WarningCount message or plain object to encode + * Encodes the specified DeleteUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.DeleteUserListRequest.verify|verify} messages. + * @param message DeleteUserListRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ads.datamanager.v1.IWarningCount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ads.datamanager.v1.IDeleteUserListRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WarningCount message from the specified reader or buffer. + * Decodes a DeleteUserListRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WarningCount + * @returns DeleteUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.WarningCount; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.DeleteUserListRequest; /** - * Decodes a WarningCount message from the specified reader or buffer, length delimited. + * Decodes a DeleteUserListRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WarningCount + * @returns DeleteUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.WarningCount; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.DeleteUserListRequest; /** - * Verifies a WarningCount message. + * Verifies a DeleteUserListRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WarningCount message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteUserListRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WarningCount + * @returns DeleteUserListRequest */ - public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.WarningCount; + public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.DeleteUserListRequest; /** - * Creates a plain object from a WarningCount message. Also converts values to other types if specified. - * @param message WarningCount + * Creates a plain object from a DeleteUserListRequest message. Also converts values to other types if specified. + * @param message DeleteUserListRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ads.datamanager.v1.WarningCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ads.datamanager.v1.DeleteUserListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WarningCount to JSON. + * Converts this DeleteUserListRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WarningCount + * Gets the default type url for DeleteUserListRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } + } + } - /** ProcessingErrorReason enum. */ - enum ProcessingErrorReason { - PROCESSING_ERROR_REASON_UNSPECIFIED = 0, - PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE = 1, - PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED = 2, - PROCESSING_ERROR_REASON_EVENT_TOO_OLD = 3, - PROCESSING_ERROR_REASON_DENIED_CONSENT = 4, - PROCESSING_ERROR_REASON_NO_CONSENT = 5, - PROCESSING_ERROR_REASON_UNKNOWN_CONSENT = 6, - PROCESSING_ERROR_REASON_DUPLICATE_GCLID = 7, - PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID = 8, - PROCESSING_ERROR_REASON_INVALID_GBRAID = 9, - PROCESSING_ERROR_REASON_INVALID_GCLID = 10, - PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID = 11, - PROCESSING_ERROR_REASON_INVALID_WBRAID = 12, - PROCESSING_ERROR_REASON_INTERNAL_ERROR = 13, - PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED = 14, - PROCESSING_ERROR_REASON_INVALID_EVENT = 15, - PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS = 16, - PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS = 17, - PROCESSING_ERROR_REASON_INVALID_FORMAT = 18, - PROCESSING_ERROR_REASON_DECRYPTION_ERROR = 19, - PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR = 20, - PROCESSING_ERROR_REASON_INVALID_WIP = 21, - PROCESSING_ERROR_REASON_INVALID_KEK = 22, - PROCESSING_ERROR_REASON_WIP_AUTH_FAILED = 23, - PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED = 24, - PROCESSING_ERROR_REASON_AWS_AUTH_FAILED = 27, - PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR = 25, - PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER = 26 - } + /** Namespace api. */ + namespace api { - /** ProcessingWarningReason enum. */ - enum ProcessingWarningReason { - PROCESSING_WARNING_REASON_UNSPECIFIED = 0, - PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED = 1, - PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR = 2, - PROCESSING_WARNING_REASON_DECRYPTION_ERROR = 3, - PROCESSING_WARNING_REASON_WIP_AUTH_FAILED = 4, - PROCESSING_WARNING_REASON_INVALID_WIP = 5, - PROCESSING_WARNING_REASON_INVALID_KEK = 6, - PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR = 7, - PROCESSING_WARNING_REASON_INTERNAL_ERROR = 8, - PROCESSING_WARNING_REASON_AWS_AUTH_FAILED = 9 - } + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } - /** Properties of a TermsOfService. */ - interface ITermsOfService { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** TermsOfService customerMatchTermsOfServiceStatus */ - customerMatchTermsOfServiceStatus?: (google.ads.datamanager.v1.TermsOfServiceStatus|keyof typeof google.ads.datamanager.v1.TermsOfServiceStatus|null); - } + /** ResourceDescriptor type */ + type?: (string|null); - /** Represents a TermsOfService. */ - class TermsOfService implements ITermsOfService { + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** - * Constructs a new TermsOfService. - * @param [properties] Properties to set - */ - constructor(properties?: google.ads.datamanager.v1.ITermsOfService); + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** TermsOfService customerMatchTermsOfServiceStatus. */ - public customerMatchTermsOfServiceStatus: (google.ads.datamanager.v1.TermsOfServiceStatus|keyof typeof google.ads.datamanager.v1.TermsOfServiceStatus); + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - /** - * Creates a new TermsOfService instance using the specified properties. - * @param [properties] Properties to set - * @returns TermsOfService instance - */ - public static create(properties?: google.ads.datamanager.v1.ITermsOfService): google.ads.datamanager.v1.TermsOfService; + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); - /** - * Encodes the specified TermsOfService message. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. - * @param message TermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.ads.datamanager.v1.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + /** ResourceReference type. */ + public type: string; - /** - * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. - * @param message TermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.ads.datamanager.v1.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + /** ResourceReference childType. */ + public childType: string; - /** - * Decodes a TermsOfService message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ads.datamanager.v1.TermsOfService; + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - /** - * Decodes a TermsOfService message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ads.datamanager.v1.TermsOfService; + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a TermsOfService message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TermsOfService - */ - public static fromObject(object: { [k: string]: any }): google.ads.datamanager.v1.TermsOfService; + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - /** - * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. - * @param message TermsOfService - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.ads.datamanager.v1.TermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - /** - * Converts this TermsOfService to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Gets the default type url for TermsOfService - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - /** TermsOfServiceStatus enum. */ - enum TermsOfServiceStatus { - TERMS_OF_SERVICE_STATUS_UNSPECIFIED = 0, - ACCEPTED = 1, - REJECTED = 2 - } - } - } - } + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Namespace api. */ - namespace api { + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Http. */ @@ -9103,6 +15634,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -9288,6 +15822,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -9442,6 +15979,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ @@ -11583,5 +18123,193 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } diff --git a/packages/google-ads-datamanager/protos/protos.js b/packages/google-ads-datamanager/protos/protos.js index e5e9838bf9c..0dfae3dfbd5 100644 --- a/packages/google-ads-datamanager/protos/protos.js +++ b/packages/google-ads-datamanager/protos/protos.js @@ -66,6 +66,32 @@ */ var v1 = {}; + /** + * AgeRange enum. + * @name google.ads.datamanager.v1.AgeRange + * @enum {number} + * @property {number} AGE_RANGE_UNSPECIFIED=0 AGE_RANGE_UNSPECIFIED value + * @property {number} AGE_RANGE_UNKNOWN=1 AGE_RANGE_UNKNOWN value + * @property {number} AGE_RANGE_18_24=2 AGE_RANGE_18_24 value + * @property {number} AGE_RANGE_25_34=3 AGE_RANGE_25_34 value + * @property {number} AGE_RANGE_35_44=4 AGE_RANGE_35_44 value + * @property {number} AGE_RANGE_45_54=5 AGE_RANGE_45_54 value + * @property {number} AGE_RANGE_55_64=6 AGE_RANGE_55_64 value + * @property {number} AGE_RANGE_65_UP=7 AGE_RANGE_65_UP value + */ + v1.AgeRange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGE_RANGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGE_RANGE_UNKNOWN"] = 1; + values[valuesById[2] = "AGE_RANGE_18_24"] = 2; + values[valuesById[3] = "AGE_RANGE_25_34"] = 3; + values[valuesById[4] = "AGE_RANGE_35_44"] = 4; + values[valuesById[5] = "AGE_RANGE_45_54"] = 5; + values[valuesById[6] = "AGE_RANGE_55_64"] = 6; + values[valuesById[7] = "AGE_RANGE_65_UP"] = 7; + return values; + })(); + v1.AudienceMember = (function() { /** @@ -76,6 +102,8 @@ * @property {google.ads.datamanager.v1.IUserData|null} [userData] AudienceMember userData * @property {google.ads.datamanager.v1.IPairData|null} [pairData] AudienceMember pairData * @property {google.ads.datamanager.v1.IMobileData|null} [mobileData] AudienceMember mobileData + * @property {google.ads.datamanager.v1.IUserIdData|null} [userIdData] AudienceMember userIdData + * @property {google.ads.datamanager.v1.IPpidData|null} [ppidData] AudienceMember ppidData * @property {google.ads.datamanager.v1.IConsent|null} [consent] AudienceMember consent */ @@ -127,6 +155,22 @@ */ AudienceMember.prototype.mobileData = null; + /** + * AudienceMember userIdData. + * @member {google.ads.datamanager.v1.IUserIdData|null|undefined} userIdData + * @memberof google.ads.datamanager.v1.AudienceMember + * @instance + */ + AudienceMember.prototype.userIdData = null; + + /** + * AudienceMember ppidData. + * @member {google.ads.datamanager.v1.IPpidData|null|undefined} ppidData + * @memberof google.ads.datamanager.v1.AudienceMember + * @instance + */ + AudienceMember.prototype.ppidData = null; + /** * AudienceMember consent. * @member {google.ads.datamanager.v1.IConsent|null|undefined} consent @@ -140,12 +184,12 @@ /** * AudienceMember data. - * @member {"userData"|"pairData"|"mobileData"|undefined} data + * @member {"userData"|"pairData"|"mobileData"|"userIdData"|"ppidData"|undefined} data * @memberof google.ads.datamanager.v1.AudienceMember * @instance */ Object.defineProperty(AudienceMember.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["userData", "pairData", "mobileData"]), + get: $util.oneOfGetter($oneOfFields = ["userData", "pairData", "mobileData", "userIdData", "ppidData"]), set: $util.oneOfSetter($oneOfFields) }); @@ -184,6 +228,10 @@ $root.google.ads.datamanager.v1.PairData.encode(message.pairData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.mobileData != null && Object.hasOwnProperty.call(message, "mobileData")) $root.google.ads.datamanager.v1.MobileData.encode(message.mobileData, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.userIdData != null && Object.hasOwnProperty.call(message, "userIdData")) + $root.google.ads.datamanager.v1.UserIdData.encode(message.userIdData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ppidData != null && Object.hasOwnProperty.call(message, "ppidData")) + $root.google.ads.datamanager.v1.PpidData.encode(message.ppidData, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -238,6 +286,14 @@ message.mobileData = $root.google.ads.datamanager.v1.MobileData.decode(reader, reader.uint32()); break; } + case 6: { + message.userIdData = $root.google.ads.datamanager.v1.UserIdData.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ppidData = $root.google.ads.datamanager.v1.PpidData.decode(reader, reader.uint32()); + break; + } case 3: { message.consent = $root.google.ads.datamanager.v1.Consent.decode(reader, reader.uint32()); break; @@ -313,6 +369,26 @@ return "mobileData." + error; } } + if (message.userIdData != null && message.hasOwnProperty("userIdData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ads.datamanager.v1.UserIdData.verify(message.userIdData); + if (error) + return "userIdData." + error; + } + } + if (message.ppidData != null && message.hasOwnProperty("ppidData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ads.datamanager.v1.PpidData.verify(message.ppidData); + if (error) + return "ppidData." + error; + } + } if (message.consent != null && message.hasOwnProperty("consent")) { var error = $root.google.ads.datamanager.v1.Consent.verify(message.consent); if (error) @@ -355,6 +431,16 @@ throw TypeError(".google.ads.datamanager.v1.AudienceMember.mobileData: object expected"); message.mobileData = $root.google.ads.datamanager.v1.MobileData.fromObject(object.mobileData); } + if (object.userIdData != null) { + if (typeof object.userIdData !== "object") + throw TypeError(".google.ads.datamanager.v1.AudienceMember.userIdData: object expected"); + message.userIdData = $root.google.ads.datamanager.v1.UserIdData.fromObject(object.userIdData); + } + if (object.ppidData != null) { + if (typeof object.ppidData !== "object") + throw TypeError(".google.ads.datamanager.v1.AudienceMember.ppidData: object expected"); + message.ppidData = $root.google.ads.datamanager.v1.PpidData.fromObject(object.ppidData); + } if (object.consent != null) { if (typeof object.consent !== "object") throw TypeError(".google.ads.datamanager.v1.AudienceMember.consent: object expected"); @@ -402,6 +488,16 @@ if (options.oneofs) object.data = "mobileData"; } + if (message.userIdData != null && message.hasOwnProperty("userIdData")) { + object.userIdData = $root.google.ads.datamanager.v1.UserIdData.toObject(message.userIdData, options); + if (options.oneofs) + object.data = "userIdData"; + } + if (message.ppidData != null && message.hasOwnProperty("ppidData")) { + object.ppidData = $root.google.ads.datamanager.v1.PpidData.toObject(message.ppidData, options); + if (options.oneofs) + object.data = "ppidData"; + } return object; }; @@ -876,6 +972,432 @@ return MobileData; })(); + v1.UserIdData = (function() { + + /** + * Properties of a UserIdData. + * @memberof google.ads.datamanager.v1 + * @interface IUserIdData + * @property {string|null} [userId] UserIdData userId + */ + + /** + * Constructs a new UserIdData. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserIdData. + * @implements IUserIdData + * @constructor + * @param {google.ads.datamanager.v1.IUserIdData=} [properties] Properties to set + */ + function UserIdData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserIdData userId. + * @member {string} userId + * @memberof google.ads.datamanager.v1.UserIdData + * @instance + */ + UserIdData.prototype.userId = ""; + + /** + * Creates a new UserIdData instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {google.ads.datamanager.v1.IUserIdData=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserIdData} UserIdData instance + */ + UserIdData.create = function create(properties) { + return new UserIdData(properties); + }; + + /** + * Encodes the specified UserIdData message. Does not implicitly {@link google.ads.datamanager.v1.UserIdData.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {google.ads.datamanager.v1.IUserIdData} message UserIdData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserIdData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); + return writer; + }; + + /** + * Encodes the specified UserIdData message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserIdData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {google.ads.datamanager.v1.IUserIdData} message UserIdData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserIdData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserIdData message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserIdData} UserIdData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserIdData.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserIdData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserIdData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserIdData} UserIdData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserIdData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserIdData message. + * @function verify + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserIdData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + return null; + }; + + /** + * Creates a UserIdData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserIdData} UserIdData + */ + UserIdData.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserIdData) + return object; + var message = new $root.google.ads.datamanager.v1.UserIdData(); + if (object.userId != null) + message.userId = String(object.userId); + return message; + }; + + /** + * Creates a plain object from a UserIdData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {google.ads.datamanager.v1.UserIdData} message UserIdData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserIdData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userId = ""; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + return object; + }; + + /** + * Converts this UserIdData to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserIdData + * @instance + * @returns {Object.} JSON object + */ + UserIdData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserIdData + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserIdData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserIdData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserIdData"; + }; + + return UserIdData; + })(); + + v1.PpidData = (function() { + + /** + * Properties of a PpidData. + * @memberof google.ads.datamanager.v1 + * @interface IPpidData + * @property {Array.|null} [ppids] PpidData ppids + */ + + /** + * Constructs a new PpidData. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PpidData. + * @implements IPpidData + * @constructor + * @param {google.ads.datamanager.v1.IPpidData=} [properties] Properties to set + */ + function PpidData(properties) { + this.ppids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PpidData ppids. + * @member {Array.} ppids + * @memberof google.ads.datamanager.v1.PpidData + * @instance + */ + PpidData.prototype.ppids = $util.emptyArray; + + /** + * Creates a new PpidData instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {google.ads.datamanager.v1.IPpidData=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.PpidData} PpidData instance + */ + PpidData.create = function create(properties) { + return new PpidData(properties); + }; + + /** + * Encodes the specified PpidData message. Does not implicitly {@link google.ads.datamanager.v1.PpidData.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {google.ads.datamanager.v1.IPpidData} message PpidData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PpidData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ppids != null && message.ppids.length) + for (var i = 0; i < message.ppids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ppids[i]); + return writer; + }; + + /** + * Encodes the specified PpidData message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PpidData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {google.ads.datamanager.v1.IPpidData} message PpidData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PpidData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PpidData message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.PpidData} PpidData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PpidData.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.PpidData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ppids && message.ppids.length)) + message.ppids = []; + message.ppids.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PpidData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.PpidData} PpidData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PpidData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PpidData message. + * @function verify + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PpidData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ppids != null && message.hasOwnProperty("ppids")) { + if (!Array.isArray(message.ppids)) + return "ppids: array expected"; + for (var i = 0; i < message.ppids.length; ++i) + if (!$util.isString(message.ppids[i])) + return "ppids: string[] expected"; + } + return null; + }; + + /** + * Creates a PpidData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.PpidData} PpidData + */ + PpidData.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.PpidData) + return object; + var message = new $root.google.ads.datamanager.v1.PpidData(); + if (object.ppids) { + if (!Array.isArray(object.ppids)) + throw TypeError(".google.ads.datamanager.v1.PpidData.ppids: array expected"); + message.ppids = []; + for (var i = 0; i < object.ppids.length; ++i) + message.ppids[i] = String(object.ppids[i]); + } + return message; + }; + + /** + * Creates a plain object from a PpidData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {google.ads.datamanager.v1.PpidData} message PpidData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PpidData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ppids = []; + if (message.ppids && message.ppids.length) { + object.ppids = []; + for (var j = 0; j < message.ppids.length; ++j) + object.ppids[j] = message.ppids[j]; + } + return object; + }; + + /** + * Converts this PpidData to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.PpidData + * @instance + * @returns {Object.} JSON object + */ + PpidData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PpidData + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.PpidData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PpidData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.PpidData"; + }; + + return PpidData; + })(); + v1.Consent = (function() { /** @@ -3340,6 +3862,7 @@ case 3: case 4: case 5: + case 6: break; } return null; @@ -3418,6 +3941,10 @@ case 5: message.accountType = 5; break; + case "GOOGLE_AD_MANAGER_AUDIENCE_LINK": + case 6: + message.accountType = 6; + break; } return message; }; @@ -3485,6 +4012,7 @@ * @property {number} DISPLAY_VIDEO_ADVERTISER=3 DISPLAY_VIDEO_ADVERTISER value * @property {number} DATA_PARTNER=4 DATA_PARTNER value * @property {number} GOOGLE_ANALYTICS_PROPERTY=5 GOOGLE_ANALYTICS_PROPERTY value + * @property {number} GOOGLE_AD_MANAGER_AUDIENCE_LINK=6 GOOGLE_AD_MANAGER_AUDIENCE_LINK value */ ProductAccount.AccountType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3494,6 +4022,7 @@ values[valuesById[3] = "DISPLAY_VIDEO_ADVERTISER"] = 3; values[valuesById[4] = "DATA_PARTNER"] = 4; values[valuesById[5] = "GOOGLE_ANALYTICS_PROPERTY"] = 5; + values[valuesById[6] = "GOOGLE_AD_MANAGER_AUDIENCE_LINK"] = 6; return values; })(); @@ -4685,6 +5214,53 @@ * @property {number} MULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT=49 MULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT value * @property {number} FIELD_VALUE_TOO_LONG=50 FIELD_VALUE_TOO_LONG value * @property {number} TOO_MANY_ELEMENTS=51 TOO_MANY_ELEMENTS value + * @property {number} ALREADY_EXISTS=52 ALREADY_EXISTS value + * @property {number} IMMUTABLE_FIELD_FOR_UPDATE=53 IMMUTABLE_FIELD_FOR_UPDATE value + * @property {number} INVALID_RESOURCE_NAME=54 INVALID_RESOURCE_NAME value + * @property {number} INVALID_FILTER=55 INVALID_FILTER value + * @property {number} INVALID_UPDATE_MASK=56 INVALID_UPDATE_MASK value + * @property {number} INVALID_PAGE_TOKEN=57 INVALID_PAGE_TOKEN value + * @property {number} CANNOT_UPDATE_DISABLED_LICENSE=58 CANNOT_UPDATE_DISABLED_LICENSE value + * @property {number} CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST=59 CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST value + * @property {number} INSUFFICIENT_COST=60 INSUFFICIENT_COST value + * @property {number} CANNOT_DISABLE_LICENSE=61 CANNOT_DISABLE_LICENSE value + * @property {number} INVALID_CLIENT_ACCOUNT_ID=62 INVALID_CLIENT_ACCOUNT_ID value + * @property {number} PRICING_ONLY_ZERO_COST_ALLOWED=63 PRICING_ONLY_ZERO_COST_ALLOWED value + * @property {number} PRICE_TOO_HIGH=64 PRICE_TOO_HIGH value + * @property {number} CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE=65 CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE value + * @property {number} INVALID_PRICING_END_DATE=66 INVALID_PRICING_END_DATE value + * @property {number} CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT=67 CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT value + * @property {number} MISMATCHED_ACCOUNT_TYPE=68 MISMATCHED_ACCOUNT_TYPE value + * @property {number} MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE=69 MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE value + * @property {number} MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER=70 MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER value + * @property {number} INVALID_MEDIA_SHARE_COST=71 INVALID_MEDIA_SHARE_COST value + * @property {number} INVALID_COST_TYPE=72 INVALID_COST_TYPE value + * @property {number} MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST=73 MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST value + * @property {number} MAX_COST_NOT_ALLOWED=74 MAX_COST_NOT_ALLOWED value + * @property {number} COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED=75 COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED value + * @property {number} INVALID_DESCRIPTION=76 INVALID_DESCRIPTION value + * @property {number} INVALID_DISPLAY_NAME=77 INVALID_DISPLAY_NAME value + * @property {number} DISPLAY_NAME_ALREADY_USED=78 DISPLAY_NAME_ALREADY_USED value + * @property {number} OWNERSHIP_REQUIRED_FOR_UPDATE=79 OWNERSHIP_REQUIRED_FOR_UPDATE value + * @property {number} USER_LIST_MUTATION_NOT_SUPPORTED=80 USER_LIST_MUTATION_NOT_SUPPORTED value + * @property {number} SENSITIVE_USER_LIST_IMMUTABLE=81 SENSITIVE_USER_LIST_IMMUTABLE value + * @property {number} BILLABLE_RECORD_COUNT_IMMUTABLE=82 BILLABLE_RECORD_COUNT_IMMUTABLE value + * @property {number} USER_LIST_NAME_RESERVED=83 USER_LIST_NAME_RESERVED value + * @property {number} ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA=84 ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA value + * @property {number} UNSUPPORTED_PARTNER_AUDIENCE_SOURCE=85 UNSUPPORTED_PARTNER_AUDIENCE_SOURCE value + * @property {number} COMMERCE_PARTNER_NOT_ALLOWED=86 COMMERCE_PARTNER_NOT_ALLOWED value + * @property {number} UNSUPPORTED_PARTNER_AUDIENCE_INFO=87 UNSUPPORTED_PARTNER_AUDIENCE_INFO value + * @property {number} PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED=88 PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED value + * @property {number} DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA=89 DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA value + * @property {number} ADVERTISER_TOS_NOT_ACCEPTED=90 ADVERTISER_TOS_NOT_ACCEPTED value + * @property {number} ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA=91 ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA value + * @property {number} USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT=92 USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT value + * @property {number} INVALID_COMMERCE_PARTNER=93 INVALID_COMMERCE_PARTNER value + * @property {number} CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE=94 CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE value + * @property {number} UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES=95 UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES value + * @property {number} UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG=96 UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG value + * @property {number} UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE=97 UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE value + * @property {number} UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK=98 UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK value */ v1.ErrorReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -4740,6 +5316,53 @@ values[valuesById[49] = "MULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT"] = 49; values[valuesById[50] = "FIELD_VALUE_TOO_LONG"] = 50; values[valuesById[51] = "TOO_MANY_ELEMENTS"] = 51; + values[valuesById[52] = "ALREADY_EXISTS"] = 52; + values[valuesById[53] = "IMMUTABLE_FIELD_FOR_UPDATE"] = 53; + values[valuesById[54] = "INVALID_RESOURCE_NAME"] = 54; + values[valuesById[55] = "INVALID_FILTER"] = 55; + values[valuesById[56] = "INVALID_UPDATE_MASK"] = 56; + values[valuesById[57] = "INVALID_PAGE_TOKEN"] = 57; + values[valuesById[58] = "CANNOT_UPDATE_DISABLED_LICENSE"] = 58; + values[valuesById[59] = "CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST"] = 59; + values[valuesById[60] = "INSUFFICIENT_COST"] = 60; + values[valuesById[61] = "CANNOT_DISABLE_LICENSE"] = 61; + values[valuesById[62] = "INVALID_CLIENT_ACCOUNT_ID"] = 62; + values[valuesById[63] = "PRICING_ONLY_ZERO_COST_ALLOWED"] = 63; + values[valuesById[64] = "PRICE_TOO_HIGH"] = 64; + values[valuesById[65] = "CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE"] = 65; + values[valuesById[66] = "INVALID_PRICING_END_DATE"] = 66; + values[valuesById[67] = "CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT"] = 67; + values[valuesById[68] = "MISMATCHED_ACCOUNT_TYPE"] = 68; + values[valuesById[69] = "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE"] = 69; + values[valuesById[70] = "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER"] = 70; + values[valuesById[71] = "INVALID_MEDIA_SHARE_COST"] = 71; + values[valuesById[72] = "INVALID_COST_TYPE"] = 72; + values[valuesById[73] = "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST"] = 73; + values[valuesById[74] = "MAX_COST_NOT_ALLOWED"] = 74; + values[valuesById[75] = "COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED"] = 75; + values[valuesById[76] = "INVALID_DESCRIPTION"] = 76; + values[valuesById[77] = "INVALID_DISPLAY_NAME"] = 77; + values[valuesById[78] = "DISPLAY_NAME_ALREADY_USED"] = 78; + values[valuesById[79] = "OWNERSHIP_REQUIRED_FOR_UPDATE"] = 79; + values[valuesById[80] = "USER_LIST_MUTATION_NOT_SUPPORTED"] = 80; + values[valuesById[81] = "SENSITIVE_USER_LIST_IMMUTABLE"] = 81; + values[valuesById[82] = "BILLABLE_RECORD_COUNT_IMMUTABLE"] = 82; + values[valuesById[83] = "USER_LIST_NAME_RESERVED"] = 83; + values[valuesById[84] = "ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA"] = 84; + values[valuesById[85] = "UNSUPPORTED_PARTNER_AUDIENCE_SOURCE"] = 85; + values[valuesById[86] = "COMMERCE_PARTNER_NOT_ALLOWED"] = 86; + values[valuesById[87] = "UNSUPPORTED_PARTNER_AUDIENCE_INFO"] = 87; + values[valuesById[88] = "PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED"] = 88; + values[valuesById[89] = "DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA"] = 89; + values[valuesById[90] = "ADVERTISER_TOS_NOT_ACCEPTED"] = 90; + values[valuesById[91] = "ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA"] = 91; + values[valuesById[92] = "USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT"] = 92; + values[valuesById[93] = "INVALID_COMMERCE_PARTNER"] = 93; + values[valuesById[94] = "CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE"] = 94; + values[valuesById[95] = "UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES"] = 95; + values[valuesById[96] = "UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG"] = 96; + values[valuesById[97] = "UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE"] = 97; + values[valuesById[98] = "UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK"] = 98; return values; })(); @@ -4855,11 +5478,11 @@ /** * Event conversionValue. - * @member {number} conversionValue + * @member {number|null|undefined} conversionValue * @memberof google.ads.datamanager.v1.Event * @instance */ - Event.prototype.conversionValue = 0; + Event.prototype.conversionValue = null; /** * Event eventSource. @@ -4941,6 +5564,15 @@ */ Event.prototype.additionalEventParameters = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Event.prototype, "_conversionValue", { + get: $util.oneOfGetter($oneOfFields = ["conversionValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Event instance using the specified properties. * @function create @@ -5162,6 +5794,7 @@ Event.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.destinationReferences != null && message.hasOwnProperty("destinationReferences")) { if (!Array.isArray(message.destinationReferences)) return "destinationReferences: array expected"; @@ -5200,9 +5833,11 @@ if (message.currency != null && message.hasOwnProperty("currency")) if (!$util.isString(message.currency)) return "currency: string expected"; - if (message.conversionValue != null && message.hasOwnProperty("conversionValue")) + if (message.conversionValue != null && message.hasOwnProperty("conversionValue")) { + properties._conversionValue = 1; if (typeof message.conversionValue !== "number") return "conversionValue: number expected"; + } if (message.eventSource != null && message.hasOwnProperty("eventSource")) switch (message.eventSource) { default: @@ -5432,7 +6067,6 @@ object.consent = null; object.adIdentifiers = null; object.currency = ""; - object.conversionValue = 0; object.eventSource = options.enums === String ? "EVENT_SOURCE_UNSPECIFIED" : 0; object.eventDeviceInfo = null; object.cartData = null; @@ -5460,8 +6094,11 @@ object.adIdentifiers = $root.google.ads.datamanager.v1.AdIdentifiers.toObject(message.adIdentifiers, options); if (message.currency != null && message.hasOwnProperty("currency")) object.currency = message.currency; - if (message.conversionValue != null && message.hasOwnProperty("conversionValue")) + if (message.conversionValue != null && message.hasOwnProperty("conversionValue")) { object.conversionValue = options.json && !isFinite(message.conversionValue) ? String(message.conversionValue) : message.conversionValue; + if (options.oneofs) + object._conversionValue = "conversionValue"; + } if (message.eventSource != null && message.hasOwnProperty("eventSource")) object.eventSource = options.enums === String ? $root.google.ads.datamanager.v1.EventSource[message.eventSource] === undefined ? message.eventSource : $root.google.ads.datamanager.v1.EventSource[message.eventSource] : message.eventSource; if (message.eventDeviceInfo != null && message.hasOwnProperty("eventDeviceInfo")) @@ -7172,6 +7809,24 @@ return values; })(); + /** + * Gender enum. + * @name google.ads.datamanager.v1.Gender + * @enum {number} + * @property {number} GENDER_UNSPECIFIED=0 GENDER_UNSPECIFIED value + * @property {number} GENDER_UNKNOWN=1 GENDER_UNKNOWN value + * @property {number} GENDER_MALE=2 GENDER_MALE value + * @property {number} GENDER_FEMALE=3 GENDER_FEMALE value + */ + v1.Gender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "GENDER_UNKNOWN"] = 1; + values[valuesById[2] = "GENDER_MALE"] = 2; + values[valuesById[3] = "GENDER_FEMALE"] = 3; + return values; + })(); + v1.IngestionService = (function() { /** @@ -10066,6 +10721,8 @@ * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserDataStatus|null} [userDataIngestionStatus] IngestAudienceMembersStatus userDataIngestionStatus * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestMobileDataStatus|null} [mobileDataIngestionStatus] IngestAudienceMembersStatus mobileDataIngestionStatus * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPairDataStatus|null} [pairDataIngestionStatus] IngestAudienceMembersStatus pairDataIngestionStatus + * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus|null} [userIdDataIngestionStatus] IngestAudienceMembersStatus userIdDataIngestionStatus + * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus|null} [ppidDataIngestionStatus] IngestAudienceMembersStatus ppidDataIngestionStatus */ /** @@ -10107,17 +10764,33 @@ */ IngestAudienceMembersStatus.prototype.pairDataIngestionStatus = null; + /** + * IngestAudienceMembersStatus userIdDataIngestionStatus. + * @member {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus|null|undefined} userIdDataIngestionStatus + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus + * @instance + */ + IngestAudienceMembersStatus.prototype.userIdDataIngestionStatus = null; + + /** + * IngestAudienceMembersStatus ppidDataIngestionStatus. + * @member {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus|null|undefined} ppidDataIngestionStatus + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus + * @instance + */ + IngestAudienceMembersStatus.prototype.ppidDataIngestionStatus = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * IngestAudienceMembersStatus status. - * @member {"userDataIngestionStatus"|"mobileDataIngestionStatus"|"pairDataIngestionStatus"|undefined} status + * @member {"userDataIngestionStatus"|"mobileDataIngestionStatus"|"pairDataIngestionStatus"|"userIdDataIngestionStatus"|"ppidDataIngestionStatus"|undefined} status * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus * @instance */ Object.defineProperty(IngestAudienceMembersStatus.prototype, "status", { - get: $util.oneOfGetter($oneOfFields = ["userDataIngestionStatus", "mobileDataIngestionStatus", "pairDataIngestionStatus"]), + get: $util.oneOfGetter($oneOfFields = ["userDataIngestionStatus", "mobileDataIngestionStatus", "pairDataIngestionStatus", "userIdDataIngestionStatus", "ppidDataIngestionStatus"]), set: $util.oneOfSetter($oneOfFields) }); @@ -10151,6 +10824,10 @@ $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestMobileDataStatus.encode(message.mobileDataIngestionStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.pairDataIngestionStatus != null && Object.hasOwnProperty.call(message, "pairDataIngestionStatus")) $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPairDataStatus.encode(message.pairDataIngestionStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userIdDataIngestionStatus != null && Object.hasOwnProperty.call(message, "userIdDataIngestionStatus")) + $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.encode(message.userIdDataIngestionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ppidDataIngestionStatus != null && Object.hasOwnProperty.call(message, "ppidDataIngestionStatus")) + $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.encode(message.ppidDataIngestionStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -10199,6 +10876,14 @@ message.pairDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPairDataStatus.decode(reader, reader.uint32()); break; } + case 4: { + message.userIdDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ppidDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10263,6 +10948,26 @@ return "pairDataIngestionStatus." + error; } } + if (message.userIdDataIngestionStatus != null && message.hasOwnProperty("userIdDataIngestionStatus")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + var error = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.verify(message.userIdDataIngestionStatus); + if (error) + return "userIdDataIngestionStatus." + error; + } + } + if (message.ppidDataIngestionStatus != null && message.hasOwnProperty("ppidDataIngestionStatus")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + var error = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.verify(message.ppidDataIngestionStatus); + if (error) + return "ppidDataIngestionStatus." + error; + } + } return null; }; @@ -10293,6 +10998,16 @@ throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus.pairDataIngestionStatus: object expected"); message.pairDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPairDataStatus.fromObject(object.pairDataIngestionStatus); } + if (object.userIdDataIngestionStatus != null) { + if (typeof object.userIdDataIngestionStatus !== "object") + throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus.userIdDataIngestionStatus: object expected"); + message.userIdDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.fromObject(object.userIdDataIngestionStatus); + } + if (object.ppidDataIngestionStatus != null) { + if (typeof object.ppidDataIngestionStatus !== "object") + throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.IngestAudienceMembersStatus.ppidDataIngestionStatus: object expected"); + message.ppidDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.fromObject(object.ppidDataIngestionStatus); + } return message; }; @@ -10324,6 +11039,16 @@ if (options.oneofs) object.status = "pairDataIngestionStatus"; } + if (message.userIdDataIngestionStatus != null && message.hasOwnProperty("userIdDataIngestionStatus")) { + object.userIdDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.toObject(message.userIdDataIngestionStatus, options); + if (options.oneofs) + object.status = "userIdDataIngestionStatus"; + } + if (message.ppidDataIngestionStatus != null && message.hasOwnProperty("ppidDataIngestionStatus")) { + object.ppidDataIngestionStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.toObject(message.ppidDataIngestionStatus, options); + if (options.oneofs) + object.status = "ppidDataIngestionStatus"; + } return object; }; @@ -10365,6 +11090,8 @@ * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserDataStatus|null} [userDataRemovalStatus] RemoveAudienceMembersStatus userDataRemovalStatus * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveMobileDataStatus|null} [mobileDataRemovalStatus] RemoveAudienceMembersStatus mobileDataRemovalStatus * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePairDataStatus|null} [pairDataRemovalStatus] RemoveAudienceMembersStatus pairDataRemovalStatus + * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus|null} [userIdDataRemovalStatus] RemoveAudienceMembersStatus userIdDataRemovalStatus + * @property {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus|null} [ppidDataRemovalStatus] RemoveAudienceMembersStatus ppidDataRemovalStatus */ /** @@ -10406,17 +11133,33 @@ */ RemoveAudienceMembersStatus.prototype.pairDataRemovalStatus = null; + /** + * RemoveAudienceMembersStatus userIdDataRemovalStatus. + * @member {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus|null|undefined} userIdDataRemovalStatus + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus + * @instance + */ + RemoveAudienceMembersStatus.prototype.userIdDataRemovalStatus = null; + + /** + * RemoveAudienceMembersStatus ppidDataRemovalStatus. + * @member {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus|null|undefined} ppidDataRemovalStatus + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus + * @instance + */ + RemoveAudienceMembersStatus.prototype.ppidDataRemovalStatus = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * RemoveAudienceMembersStatus status. - * @member {"userDataRemovalStatus"|"mobileDataRemovalStatus"|"pairDataRemovalStatus"|undefined} status + * @member {"userDataRemovalStatus"|"mobileDataRemovalStatus"|"pairDataRemovalStatus"|"userIdDataRemovalStatus"|"ppidDataRemovalStatus"|undefined} status * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus * @instance */ Object.defineProperty(RemoveAudienceMembersStatus.prototype, "status", { - get: $util.oneOfGetter($oneOfFields = ["userDataRemovalStatus", "mobileDataRemovalStatus", "pairDataRemovalStatus"]), + get: $util.oneOfGetter($oneOfFields = ["userDataRemovalStatus", "mobileDataRemovalStatus", "pairDataRemovalStatus", "userIdDataRemovalStatus", "ppidDataRemovalStatus"]), set: $util.oneOfSetter($oneOfFields) }); @@ -10450,6 +11193,10 @@ $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveMobileDataStatus.encode(message.mobileDataRemovalStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.pairDataRemovalStatus != null && Object.hasOwnProperty.call(message, "pairDataRemovalStatus")) $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePairDataStatus.encode(message.pairDataRemovalStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userIdDataRemovalStatus != null && Object.hasOwnProperty.call(message, "userIdDataRemovalStatus")) + $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.encode(message.userIdDataRemovalStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ppidDataRemovalStatus != null && Object.hasOwnProperty.call(message, "ppidDataRemovalStatus")) + $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.encode(message.ppidDataRemovalStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -10498,6 +11245,14 @@ message.pairDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePairDataStatus.decode(reader, reader.uint32()); break; } + case 4: { + message.userIdDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ppidDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10562,6 +11317,26 @@ return "pairDataRemovalStatus." + error; } } + if (message.userIdDataRemovalStatus != null && message.hasOwnProperty("userIdDataRemovalStatus")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + var error = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.verify(message.userIdDataRemovalStatus); + if (error) + return "userIdDataRemovalStatus." + error; + } + } + if (message.ppidDataRemovalStatus != null && message.hasOwnProperty("ppidDataRemovalStatus")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + var error = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.verify(message.ppidDataRemovalStatus); + if (error) + return "ppidDataRemovalStatus." + error; + } + } return null; }; @@ -10592,6 +11367,16 @@ throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus.pairDataRemovalStatus: object expected"); message.pairDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePairDataStatus.fromObject(object.pairDataRemovalStatus); } + if (object.userIdDataRemovalStatus != null) { + if (typeof object.userIdDataRemovalStatus !== "object") + throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus.userIdDataRemovalStatus: object expected"); + message.userIdDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.fromObject(object.userIdDataRemovalStatus); + } + if (object.ppidDataRemovalStatus != null) { + if (typeof object.ppidDataRemovalStatus !== "object") + throw TypeError(".google.ads.datamanager.v1.RequestStatusPerDestination.RemoveAudienceMembersStatus.ppidDataRemovalStatus: object expected"); + message.ppidDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.fromObject(object.ppidDataRemovalStatus); + } return message; }; @@ -10623,6 +11408,16 @@ if (options.oneofs) object.status = "pairDataRemovalStatus"; } + if (message.userIdDataRemovalStatus != null && message.hasOwnProperty("userIdDataRemovalStatus")) { + object.userIdDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.toObject(message.userIdDataRemovalStatus, options); + if (options.oneofs) + object.status = "userIdDataRemovalStatus"; + } + if (message.ppidDataRemovalStatus != null && message.hasOwnProperty("ppidDataRemovalStatus")) { + object.ppidDataRemovalStatus = $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.toObject(message.ppidDataRemovalStatus, options); + if (options.oneofs) + object.status = "ppidDataRemovalStatus"; + } return object; }; @@ -12503,286 +13298,15669 @@ return RemovePairDataStatus; })(); - return RequestStatusPerDestination; - })(); - - /** - * MatchRateRange enum. - * @name google.ads.datamanager.v1.MatchRateRange - * @enum {number} - * @property {number} MATCH_RATE_RANGE_UNKNOWN=0 MATCH_RATE_RANGE_UNKNOWN value - * @property {number} MATCH_RATE_RANGE_NOT_ELIGIBLE=1 MATCH_RATE_RANGE_NOT_ELIGIBLE value - * @property {number} MATCH_RATE_RANGE_LESS_THAN_20=2 MATCH_RATE_RANGE_LESS_THAN_20 value - * @property {number} MATCH_RATE_RANGE_20_TO_30=3 MATCH_RATE_RANGE_20_TO_30 value - * @property {number} MATCH_RATE_RANGE_31_TO_40=4 MATCH_RATE_RANGE_31_TO_40 value - * @property {number} MATCH_RATE_RANGE_41_TO_50=5 MATCH_RATE_RANGE_41_TO_50 value - * @property {number} MATCH_RATE_RANGE_51_TO_60=6 MATCH_RATE_RANGE_51_TO_60 value - * @property {number} MATCH_RATE_RANGE_61_TO_70=7 MATCH_RATE_RANGE_61_TO_70 value - * @property {number} MATCH_RATE_RANGE_71_TO_80=8 MATCH_RATE_RANGE_71_TO_80 value - * @property {number} MATCH_RATE_RANGE_81_TO_90=9 MATCH_RATE_RANGE_81_TO_90 value - * @property {number} MATCH_RATE_RANGE_91_TO_100=10 MATCH_RATE_RANGE_91_TO_100 value - */ - v1.MatchRateRange = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MATCH_RATE_RANGE_UNKNOWN"] = 0; - values[valuesById[1] = "MATCH_RATE_RANGE_NOT_ELIGIBLE"] = 1; - values[valuesById[2] = "MATCH_RATE_RANGE_LESS_THAN_20"] = 2; - values[valuesById[3] = "MATCH_RATE_RANGE_20_TO_30"] = 3; - values[valuesById[4] = "MATCH_RATE_RANGE_31_TO_40"] = 4; - values[valuesById[5] = "MATCH_RATE_RANGE_41_TO_50"] = 5; - values[valuesById[6] = "MATCH_RATE_RANGE_51_TO_60"] = 6; - values[valuesById[7] = "MATCH_RATE_RANGE_61_TO_70"] = 7; - values[valuesById[8] = "MATCH_RATE_RANGE_71_TO_80"] = 8; - values[valuesById[9] = "MATCH_RATE_RANGE_81_TO_90"] = 9; - values[valuesById[10] = "MATCH_RATE_RANGE_91_TO_100"] = 10; - return values; - })(); + RequestStatusPerDestination.IngestUserIdDataStatus = (function() { - v1.ErrorInfo = (function() { + /** + * Properties of an IngestUserIdDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @interface IIngestUserIdDataStatus + * @property {number|Long|null} [recordCount] IngestUserIdDataStatus recordCount + * @property {number|Long|null} [userIdCount] IngestUserIdDataStatus userIdCount + */ - /** - * Properties of an ErrorInfo. - * @memberof google.ads.datamanager.v1 - * @interface IErrorInfo - * @property {Array.|null} [errorCounts] ErrorInfo errorCounts - */ + /** + * Constructs a new IngestUserIdDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @classdesc Represents an IngestUserIdDataStatus. + * @implements IIngestUserIdDataStatus + * @constructor + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus=} [properties] Properties to set + */ + function IngestUserIdDataStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ErrorInfo. - * @memberof google.ads.datamanager.v1 - * @classdesc Represents an ErrorInfo. - * @implements IErrorInfo - * @constructor - * @param {google.ads.datamanager.v1.IErrorInfo=} [properties] Properties to set - */ - function ErrorInfo(properties) { - this.errorCounts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * IngestUserIdDataStatus recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @instance + */ + IngestUserIdDataStatus.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * ErrorInfo errorCounts. - * @member {Array.} errorCounts - * @memberof google.ads.datamanager.v1.ErrorInfo - * @instance - */ - ErrorInfo.prototype.errorCounts = $util.emptyArray; + /** + * IngestUserIdDataStatus userIdCount. + * @member {number|Long} userIdCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @instance + */ + IngestUserIdDataStatus.prototype.userIdCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new ErrorInfo instance using the specified properties. - * @function create - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {google.ads.datamanager.v1.IErrorInfo=} [properties] Properties to set - * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo instance - */ - ErrorInfo.create = function create(properties) { - return new ErrorInfo(properties); - }; + /** + * Creates a new IngestUserIdDataStatus instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus} IngestUserIdDataStatus instance + */ + IngestUserIdDataStatus.create = function create(properties) { + return new IngestUserIdDataStatus(properties); + }; - /** - * Encodes the specified ErrorInfo message. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. - * @function encode - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {google.ads.datamanager.v1.IErrorInfo} message ErrorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errorCounts != null && message.errorCounts.length) - for (var i = 0; i < message.errorCounts.length; ++i) - $root.google.ads.datamanager.v1.ErrorCount.encode(message.errorCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified IngestUserIdDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus} message IngestUserIdDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestUserIdDataStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.userIdCount != null && Object.hasOwnProperty.call(message, "userIdCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userIdCount); + return writer; + }; - /** - * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {google.ads.datamanager.v1.IErrorInfo} message ErrorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified IngestUserIdDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestUserIdDataStatus} message IngestUserIdDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestUserIdDataStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ErrorInfo message from the specified reader or buffer. - * @function decode - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ErrorInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.errorCounts && message.errorCounts.length)) - message.errorCounts = []; - message.errorCounts.push($root.google.ads.datamanager.v1.ErrorCount.decode(reader, reader.uint32())); + /** + * Decodes an IngestUserIdDataStatus message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus} IngestUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestUserIdDataStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.userIdCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an IngestUserIdDataStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus} IngestUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestUserIdDataStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ErrorInfo message. - * @function verify - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ErrorInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errorCounts != null && message.hasOwnProperty("errorCounts")) { - if (!Array.isArray(message.errorCounts)) - return "errorCounts: array expected"; - for (var i = 0; i < message.errorCounts.length; ++i) { - var error = $root.google.ads.datamanager.v1.ErrorCount.verify(message.errorCounts[i]); - if (error) - return "errorCounts." + error; - } - } - return null; - }; + /** + * Verifies an IngestUserIdDataStatus message. + * @function verify + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestUserIdDataStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.userIdCount != null && message.hasOwnProperty("userIdCount")) + if (!$util.isInteger(message.userIdCount) && !(message.userIdCount && $util.isInteger(message.userIdCount.low) && $util.isInteger(message.userIdCount.high))) + return "userIdCount: integer|Long expected"; + return null; + }; - /** - * Creates an ErrorInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {Object.} object Plain object - * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo - */ - ErrorInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.ads.datamanager.v1.ErrorInfo) + /** + * Creates an IngestUserIdDataStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus} IngestUserIdDataStatus + */ + IngestUserIdDataStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus) + return object; + var message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + if (object.userIdCount != null) + if ($util.Long) + (message.userIdCount = $util.Long.fromValue(object.userIdCount)).unsigned = false; + else if (typeof object.userIdCount === "string") + message.userIdCount = parseInt(object.userIdCount, 10); + else if (typeof object.userIdCount === "number") + message.userIdCount = object.userIdCount; + else if (typeof object.userIdCount === "object") + message.userIdCount = new $util.LongBits(object.userIdCount.low >>> 0, object.userIdCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IngestUserIdDataStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus} message IngestUserIdDataStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestUserIdDataStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userIdCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userIdCount = options.longs === String ? "0" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.userIdCount != null && message.hasOwnProperty("userIdCount")) + if (typeof message.userIdCount === "number") + object.userIdCount = options.longs === String ? String(message.userIdCount) : message.userIdCount; + else + object.userIdCount = options.longs === String ? $util.Long.prototype.toString.call(message.userIdCount) : options.longs === Number ? new $util.LongBits(message.userIdCount.low >>> 0, message.userIdCount.high >>> 0).toNumber() : message.userIdCount; return object; - var message = new $root.google.ads.datamanager.v1.ErrorInfo(); - if (object.errorCounts) { - if (!Array.isArray(object.errorCounts)) - throw TypeError(".google.ads.datamanager.v1.ErrorInfo.errorCounts: array expected"); - message.errorCounts = []; - for (var i = 0; i < object.errorCounts.length; ++i) { - if (typeof object.errorCounts[i] !== "object") - throw TypeError(".google.ads.datamanager.v1.ErrorInfo.errorCounts: object expected"); - message.errorCounts[i] = $root.google.ads.datamanager.v1.ErrorCount.fromObject(object.errorCounts[i]); + }; + + /** + * Converts this IngestUserIdDataStatus to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @instance + * @returns {Object.} JSON object + */ + IngestUserIdDataStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestUserIdDataStatus + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestUserIdDataStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; + return typeUrlPrefix + "/google.ads.datamanager.v1.RequestStatusPerDestination.IngestUserIdDataStatus"; + }; - /** - * Creates a plain object from an ErrorInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {google.ads.datamanager.v1.ErrorInfo} message ErrorInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ErrorInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.errorCounts = []; - if (message.errorCounts && message.errorCounts.length) { - object.errorCounts = []; - for (var j = 0; j < message.errorCounts.length; ++j) - object.errorCounts[j] = $root.google.ads.datamanager.v1.ErrorCount.toObject(message.errorCounts[j], options); - } - return object; - }; + return IngestUserIdDataStatus; + })(); - /** - * Converts this ErrorInfo to JSON. - * @function toJSON - * @memberof google.ads.datamanager.v1.ErrorInfo - * @instance - * @returns {Object.} JSON object - */ - ErrorInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + RequestStatusPerDestination.RemoveUserIdDataStatus = (function() { - /** - * Gets the default type url for ErrorInfo - * @function getTypeUrl - * @memberof google.ads.datamanager.v1.ErrorInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Properties of a RemoveUserIdDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @interface IRemoveUserIdDataStatus + * @property {number|Long|null} [recordCount] RemoveUserIdDataStatus recordCount + * @property {number|Long|null} [userIdCount] RemoveUserIdDataStatus userIdCount + */ + + /** + * Constructs a new RemoveUserIdDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @classdesc Represents a RemoveUserIdDataStatus. + * @implements IRemoveUserIdDataStatus + * @constructor + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus=} [properties] Properties to set + */ + function RemoveUserIdDataStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return typeUrlPrefix + "/google.ads.datamanager.v1.ErrorInfo"; - }; - return ErrorInfo; - })(); + /** + * RemoveUserIdDataStatus recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @instance + */ + RemoveUserIdDataStatus.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - v1.ErrorCount = (function() { + /** + * RemoveUserIdDataStatus userIdCount. + * @member {number|Long} userIdCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @instance + */ + RemoveUserIdDataStatus.prototype.userIdCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Properties of an ErrorCount. - * @memberof google.ads.datamanager.v1 - * @interface IErrorCount - * @property {number|Long|null} [recordCount] ErrorCount recordCount - * @property {google.ads.datamanager.v1.ProcessingErrorReason|null} [reason] ErrorCount reason - */ + /** + * Creates a new RemoveUserIdDataStatus instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus} RemoveUserIdDataStatus instance + */ + RemoveUserIdDataStatus.create = function create(properties) { + return new RemoveUserIdDataStatus(properties); + }; + + /** + * Encodes the specified RemoveUserIdDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus} message RemoveUserIdDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveUserIdDataStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.userIdCount != null && Object.hasOwnProperty.call(message, "userIdCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userIdCount); + return writer; + }; + + /** + * Encodes the specified RemoveUserIdDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemoveUserIdDataStatus} message RemoveUserIdDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveUserIdDataStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveUserIdDataStatus message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus} RemoveUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveUserIdDataStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.userIdCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveUserIdDataStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus} RemoveUserIdDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveUserIdDataStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveUserIdDataStatus message. + * @function verify + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveUserIdDataStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.userIdCount != null && message.hasOwnProperty("userIdCount")) + if (!$util.isInteger(message.userIdCount) && !(message.userIdCount && $util.isInteger(message.userIdCount.low) && $util.isInteger(message.userIdCount.high))) + return "userIdCount: integer|Long expected"; + return null; + }; + + /** + * Creates a RemoveUserIdDataStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus} RemoveUserIdDataStatus + */ + RemoveUserIdDataStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus) + return object; + var message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + if (object.userIdCount != null) + if ($util.Long) + (message.userIdCount = $util.Long.fromValue(object.userIdCount)).unsigned = false; + else if (typeof object.userIdCount === "string") + message.userIdCount = parseInt(object.userIdCount, 10); + else if (typeof object.userIdCount === "number") + message.userIdCount = object.userIdCount; + else if (typeof object.userIdCount === "object") + message.userIdCount = new $util.LongBits(object.userIdCount.low >>> 0, object.userIdCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RemoveUserIdDataStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus} message RemoveUserIdDataStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveUserIdDataStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userIdCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userIdCount = options.longs === String ? "0" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.userIdCount != null && message.hasOwnProperty("userIdCount")) + if (typeof message.userIdCount === "number") + object.userIdCount = options.longs === String ? String(message.userIdCount) : message.userIdCount; + else + object.userIdCount = options.longs === String ? $util.Long.prototype.toString.call(message.userIdCount) : options.longs === Number ? new $util.LongBits(message.userIdCount.low >>> 0, message.userIdCount.high >>> 0).toNumber() : message.userIdCount; + return object; + }; + + /** + * Converts this RemoveUserIdDataStatus to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @instance + * @returns {Object.} JSON object + */ + RemoveUserIdDataStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveUserIdDataStatus + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveUserIdDataStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RequestStatusPerDestination.RemoveUserIdDataStatus"; + }; + + return RemoveUserIdDataStatus; + })(); + + RequestStatusPerDestination.IngestPpidDataStatus = (function() { + + /** + * Properties of an IngestPpidDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @interface IIngestPpidDataStatus + * @property {number|Long|null} [recordCount] IngestPpidDataStatus recordCount + * @property {number|Long|null} [ppidCount] IngestPpidDataStatus ppidCount + */ + + /** + * Constructs a new IngestPpidDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @classdesc Represents an IngestPpidDataStatus. + * @implements IIngestPpidDataStatus + * @constructor + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus=} [properties] Properties to set + */ + function IngestPpidDataStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestPpidDataStatus recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @instance + */ + IngestPpidDataStatus.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * IngestPpidDataStatus ppidCount. + * @member {number|Long} ppidCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @instance + */ + IngestPpidDataStatus.prototype.ppidCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new IngestPpidDataStatus instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus} IngestPpidDataStatus instance + */ + IngestPpidDataStatus.create = function create(properties) { + return new IngestPpidDataStatus(properties); + }; + + /** + * Encodes the specified IngestPpidDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus} message IngestPpidDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestPpidDataStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.ppidCount != null && Object.hasOwnProperty.call(message, "ppidCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ppidCount); + return writer; + }; + + /** + * Encodes the specified IngestPpidDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IIngestPpidDataStatus} message IngestPpidDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestPpidDataStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestPpidDataStatus message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus} IngestPpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestPpidDataStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.ppidCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestPpidDataStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus} IngestPpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestPpidDataStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestPpidDataStatus message. + * @function verify + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestPpidDataStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.ppidCount != null && message.hasOwnProperty("ppidCount")) + if (!$util.isInteger(message.ppidCount) && !(message.ppidCount && $util.isInteger(message.ppidCount.low) && $util.isInteger(message.ppidCount.high))) + return "ppidCount: integer|Long expected"; + return null; + }; + + /** + * Creates an IngestPpidDataStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus} IngestPpidDataStatus + */ + IngestPpidDataStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus) + return object; + var message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + if (object.ppidCount != null) + if ($util.Long) + (message.ppidCount = $util.Long.fromValue(object.ppidCount)).unsigned = false; + else if (typeof object.ppidCount === "string") + message.ppidCount = parseInt(object.ppidCount, 10); + else if (typeof object.ppidCount === "number") + message.ppidCount = object.ppidCount; + else if (typeof object.ppidCount === "object") + message.ppidCount = new $util.LongBits(object.ppidCount.low >>> 0, object.ppidCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IngestPpidDataStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus} message IngestPpidDataStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestPpidDataStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ppidCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ppidCount = options.longs === String ? "0" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.ppidCount != null && message.hasOwnProperty("ppidCount")) + if (typeof message.ppidCount === "number") + object.ppidCount = options.longs === String ? String(message.ppidCount) : message.ppidCount; + else + object.ppidCount = options.longs === String ? $util.Long.prototype.toString.call(message.ppidCount) : options.longs === Number ? new $util.LongBits(message.ppidCount.low >>> 0, message.ppidCount.high >>> 0).toNumber() : message.ppidCount; + return object; + }; + + /** + * Converts this IngestPpidDataStatus to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @instance + * @returns {Object.} JSON object + */ + IngestPpidDataStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestPpidDataStatus + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestPpidDataStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RequestStatusPerDestination.IngestPpidDataStatus"; + }; + + return IngestPpidDataStatus; + })(); + + RequestStatusPerDestination.RemovePpidDataStatus = (function() { + + /** + * Properties of a RemovePpidDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @interface IRemovePpidDataStatus + * @property {number|Long|null} [recordCount] RemovePpidDataStatus recordCount + * @property {number|Long|null} [ppidCount] RemovePpidDataStatus ppidCount + */ + + /** + * Constructs a new RemovePpidDataStatus. + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination + * @classdesc Represents a RemovePpidDataStatus. + * @implements IRemovePpidDataStatus + * @constructor + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus=} [properties] Properties to set + */ + function RemovePpidDataStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemovePpidDataStatus recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @instance + */ + RemovePpidDataStatus.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RemovePpidDataStatus ppidCount. + * @member {number|Long} ppidCount + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @instance + */ + RemovePpidDataStatus.prototype.ppidCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RemovePpidDataStatus instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus} RemovePpidDataStatus instance + */ + RemovePpidDataStatus.create = function create(properties) { + return new RemovePpidDataStatus(properties); + }; + + /** + * Encodes the specified RemovePpidDataStatus message. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus} message RemovePpidDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePpidDataStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.ppidCount != null && Object.hasOwnProperty.call(message, "ppidCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ppidCount); + return writer; + }; + + /** + * Encodes the specified RemovePpidDataStatus message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.IRemovePpidDataStatus} message RemovePpidDataStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePpidDataStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemovePpidDataStatus message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus} RemovePpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePpidDataStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.ppidCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemovePpidDataStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus} RemovePpidDataStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePpidDataStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemovePpidDataStatus message. + * @function verify + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemovePpidDataStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.ppidCount != null && message.hasOwnProperty("ppidCount")) + if (!$util.isInteger(message.ppidCount) && !(message.ppidCount && $util.isInteger(message.ppidCount.low) && $util.isInteger(message.ppidCount.high))) + return "ppidCount: integer|Long expected"; + return null; + }; + + /** + * Creates a RemovePpidDataStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus} RemovePpidDataStatus + */ + RemovePpidDataStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus) + return object; + var message = new $root.google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + if (object.ppidCount != null) + if ($util.Long) + (message.ppidCount = $util.Long.fromValue(object.ppidCount)).unsigned = false; + else if (typeof object.ppidCount === "string") + message.ppidCount = parseInt(object.ppidCount, 10); + else if (typeof object.ppidCount === "number") + message.ppidCount = object.ppidCount; + else if (typeof object.ppidCount === "object") + message.ppidCount = new $util.LongBits(object.ppidCount.low >>> 0, object.ppidCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RemovePpidDataStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus} message RemovePpidDataStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemovePpidDataStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ppidCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ppidCount = options.longs === String ? "0" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.ppidCount != null && message.hasOwnProperty("ppidCount")) + if (typeof message.ppidCount === "number") + object.ppidCount = options.longs === String ? String(message.ppidCount) : message.ppidCount; + else + object.ppidCount = options.longs === String ? $util.Long.prototype.toString.call(message.ppidCount) : options.longs === Number ? new $util.LongBits(message.ppidCount.low >>> 0, message.ppidCount.high >>> 0).toNumber() : message.ppidCount; + return object; + }; + + /** + * Converts this RemovePpidDataStatus to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @instance + * @returns {Object.} JSON object + */ + RemovePpidDataStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemovePpidDataStatus + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemovePpidDataStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RequestStatusPerDestination.RemovePpidDataStatus"; + }; + + return RemovePpidDataStatus; + })(); + + return RequestStatusPerDestination; + })(); + + /** + * MatchRateRange enum. + * @name google.ads.datamanager.v1.MatchRateRange + * @enum {number} + * @property {number} MATCH_RATE_RANGE_UNKNOWN=0 MATCH_RATE_RANGE_UNKNOWN value + * @property {number} MATCH_RATE_RANGE_NOT_ELIGIBLE=1 MATCH_RATE_RANGE_NOT_ELIGIBLE value + * @property {number} MATCH_RATE_RANGE_LESS_THAN_20=2 MATCH_RATE_RANGE_LESS_THAN_20 value + * @property {number} MATCH_RATE_RANGE_20_TO_30=3 MATCH_RATE_RANGE_20_TO_30 value + * @property {number} MATCH_RATE_RANGE_31_TO_40=4 MATCH_RATE_RANGE_31_TO_40 value + * @property {number} MATCH_RATE_RANGE_41_TO_50=5 MATCH_RATE_RANGE_41_TO_50 value + * @property {number} MATCH_RATE_RANGE_51_TO_60=6 MATCH_RATE_RANGE_51_TO_60 value + * @property {number} MATCH_RATE_RANGE_61_TO_70=7 MATCH_RATE_RANGE_61_TO_70 value + * @property {number} MATCH_RATE_RANGE_71_TO_80=8 MATCH_RATE_RANGE_71_TO_80 value + * @property {number} MATCH_RATE_RANGE_81_TO_90=9 MATCH_RATE_RANGE_81_TO_90 value + * @property {number} MATCH_RATE_RANGE_91_TO_100=10 MATCH_RATE_RANGE_91_TO_100 value + */ + v1.MatchRateRange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_RATE_RANGE_UNKNOWN"] = 0; + values[valuesById[1] = "MATCH_RATE_RANGE_NOT_ELIGIBLE"] = 1; + values[valuesById[2] = "MATCH_RATE_RANGE_LESS_THAN_20"] = 2; + values[valuesById[3] = "MATCH_RATE_RANGE_20_TO_30"] = 3; + values[valuesById[4] = "MATCH_RATE_RANGE_31_TO_40"] = 4; + values[valuesById[5] = "MATCH_RATE_RANGE_41_TO_50"] = 5; + values[valuesById[6] = "MATCH_RATE_RANGE_51_TO_60"] = 6; + values[valuesById[7] = "MATCH_RATE_RANGE_61_TO_70"] = 7; + values[valuesById[8] = "MATCH_RATE_RANGE_71_TO_80"] = 8; + values[valuesById[9] = "MATCH_RATE_RANGE_81_TO_90"] = 9; + values[valuesById[10] = "MATCH_RATE_RANGE_91_TO_100"] = 10; + return values; + })(); + + v1.ErrorInfo = (function() { + + /** + * Properties of an ErrorInfo. + * @memberof google.ads.datamanager.v1 + * @interface IErrorInfo + * @property {Array.|null} [errorCounts] ErrorInfo errorCounts + */ + + /** + * Constructs a new ErrorInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents an ErrorInfo. + * @implements IErrorInfo + * @constructor + * @param {google.ads.datamanager.v1.IErrorInfo=} [properties] Properties to set + */ + function ErrorInfo(properties) { + this.errorCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorInfo errorCounts. + * @member {Array.} errorCounts + * @memberof google.ads.datamanager.v1.ErrorInfo + * @instance + */ + ErrorInfo.prototype.errorCounts = $util.emptyArray; + + /** + * Creates a new ErrorInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {google.ads.datamanager.v1.IErrorInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo instance + */ + ErrorInfo.create = function create(properties) { + return new ErrorInfo(properties); + }; + + /** + * Encodes the specified ErrorInfo message. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {google.ads.datamanager.v1.IErrorInfo} message ErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCounts != null && message.errorCounts.length) + for (var i = 0; i < message.errorCounts.length; ++i) + $root.google.ads.datamanager.v1.ErrorCount.encode(message.errorCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {google.ads.datamanager.v1.IErrorInfo} message ErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ErrorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errorCounts && message.errorCounts.length)) + message.errorCounts = []; + message.errorCounts.push($root.google.ads.datamanager.v1.ErrorCount.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCounts != null && message.hasOwnProperty("errorCounts")) { + if (!Array.isArray(message.errorCounts)) + return "errorCounts: array expected"; + for (var i = 0; i < message.errorCounts.length; ++i) { + var error = $root.google.ads.datamanager.v1.ErrorCount.verify(message.errorCounts[i]); + if (error) + return "errorCounts." + error; + } + } + return null; + }; + + /** + * Creates an ErrorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ErrorInfo} ErrorInfo + */ + ErrorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ErrorInfo) + return object; + var message = new $root.google.ads.datamanager.v1.ErrorInfo(); + if (object.errorCounts) { + if (!Array.isArray(object.errorCounts)) + throw TypeError(".google.ads.datamanager.v1.ErrorInfo.errorCounts: array expected"); + message.errorCounts = []; + for (var i = 0; i < object.errorCounts.length; ++i) { + if (typeof object.errorCounts[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.ErrorInfo.errorCounts: object expected"); + message.errorCounts[i] = $root.google.ads.datamanager.v1.ErrorCount.fromObject(object.errorCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ErrorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {google.ads.datamanager.v1.ErrorInfo} message ErrorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorCounts = []; + if (message.errorCounts && message.errorCounts.length) { + object.errorCounts = []; + for (var j = 0; j < message.errorCounts.length; ++j) + object.errorCounts[j] = $root.google.ads.datamanager.v1.ErrorCount.toObject(message.errorCounts[j], options); + } + return object; + }; + + /** + * Converts this ErrorInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ErrorInfo + * @instance + * @returns {Object.} JSON object + */ + ErrorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ErrorInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ErrorInfo"; + }; + + return ErrorInfo; + })(); + + v1.ErrorCount = (function() { + + /** + * Properties of an ErrorCount. + * @memberof google.ads.datamanager.v1 + * @interface IErrorCount + * @property {number|Long|null} [recordCount] ErrorCount recordCount + * @property {google.ads.datamanager.v1.ProcessingErrorReason|null} [reason] ErrorCount reason + */ + + /** + * Constructs a new ErrorCount. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents an ErrorCount. + * @implements IErrorCount + * @constructor + * @param {google.ads.datamanager.v1.IErrorCount=} [properties] Properties to set + */ + function ErrorCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorCount recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.ErrorCount + * @instance + */ + ErrorCount.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ErrorCount reason. + * @member {google.ads.datamanager.v1.ProcessingErrorReason} reason + * @memberof google.ads.datamanager.v1.ErrorCount + * @instance + */ + ErrorCount.prototype.reason = 0; + + /** + * Creates a new ErrorCount instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {google.ads.datamanager.v1.IErrorCount=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount instance + */ + ErrorCount.create = function create(properties) { + return new ErrorCount(properties); + }; + + /** + * Encodes the specified ErrorCount message. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {google.ads.datamanager.v1.IErrorCount} message ErrorCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + return writer; + }; + + /** + * Encodes the specified ErrorCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {google.ads.datamanager.v1.IErrorCount} message ErrorCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorCount message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ErrorCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorCount message. + * @function verify + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 27: + case 25: + case 26: + break; + } + return null; + }; + + /** + * Creates an ErrorCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + */ + ErrorCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ErrorCount) + return object; + var message = new $root.google.ads.datamanager.v1.ErrorCount(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "PROCESSING_ERROR_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE": + case 1: + message.reason = 1; + break; + case "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED": + case 2: + message.reason = 2; + break; + case "PROCESSING_ERROR_REASON_EVENT_TOO_OLD": + case 3: + message.reason = 3; + break; + case "PROCESSING_ERROR_REASON_DENIED_CONSENT": + case 4: + message.reason = 4; + break; + case "PROCESSING_ERROR_REASON_NO_CONSENT": + case 5: + message.reason = 5; + break; + case "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT": + case 6: + message.reason = 6; + break; + case "PROCESSING_ERROR_REASON_DUPLICATE_GCLID": + case 7: + message.reason = 7; + break; + case "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID": + case 8: + message.reason = 8; + break; + case "PROCESSING_ERROR_REASON_INVALID_GBRAID": + case 9: + message.reason = 9; + break; + case "PROCESSING_ERROR_REASON_INVALID_GCLID": + case 10: + message.reason = 10; + break; + case "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID": + case 11: + message.reason = 11; + break; + case "PROCESSING_ERROR_REASON_INVALID_WBRAID": + case 12: + message.reason = 12; + break; + case "PROCESSING_ERROR_REASON_INTERNAL_ERROR": + case 13: + message.reason = 13; + break; + case "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED": + case 14: + message.reason = 14; + break; + case "PROCESSING_ERROR_REASON_INVALID_EVENT": + case 15: + message.reason = 15; + break; + case "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS": + case 16: + message.reason = 16; + break; + case "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS": + case 17: + message.reason = 17; + break; + case "PROCESSING_ERROR_REASON_INVALID_FORMAT": + case 18: + message.reason = 18; + break; + case "PROCESSING_ERROR_REASON_DECRYPTION_ERROR": + case 19: + message.reason = 19; + break; + case "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR": + case 20: + message.reason = 20; + break; + case "PROCESSING_ERROR_REASON_INVALID_WIP": + case 21: + message.reason = 21; + break; + case "PROCESSING_ERROR_REASON_INVALID_KEK": + case 22: + message.reason = 22; + break; + case "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED": + case 23: + message.reason = 23; + break; + case "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED": + case 24: + message.reason = 24; + break; + case "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED": + case 27: + message.reason = 27; + break; + case "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": + case 25: + message.reason = 25; + break; + case "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER": + case 26: + message.reason = 26; + break; + } + return message; + }; + + /** + * Creates a plain object from an ErrorCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {google.ads.datamanager.v1.ErrorCount} message ErrorCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + object.reason = options.enums === String ? "PROCESSING_ERROR_REASON_UNSPECIFIED" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.ads.datamanager.v1.ProcessingErrorReason[message.reason] === undefined ? message.reason : $root.google.ads.datamanager.v1.ProcessingErrorReason[message.reason] : message.reason; + return object; + }; + + /** + * Converts this ErrorCount to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ErrorCount + * @instance + * @returns {Object.} JSON object + */ + ErrorCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorCount + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ErrorCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ErrorCount"; + }; + + return ErrorCount; + })(); + + v1.WarningInfo = (function() { + + /** + * Properties of a WarningInfo. + * @memberof google.ads.datamanager.v1 + * @interface IWarningInfo + * @property {Array.|null} [warningCounts] WarningInfo warningCounts + */ + + /** + * Constructs a new WarningInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a WarningInfo. + * @implements IWarningInfo + * @constructor + * @param {google.ads.datamanager.v1.IWarningInfo=} [properties] Properties to set + */ + function WarningInfo(properties) { + this.warningCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WarningInfo warningCounts. + * @member {Array.} warningCounts + * @memberof google.ads.datamanager.v1.WarningInfo + * @instance + */ + WarningInfo.prototype.warningCounts = $util.emptyArray; + + /** + * Creates a new WarningInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {google.ads.datamanager.v1.IWarningInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo instance + */ + WarningInfo.create = function create(properties) { + return new WarningInfo(properties); + }; + + /** + * Encodes the specified WarningInfo message. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {google.ads.datamanager.v1.IWarningInfo} message WarningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarningInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warningCounts != null && message.warningCounts.length) + for (var i = 0; i < message.warningCounts.length; ++i) + $root.google.ads.datamanager.v1.WarningCount.encode(message.warningCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WarningInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {google.ads.datamanager.v1.IWarningInfo} message WarningInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarningInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WarningInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarningInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.WarningInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.warningCounts && message.warningCounts.length)) + message.warningCounts = []; + message.warningCounts.push($root.google.ads.datamanager.v1.WarningCount.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WarningInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarningInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WarningInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WarningInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.warningCounts != null && message.hasOwnProperty("warningCounts")) { + if (!Array.isArray(message.warningCounts)) + return "warningCounts: array expected"; + for (var i = 0; i < message.warningCounts.length; ++i) { + var error = $root.google.ads.datamanager.v1.WarningCount.verify(message.warningCounts[i]); + if (error) + return "warningCounts." + error; + } + } + return null; + }; + + /** + * Creates a WarningInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + */ + WarningInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.WarningInfo) + return object; + var message = new $root.google.ads.datamanager.v1.WarningInfo(); + if (object.warningCounts) { + if (!Array.isArray(object.warningCounts)) + throw TypeError(".google.ads.datamanager.v1.WarningInfo.warningCounts: array expected"); + message.warningCounts = []; + for (var i = 0; i < object.warningCounts.length; ++i) { + if (typeof object.warningCounts[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.WarningInfo.warningCounts: object expected"); + message.warningCounts[i] = $root.google.ads.datamanager.v1.WarningCount.fromObject(object.warningCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WarningInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {google.ads.datamanager.v1.WarningInfo} message WarningInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WarningInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warningCounts = []; + if (message.warningCounts && message.warningCounts.length) { + object.warningCounts = []; + for (var j = 0; j < message.warningCounts.length; ++j) + object.warningCounts[j] = $root.google.ads.datamanager.v1.WarningCount.toObject(message.warningCounts[j], options); + } + return object; + }; + + /** + * Converts this WarningInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.WarningInfo + * @instance + * @returns {Object.} JSON object + */ + WarningInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WarningInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.WarningInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WarningInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.WarningInfo"; + }; + + return WarningInfo; + })(); + + v1.WarningCount = (function() { + + /** + * Properties of a WarningCount. + * @memberof google.ads.datamanager.v1 + * @interface IWarningCount + * @property {number|Long|null} [recordCount] WarningCount recordCount + * @property {google.ads.datamanager.v1.ProcessingWarningReason|null} [reason] WarningCount reason + */ + + /** + * Constructs a new WarningCount. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a WarningCount. + * @implements IWarningCount + * @constructor + * @param {google.ads.datamanager.v1.IWarningCount=} [properties] Properties to set + */ + function WarningCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WarningCount recordCount. + * @member {number|Long} recordCount + * @memberof google.ads.datamanager.v1.WarningCount + * @instance + */ + WarningCount.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * WarningCount reason. + * @member {google.ads.datamanager.v1.ProcessingWarningReason} reason + * @memberof google.ads.datamanager.v1.WarningCount + * @instance + */ + WarningCount.prototype.reason = 0; + + /** + * Creates a new WarningCount instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {google.ads.datamanager.v1.IWarningCount=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.WarningCount} WarningCount instance + */ + WarningCount.create = function create(properties) { + return new WarningCount(properties); + }; + + /** + * Encodes the specified WarningCount message. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {google.ads.datamanager.v1.IWarningCount} message WarningCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarningCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + return writer; + }; + + /** + * Encodes the specified WarningCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {google.ads.datamanager.v1.IWarningCount} message WarningCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarningCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WarningCount message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarningCount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.WarningCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordCount = reader.int64(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WarningCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarningCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WarningCount message. + * @function verify + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WarningCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) + return "recordCount: integer|Long expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a WarningCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + */ + WarningCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.WarningCount) + return object; + var message = new $root.google.ads.datamanager.v1.WarningCount(); + if (object.recordCount != null) + if ($util.Long) + (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + else if (typeof object.recordCount === "string") + message.recordCount = parseInt(object.recordCount, 10); + else if (typeof object.recordCount === "number") + message.recordCount = object.recordCount; + else if (typeof object.recordCount === "object") + message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "PROCESSING_WARNING_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED": + case 1: + message.reason = 1; + break; + case "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR": + case 2: + message.reason = 2; + break; + case "PROCESSING_WARNING_REASON_DECRYPTION_ERROR": + case 3: + message.reason = 3; + break; + case "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED": + case 4: + message.reason = 4; + break; + case "PROCESSING_WARNING_REASON_INVALID_WIP": + case 5: + message.reason = 5; + break; + case "PROCESSING_WARNING_REASON_INVALID_KEK": + case 6: + message.reason = 6; + break; + case "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": + case 7: + message.reason = 7; + break; + case "PROCESSING_WARNING_REASON_INTERNAL_ERROR": + case 8: + message.reason = 8; + break; + case "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED": + case 9: + message.reason = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a WarningCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {google.ads.datamanager.v1.WarningCount} message WarningCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WarningCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recordCount = options.longs === String ? "0" : 0; + object.reason = options.enums === String ? "PROCESSING_WARNING_REASON_UNSPECIFIED" : 0; + } + if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (typeof message.recordCount === "number") + object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; + else + object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.ads.datamanager.v1.ProcessingWarningReason[message.reason] === undefined ? message.reason : $root.google.ads.datamanager.v1.ProcessingWarningReason[message.reason] : message.reason; + return object; + }; + + /** + * Converts this WarningCount to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.WarningCount + * @instance + * @returns {Object.} JSON object + */ + WarningCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WarningCount + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.WarningCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WarningCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.WarningCount"; + }; + + return WarningCount; + })(); + + /** + * ProcessingErrorReason enum. + * @name google.ads.datamanager.v1.ProcessingErrorReason + * @enum {number} + * @property {number} PROCESSING_ERROR_REASON_UNSPECIFIED=0 PROCESSING_ERROR_REASON_UNSPECIFIED value + * @property {number} PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE=1 PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE value + * @property {number} PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED=2 PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED value + * @property {number} PROCESSING_ERROR_REASON_EVENT_TOO_OLD=3 PROCESSING_ERROR_REASON_EVENT_TOO_OLD value + * @property {number} PROCESSING_ERROR_REASON_DENIED_CONSENT=4 PROCESSING_ERROR_REASON_DENIED_CONSENT value + * @property {number} PROCESSING_ERROR_REASON_NO_CONSENT=5 PROCESSING_ERROR_REASON_NO_CONSENT value + * @property {number} PROCESSING_ERROR_REASON_UNKNOWN_CONSENT=6 PROCESSING_ERROR_REASON_UNKNOWN_CONSENT value + * @property {number} PROCESSING_ERROR_REASON_DUPLICATE_GCLID=7 PROCESSING_ERROR_REASON_DUPLICATE_GCLID value + * @property {number} PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID=8 PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID value + * @property {number} PROCESSING_ERROR_REASON_INVALID_GBRAID=9 PROCESSING_ERROR_REASON_INVALID_GBRAID value + * @property {number} PROCESSING_ERROR_REASON_INVALID_GCLID=10 PROCESSING_ERROR_REASON_INVALID_GCLID value + * @property {number} PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID=11 PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID value + * @property {number} PROCESSING_ERROR_REASON_INVALID_WBRAID=12 PROCESSING_ERROR_REASON_INVALID_WBRAID value + * @property {number} PROCESSING_ERROR_REASON_INTERNAL_ERROR=13 PROCESSING_ERROR_REASON_INTERNAL_ERROR value + * @property {number} PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED=14 PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED value + * @property {number} PROCESSING_ERROR_REASON_INVALID_EVENT=15 PROCESSING_ERROR_REASON_INVALID_EVENT value + * @property {number} PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS=16 PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS value + * @property {number} PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS=17 PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS value + * @property {number} PROCESSING_ERROR_REASON_INVALID_FORMAT=18 PROCESSING_ERROR_REASON_INVALID_FORMAT value + * @property {number} PROCESSING_ERROR_REASON_DECRYPTION_ERROR=19 PROCESSING_ERROR_REASON_DECRYPTION_ERROR value + * @property {number} PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR=20 PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR value + * @property {number} PROCESSING_ERROR_REASON_INVALID_WIP=21 PROCESSING_ERROR_REASON_INVALID_WIP value + * @property {number} PROCESSING_ERROR_REASON_INVALID_KEK=22 PROCESSING_ERROR_REASON_INVALID_KEK value + * @property {number} PROCESSING_ERROR_REASON_WIP_AUTH_FAILED=23 PROCESSING_ERROR_REASON_WIP_AUTH_FAILED value + * @property {number} PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED=24 PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED value + * @property {number} PROCESSING_ERROR_REASON_AWS_AUTH_FAILED=27 PROCESSING_ERROR_REASON_AWS_AUTH_FAILED value + * @property {number} PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR=25 PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR value + * @property {number} PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER=26 PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER value + */ + v1.ProcessingErrorReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSING_ERROR_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE"] = 1; + values[valuesById[2] = "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED"] = 2; + values[valuesById[3] = "PROCESSING_ERROR_REASON_EVENT_TOO_OLD"] = 3; + values[valuesById[4] = "PROCESSING_ERROR_REASON_DENIED_CONSENT"] = 4; + values[valuesById[5] = "PROCESSING_ERROR_REASON_NO_CONSENT"] = 5; + values[valuesById[6] = "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT"] = 6; + values[valuesById[7] = "PROCESSING_ERROR_REASON_DUPLICATE_GCLID"] = 7; + values[valuesById[8] = "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID"] = 8; + values[valuesById[9] = "PROCESSING_ERROR_REASON_INVALID_GBRAID"] = 9; + values[valuesById[10] = "PROCESSING_ERROR_REASON_INVALID_GCLID"] = 10; + values[valuesById[11] = "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID"] = 11; + values[valuesById[12] = "PROCESSING_ERROR_REASON_INVALID_WBRAID"] = 12; + values[valuesById[13] = "PROCESSING_ERROR_REASON_INTERNAL_ERROR"] = 13; + values[valuesById[14] = "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED"] = 14; + values[valuesById[15] = "PROCESSING_ERROR_REASON_INVALID_EVENT"] = 15; + values[valuesById[16] = "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS"] = 16; + values[valuesById[17] = "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS"] = 17; + values[valuesById[18] = "PROCESSING_ERROR_REASON_INVALID_FORMAT"] = 18; + values[valuesById[19] = "PROCESSING_ERROR_REASON_DECRYPTION_ERROR"] = 19; + values[valuesById[20] = "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR"] = 20; + values[valuesById[21] = "PROCESSING_ERROR_REASON_INVALID_WIP"] = 21; + values[valuesById[22] = "PROCESSING_ERROR_REASON_INVALID_KEK"] = 22; + values[valuesById[23] = "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED"] = 23; + values[valuesById[24] = "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED"] = 24; + values[valuesById[27] = "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED"] = 27; + values[valuesById[25] = "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR"] = 25; + values[valuesById[26] = "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER"] = 26; + return values; + })(); + + /** + * ProcessingWarningReason enum. + * @name google.ads.datamanager.v1.ProcessingWarningReason + * @enum {number} + * @property {number} PROCESSING_WARNING_REASON_UNSPECIFIED=0 PROCESSING_WARNING_REASON_UNSPECIFIED value + * @property {number} PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED=1 PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED value + * @property {number} PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR=2 PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR value + * @property {number} PROCESSING_WARNING_REASON_DECRYPTION_ERROR=3 PROCESSING_WARNING_REASON_DECRYPTION_ERROR value + * @property {number} PROCESSING_WARNING_REASON_WIP_AUTH_FAILED=4 PROCESSING_WARNING_REASON_WIP_AUTH_FAILED value + * @property {number} PROCESSING_WARNING_REASON_INVALID_WIP=5 PROCESSING_WARNING_REASON_INVALID_WIP value + * @property {number} PROCESSING_WARNING_REASON_INVALID_KEK=6 PROCESSING_WARNING_REASON_INVALID_KEK value + * @property {number} PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR=7 PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR value + * @property {number} PROCESSING_WARNING_REASON_INTERNAL_ERROR=8 PROCESSING_WARNING_REASON_INTERNAL_ERROR value + * @property {number} PROCESSING_WARNING_REASON_AWS_AUTH_FAILED=9 PROCESSING_WARNING_REASON_AWS_AUTH_FAILED value + */ + v1.ProcessingWarningReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSING_WARNING_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED"] = 1; + values[valuesById[2] = "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR"] = 2; + values[valuesById[3] = "PROCESSING_WARNING_REASON_DECRYPTION_ERROR"] = 3; + values[valuesById[4] = "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED"] = 4; + values[valuesById[5] = "PROCESSING_WARNING_REASON_INVALID_WIP"] = 5; + values[valuesById[6] = "PROCESSING_WARNING_REASON_INVALID_KEK"] = 6; + values[valuesById[7] = "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR"] = 7; + values[valuesById[8] = "PROCESSING_WARNING_REASON_INTERNAL_ERROR"] = 8; + values[valuesById[9] = "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED"] = 9; + return values; + })(); + + v1.TermsOfService = (function() { + + /** + * Properties of a TermsOfService. + * @memberof google.ads.datamanager.v1 + * @interface ITermsOfService + * @property {google.ads.datamanager.v1.TermsOfServiceStatus|null} [customerMatchTermsOfServiceStatus] TermsOfService customerMatchTermsOfServiceStatus + */ + + /** + * Constructs a new TermsOfService. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a TermsOfService. + * @implements ITermsOfService + * @constructor + * @param {google.ads.datamanager.v1.ITermsOfService=} [properties] Properties to set + */ + function TermsOfService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TermsOfService customerMatchTermsOfServiceStatus. + * @member {google.ads.datamanager.v1.TermsOfServiceStatus} customerMatchTermsOfServiceStatus + * @memberof google.ads.datamanager.v1.TermsOfService + * @instance + */ + TermsOfService.prototype.customerMatchTermsOfServiceStatus = 0; + + /** + * Creates a new TermsOfService instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {google.ads.datamanager.v1.ITermsOfService=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService instance + */ + TermsOfService.create = function create(properties) { + return new TermsOfService(properties); + }; + + /** + * Encodes the specified TermsOfService message. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {google.ads.datamanager.v1.ITermsOfService} message TermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerMatchTermsOfServiceStatus != null && Object.hasOwnProperty.call(message, "customerMatchTermsOfServiceStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customerMatchTermsOfServiceStatus); + return writer; + }; + + /** + * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {google.ads.datamanager.v1.ITermsOfService} message TermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TermsOfService message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfService.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.TermsOfService(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customerMatchTermsOfServiceStatus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TermsOfService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TermsOfService message. + * @function verify + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TermsOfService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerMatchTermsOfServiceStatus != null && message.hasOwnProperty("customerMatchTermsOfServiceStatus")) + switch (message.customerMatchTermsOfServiceStatus) { + default: + return "customerMatchTermsOfServiceStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + */ + TermsOfService.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.TermsOfService) + return object; + var message = new $root.google.ads.datamanager.v1.TermsOfService(); + switch (object.customerMatchTermsOfServiceStatus) { + default: + if (typeof object.customerMatchTermsOfServiceStatus === "number") { + message.customerMatchTermsOfServiceStatus = object.customerMatchTermsOfServiceStatus; + break; + } + break; + case "TERMS_OF_SERVICE_STATUS_UNSPECIFIED": + case 0: + message.customerMatchTermsOfServiceStatus = 0; + break; + case "ACCEPTED": + case 1: + message.customerMatchTermsOfServiceStatus = 1; + break; + case "REJECTED": + case 2: + message.customerMatchTermsOfServiceStatus = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {google.ads.datamanager.v1.TermsOfService} message TermsOfService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TermsOfService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customerMatchTermsOfServiceStatus = options.enums === String ? "TERMS_OF_SERVICE_STATUS_UNSPECIFIED" : 0; + if (message.customerMatchTermsOfServiceStatus != null && message.hasOwnProperty("customerMatchTermsOfServiceStatus")) + object.customerMatchTermsOfServiceStatus = options.enums === String ? $root.google.ads.datamanager.v1.TermsOfServiceStatus[message.customerMatchTermsOfServiceStatus] === undefined ? message.customerMatchTermsOfServiceStatus : $root.google.ads.datamanager.v1.TermsOfServiceStatus[message.customerMatchTermsOfServiceStatus] : message.customerMatchTermsOfServiceStatus; + return object; + }; + + /** + * Converts this TermsOfService to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.TermsOfService + * @instance + * @returns {Object.} JSON object + */ + TermsOfService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TermsOfService + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.TermsOfService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.TermsOfService"; + }; + + return TermsOfService; + })(); + + /** + * TermsOfServiceStatus enum. + * @name google.ads.datamanager.v1.TermsOfServiceStatus + * @enum {number} + * @property {number} TERMS_OF_SERVICE_STATUS_UNSPECIFIED=0 TERMS_OF_SERVICE_STATUS_UNSPECIFIED value + * @property {number} ACCEPTED=1 ACCEPTED value + * @property {number} REJECTED=2 REJECTED value + */ + v1.TermsOfServiceStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TERMS_OF_SERVICE_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCEPTED"] = 1; + values[valuesById[2] = "REJECTED"] = 2; + return values; + })(); + + v1.MarketingDataInsightsService = (function() { + + /** + * Constructs a new MarketingDataInsightsService service. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a MarketingDataInsightsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function MarketingDataInsightsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MarketingDataInsightsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MarketingDataInsightsService; + + /** + * Creates new MarketingDataInsightsService service using the specified rpc implementation. + * @function create + * @memberof google.ads.datamanager.v1.MarketingDataInsightsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {MarketingDataInsightsService} RPC service. Useful where requests and/or responses are streamed. + */ + MarketingDataInsightsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ads.datamanager.v1.MarketingDataInsightsService|retrieveInsights}. + * @memberof google.ads.datamanager.v1.MarketingDataInsightsService + * @typedef RetrieveInsightsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse} [response] RetrieveInsightsResponse + */ + + /** + * Calls RetrieveInsights. + * @function retrieveInsights + * @memberof google.ads.datamanager.v1.MarketingDataInsightsService + * @instance + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest} request RetrieveInsightsRequest message or plain object + * @param {google.ads.datamanager.v1.MarketingDataInsightsService.RetrieveInsightsCallback} callback Node-style callback called with the error, if any, and RetrieveInsightsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MarketingDataInsightsService.prototype.retrieveInsights = function retrieveInsights(request, callback) { + return this.rpcCall(retrieveInsights, $root.google.ads.datamanager.v1.RetrieveInsightsRequest, $root.google.ads.datamanager.v1.RetrieveInsightsResponse, request, callback); + }, "name", { value: "RetrieveInsights" }); + + /** + * Calls RetrieveInsights. + * @function retrieveInsights + * @memberof google.ads.datamanager.v1.MarketingDataInsightsService + * @instance + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest} request RetrieveInsightsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MarketingDataInsightsService; + })(); + + v1.RetrieveInsightsRequest = (function() { + + /** + * Properties of a RetrieveInsightsRequest. + * @memberof google.ads.datamanager.v1 + * @interface IRetrieveInsightsRequest + * @property {string|null} [parent] RetrieveInsightsRequest parent + * @property {google.ads.datamanager.v1.IBaseline|null} [baseline] RetrieveInsightsRequest baseline + * @property {string|null} [userListId] RetrieveInsightsRequest userListId + */ + + /** + * Constructs a new RetrieveInsightsRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a RetrieveInsightsRequest. + * @implements IRetrieveInsightsRequest + * @constructor + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest=} [properties] Properties to set + */ + function RetrieveInsightsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveInsightsRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @instance + */ + RetrieveInsightsRequest.prototype.parent = ""; + + /** + * RetrieveInsightsRequest baseline. + * @member {google.ads.datamanager.v1.IBaseline|null|undefined} baseline + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @instance + */ + RetrieveInsightsRequest.prototype.baseline = null; + + /** + * RetrieveInsightsRequest userListId. + * @member {string} userListId + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @instance + */ + RetrieveInsightsRequest.prototype.userListId = ""; + + /** + * Creates a new RetrieveInsightsRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RetrieveInsightsRequest} RetrieveInsightsRequest instance + */ + RetrieveInsightsRequest.create = function create(properties) { + return new RetrieveInsightsRequest(properties); + }; + + /** + * Encodes the specified RetrieveInsightsRequest message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest} message RetrieveInsightsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveInsightsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.baseline != null && Object.hasOwnProperty.call(message, "baseline")) + $root.google.ads.datamanager.v1.Baseline.encode(message.baseline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.userListId != null && Object.hasOwnProperty.call(message, "userListId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userListId); + return writer; + }; + + /** + * Encodes the specified RetrieveInsightsRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsRequest} message RetrieveInsightsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveInsightsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveInsightsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RetrieveInsightsRequest} RetrieveInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveInsightsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RetrieveInsightsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.baseline = $root.google.ads.datamanager.v1.Baseline.decode(reader, reader.uint32()); + break; + } + case 3: { + message.userListId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveInsightsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RetrieveInsightsRequest} RetrieveInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveInsightsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveInsightsRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveInsightsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.baseline != null && message.hasOwnProperty("baseline")) { + var error = $root.google.ads.datamanager.v1.Baseline.verify(message.baseline); + if (error) + return "baseline." + error; + } + if (message.userListId != null && message.hasOwnProperty("userListId")) + if (!$util.isString(message.userListId)) + return "userListId: string expected"; + return null; + }; + + /** + * Creates a RetrieveInsightsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RetrieveInsightsRequest} RetrieveInsightsRequest + */ + RetrieveInsightsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RetrieveInsightsRequest) + return object; + var message = new $root.google.ads.datamanager.v1.RetrieveInsightsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.baseline != null) { + if (typeof object.baseline !== "object") + throw TypeError(".google.ads.datamanager.v1.RetrieveInsightsRequest.baseline: object expected"); + message.baseline = $root.google.ads.datamanager.v1.Baseline.fromObject(object.baseline); + } + if (object.userListId != null) + message.userListId = String(object.userListId); + return message; + }; + + /** + * Creates a plain object from a RetrieveInsightsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsRequest} message RetrieveInsightsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveInsightsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.baseline = null; + object.userListId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.baseline != null && message.hasOwnProperty("baseline")) + object.baseline = $root.google.ads.datamanager.v1.Baseline.toObject(message.baseline, options); + if (message.userListId != null && message.hasOwnProperty("userListId")) + object.userListId = message.userListId; + return object; + }; + + /** + * Converts this RetrieveInsightsRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveInsightsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveInsightsRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RetrieveInsightsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveInsightsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RetrieveInsightsRequest"; + }; + + return RetrieveInsightsRequest; + })(); + + v1.Baseline = (function() { + + /** + * Properties of a Baseline. + * @memberof google.ads.datamanager.v1 + * @interface IBaseline + * @property {google.ads.datamanager.v1.Baseline.ILocation|null} [baselineLocation] Baseline baselineLocation + * @property {boolean|null} [locationAutoDetectionEnabled] Baseline locationAutoDetectionEnabled + */ + + /** + * Constructs a new Baseline. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a Baseline. + * @implements IBaseline + * @constructor + * @param {google.ads.datamanager.v1.IBaseline=} [properties] Properties to set + */ + function Baseline(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Baseline baselineLocation. + * @member {google.ads.datamanager.v1.Baseline.ILocation|null|undefined} baselineLocation + * @memberof google.ads.datamanager.v1.Baseline + * @instance + */ + Baseline.prototype.baselineLocation = null; + + /** + * Baseline locationAutoDetectionEnabled. + * @member {boolean|null|undefined} locationAutoDetectionEnabled + * @memberof google.ads.datamanager.v1.Baseline + * @instance + */ + Baseline.prototype.locationAutoDetectionEnabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Baseline baseline. + * @member {"baselineLocation"|"locationAutoDetectionEnabled"|undefined} baseline + * @memberof google.ads.datamanager.v1.Baseline + * @instance + */ + Object.defineProperty(Baseline.prototype, "baseline", { + get: $util.oneOfGetter($oneOfFields = ["baselineLocation", "locationAutoDetectionEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Baseline instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {google.ads.datamanager.v1.IBaseline=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.Baseline} Baseline instance + */ + Baseline.create = function create(properties) { + return new Baseline(properties); + }; + + /** + * Encodes the specified Baseline message. Does not implicitly {@link google.ads.datamanager.v1.Baseline.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {google.ads.datamanager.v1.IBaseline} message Baseline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Baseline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baselineLocation != null && Object.hasOwnProperty.call(message, "baselineLocation")) + $root.google.ads.datamanager.v1.Baseline.Location.encode(message.baselineLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.locationAutoDetectionEnabled != null && Object.hasOwnProperty.call(message, "locationAutoDetectionEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.locationAutoDetectionEnabled); + return writer; + }; + + /** + * Encodes the specified Baseline message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.Baseline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {google.ads.datamanager.v1.IBaseline} message Baseline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Baseline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Baseline message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.Baseline} Baseline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Baseline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.Baseline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baselineLocation = $root.google.ads.datamanager.v1.Baseline.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.locationAutoDetectionEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Baseline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.Baseline} Baseline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Baseline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Baseline message. + * @function verify + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Baseline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.baselineLocation != null && message.hasOwnProperty("baselineLocation")) { + properties.baseline = 1; + { + var error = $root.google.ads.datamanager.v1.Baseline.Location.verify(message.baselineLocation); + if (error) + return "baselineLocation." + error; + } + } + if (message.locationAutoDetectionEnabled != null && message.hasOwnProperty("locationAutoDetectionEnabled")) { + if (properties.baseline === 1) + return "baseline: multiple values"; + properties.baseline = 1; + if (typeof message.locationAutoDetectionEnabled !== "boolean") + return "locationAutoDetectionEnabled: boolean expected"; + } + return null; + }; + + /** + * Creates a Baseline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.Baseline} Baseline + */ + Baseline.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.Baseline) + return object; + var message = new $root.google.ads.datamanager.v1.Baseline(); + if (object.baselineLocation != null) { + if (typeof object.baselineLocation !== "object") + throw TypeError(".google.ads.datamanager.v1.Baseline.baselineLocation: object expected"); + message.baselineLocation = $root.google.ads.datamanager.v1.Baseline.Location.fromObject(object.baselineLocation); + } + if (object.locationAutoDetectionEnabled != null) + message.locationAutoDetectionEnabled = Boolean(object.locationAutoDetectionEnabled); + return message; + }; + + /** + * Creates a plain object from a Baseline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {google.ads.datamanager.v1.Baseline} message Baseline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Baseline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.baselineLocation != null && message.hasOwnProperty("baselineLocation")) { + object.baselineLocation = $root.google.ads.datamanager.v1.Baseline.Location.toObject(message.baselineLocation, options); + if (options.oneofs) + object.baseline = "baselineLocation"; + } + if (message.locationAutoDetectionEnabled != null && message.hasOwnProperty("locationAutoDetectionEnabled")) { + object.locationAutoDetectionEnabled = message.locationAutoDetectionEnabled; + if (options.oneofs) + object.baseline = "locationAutoDetectionEnabled"; + } + return object; + }; + + /** + * Converts this Baseline to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.Baseline + * @instance + * @returns {Object.} JSON object + */ + Baseline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Baseline + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.Baseline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Baseline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.Baseline"; + }; + + Baseline.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.ads.datamanager.v1.Baseline + * @interface ILocation + * @property {Array.|null} [regionCodes] Location regionCodes + */ + + /** + * Constructs a new Location. + * @memberof google.ads.datamanager.v1.Baseline + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.ads.datamanager.v1.Baseline.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.regionCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location regionCodes. + * @member {Array.} regionCodes + * @memberof google.ads.datamanager.v1.Baseline.Location + * @instance + */ + Location.prototype.regionCodes = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {google.ads.datamanager.v1.Baseline.ILocation=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.Baseline.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.ads.datamanager.v1.Baseline.Location.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {google.ads.datamanager.v1.Baseline.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCodes != null && message.regionCodes.length) + for (var i = 0; i < message.regionCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCodes[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.Baseline.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {google.ads.datamanager.v1.Baseline.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.Baseline.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.Baseline.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.regionCodes && message.regionCodes.length)) + message.regionCodes = []; + message.regionCodes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.Baseline.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCodes != null && message.hasOwnProperty("regionCodes")) { + if (!Array.isArray(message.regionCodes)) + return "regionCodes: array expected"; + for (var i = 0; i < message.regionCodes.length; ++i) + if (!$util.isString(message.regionCodes[i])) + return "regionCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.Baseline.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.Baseline.Location) + return object; + var message = new $root.google.ads.datamanager.v1.Baseline.Location(); + if (object.regionCodes) { + if (!Array.isArray(object.regionCodes)) + throw TypeError(".google.ads.datamanager.v1.Baseline.Location.regionCodes: array expected"); + message.regionCodes = []; + for (var i = 0; i < object.regionCodes.length; ++i) + message.regionCodes[i] = String(object.regionCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {google.ads.datamanager.v1.Baseline.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regionCodes = []; + if (message.regionCodes && message.regionCodes.length) { + object.regionCodes = []; + for (var j = 0; j < message.regionCodes.length; ++j) + object.regionCodes[j] = message.regionCodes[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.Baseline.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.Baseline.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.Baseline.Location"; + }; + + return Location; + })(); + + return Baseline; + })(); + + v1.RetrieveInsightsResponse = (function() { + + /** + * Properties of a RetrieveInsightsResponse. + * @memberof google.ads.datamanager.v1 + * @interface IRetrieveInsightsResponse + * @property {Array.|null} [marketingDataInsights] RetrieveInsightsResponse marketingDataInsights + */ + + /** + * Constructs a new RetrieveInsightsResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a RetrieveInsightsResponse. + * @implements IRetrieveInsightsResponse + * @constructor + * @param {google.ads.datamanager.v1.IRetrieveInsightsResponse=} [properties] Properties to set + */ + function RetrieveInsightsResponse(properties) { + this.marketingDataInsights = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveInsightsResponse marketingDataInsights. + * @member {Array.} marketingDataInsights + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @instance + */ + RetrieveInsightsResponse.prototype.marketingDataInsights = $util.emptyArray; + + /** + * Creates a new RetrieveInsightsResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse} RetrieveInsightsResponse instance + */ + RetrieveInsightsResponse.create = function create(properties) { + return new RetrieveInsightsResponse(properties); + }; + + /** + * Encodes the specified RetrieveInsightsResponse message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsResponse} message RetrieveInsightsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveInsightsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.marketingDataInsights != null && message.marketingDataInsights.length) + for (var i = 0; i < message.marketingDataInsights.length; ++i) + $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.encode(message.marketingDataInsights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveInsightsResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {google.ads.datamanager.v1.IRetrieveInsightsResponse} message RetrieveInsightsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveInsightsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveInsightsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse} RetrieveInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveInsightsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.marketingDataInsights && message.marketingDataInsights.length)) + message.marketingDataInsights = []; + message.marketingDataInsights.push($root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveInsightsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse} RetrieveInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveInsightsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveInsightsResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveInsightsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.marketingDataInsights != null && message.hasOwnProperty("marketingDataInsights")) { + if (!Array.isArray(message.marketingDataInsights)) + return "marketingDataInsights: array expected"; + for (var i = 0; i < message.marketingDataInsights.length; ++i) { + var error = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.verify(message.marketingDataInsights[i]); + if (error) + return "marketingDataInsights." + error; + } + } + return null; + }; + + /** + * Creates a RetrieveInsightsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse} RetrieveInsightsResponse + */ + RetrieveInsightsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RetrieveInsightsResponse) + return object; + var message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse(); + if (object.marketingDataInsights) { + if (!Array.isArray(object.marketingDataInsights)) + throw TypeError(".google.ads.datamanager.v1.RetrieveInsightsResponse.marketingDataInsights: array expected"); + message.marketingDataInsights = []; + for (var i = 0; i < object.marketingDataInsights.length; ++i) { + if (typeof object.marketingDataInsights[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.RetrieveInsightsResponse.marketingDataInsights: object expected"); + message.marketingDataInsights[i] = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.fromObject(object.marketingDataInsights[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RetrieveInsightsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse} message RetrieveInsightsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveInsightsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.marketingDataInsights = []; + if (message.marketingDataInsights && message.marketingDataInsights.length) { + object.marketingDataInsights = []; + for (var j = 0; j < message.marketingDataInsights.length; ++j) + object.marketingDataInsights[j] = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.toObject(message.marketingDataInsights[j], options); + } + return object; + }; + + /** + * Converts this RetrieveInsightsResponse to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveInsightsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveInsightsResponse + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveInsightsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RetrieveInsightsResponse"; + }; + + RetrieveInsightsResponse.MarketingDataInsight = (function() { + + /** + * Properties of a MarketingDataInsight. + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @interface IMarketingDataInsight + * @property {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension|null} [dimension] MarketingDataInsight dimension + * @property {Array.|null} [attributes] MarketingDataInsight attributes + */ + + /** + * Constructs a new MarketingDataInsight. + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse + * @classdesc Represents a MarketingDataInsight. + * @implements IMarketingDataInsight + * @constructor + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight=} [properties] Properties to set + */ + function MarketingDataInsight(properties) { + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarketingDataInsight dimension. + * @member {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension} dimension + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @instance + */ + MarketingDataInsight.prototype.dimension = 0; + + /** + * MarketingDataInsight attributes. + * @member {Array.} attributes + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @instance + */ + MarketingDataInsight.prototype.attributes = $util.emptyArray; + + /** + * Creates a new MarketingDataInsight instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight} MarketingDataInsight instance + */ + MarketingDataInsight.create = function create(properties) { + return new MarketingDataInsight(properties); + }; + + /** + * Encodes the specified MarketingDataInsight message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight} message MarketingDataInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingDataInsight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dimension); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MarketingDataInsight message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.IMarketingDataInsight} message MarketingDataInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingDataInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarketingDataInsight message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight} MarketingDataInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingDataInsight.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dimension = reader.int32(); + break; + } + case 2: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarketingDataInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight} MarketingDataInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingDataInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarketingDataInsight message. + * @function verify + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarketingDataInsight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimension != null && message.hasOwnProperty("dimension")) + switch (message.dimension) { + default: + return "dimension: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a MarketingDataInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight} MarketingDataInsight + */ + MarketingDataInsight.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight) + return object; + var message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight(); + switch (object.dimension) { + default: + if (typeof object.dimension === "number") { + message.dimension = object.dimension; + break; + } + break; + case "AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED": + case 0: + message.dimension = 0; + break; + case "AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN": + case 1: + message.dimension = 1; + break; + case "AFFINITY_USER_INTEREST": + case 2: + message.dimension = 2; + break; + case "IN_MARKET_USER_INTEREST": + case 3: + message.dimension = 3; + break; + case "AGE_RANGE": + case 4: + message.dimension = 4; + break; + case "GENDER": + case 5: + message.dimension = 5; + break; + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.attributes: object expected"); + message.attributes[i] = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.fromObject(object.attributes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MarketingDataInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight} message MarketingDataInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarketingDataInsight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.dimension = options.enums === String ? "AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED" : 0; + if (message.dimension != null && message.hasOwnProperty("dimension")) + object.dimension = options.enums === String ? $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension[message.dimension] === undefined ? message.dimension : $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension[message.dimension] : message.dimension; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.toObject(message.attributes[j], options); + } + return object; + }; + + /** + * Converts this MarketingDataInsight to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @instance + * @returns {Object.} JSON object + */ + MarketingDataInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarketingDataInsight + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarketingDataInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight"; + }; + + /** + * AudienceInsightsDimension enum. + * @name google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.AudienceInsightsDimension + * @enum {number} + * @property {number} AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED=0 AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED value + * @property {number} AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN=1 AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN value + * @property {number} AFFINITY_USER_INTEREST=2 AFFINITY_USER_INTEREST value + * @property {number} IN_MARKET_USER_INTEREST=3 IN_MARKET_USER_INTEREST value + * @property {number} AGE_RANGE=4 AGE_RANGE value + * @property {number} GENDER=5 GENDER value + */ + MarketingDataInsight.AudienceInsightsDimension = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN"] = 1; + values[valuesById[2] = "AFFINITY_USER_INTEREST"] = 2; + values[valuesById[3] = "IN_MARKET_USER_INTEREST"] = 3; + values[valuesById[4] = "AGE_RANGE"] = 4; + values[valuesById[5] = "GENDER"] = 5; + return values; + })(); + + MarketingDataInsight.MarketingDataInsightsAttribute = (function() { + + /** + * Properties of a MarketingDataInsightsAttribute. + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @interface IMarketingDataInsightsAttribute + * @property {number|Long|null} [userInterestId] MarketingDataInsightsAttribute userInterestId + * @property {number|null} [lift] MarketingDataInsightsAttribute lift + * @property {google.ads.datamanager.v1.AgeRange|null} [ageRange] MarketingDataInsightsAttribute ageRange + * @property {google.ads.datamanager.v1.Gender|null} [gender] MarketingDataInsightsAttribute gender + */ + + /** + * Constructs a new MarketingDataInsightsAttribute. + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight + * @classdesc Represents a MarketingDataInsightsAttribute. + * @implements IMarketingDataInsightsAttribute + * @constructor + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute=} [properties] Properties to set + */ + function MarketingDataInsightsAttribute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarketingDataInsightsAttribute userInterestId. + * @member {number|Long|null|undefined} userInterestId + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @instance + */ + MarketingDataInsightsAttribute.prototype.userInterestId = null; + + /** + * MarketingDataInsightsAttribute lift. + * @member {number|null|undefined} lift + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @instance + */ + MarketingDataInsightsAttribute.prototype.lift = null; + + /** + * MarketingDataInsightsAttribute ageRange. + * @member {google.ads.datamanager.v1.AgeRange|null|undefined} ageRange + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @instance + */ + MarketingDataInsightsAttribute.prototype.ageRange = null; + + /** + * MarketingDataInsightsAttribute gender. + * @member {google.ads.datamanager.v1.Gender|null|undefined} gender + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @instance + */ + MarketingDataInsightsAttribute.prototype.gender = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingDataInsightsAttribute.prototype, "_userInterestId", { + get: $util.oneOfGetter($oneOfFields = ["userInterestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingDataInsightsAttribute.prototype, "_lift", { + get: $util.oneOfGetter($oneOfFields = ["lift"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingDataInsightsAttribute.prototype, "_ageRange", { + get: $util.oneOfGetter($oneOfFields = ["ageRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MarketingDataInsightsAttribute.prototype, "_gender", { + get: $util.oneOfGetter($oneOfFields = ["gender"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MarketingDataInsightsAttribute instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute} MarketingDataInsightsAttribute instance + */ + MarketingDataInsightsAttribute.create = function create(properties) { + return new MarketingDataInsightsAttribute(properties); + }; + + /** + * Encodes the specified MarketingDataInsightsAttribute message. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute} message MarketingDataInsightsAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingDataInsightsAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInterestId != null && Object.hasOwnProperty.call(message, "userInterestId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.userInterestId); + if (message.lift != null && Object.hasOwnProperty.call(message, "lift")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.lift); + if (message.ageRange != null && Object.hasOwnProperty.call(message, "ageRange")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ageRange); + if (message.gender != null && Object.hasOwnProperty.call(message, "gender")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.gender); + return writer; + }; + + /** + * Encodes the specified MarketingDataInsightsAttribute message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.IMarketingDataInsightsAttribute} message MarketingDataInsightsAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingDataInsightsAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarketingDataInsightsAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute} MarketingDataInsightsAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingDataInsightsAttribute.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInterestId = reader.int64(); + break; + } + case 2: { + message.lift = reader.float(); + break; + } + case 3: { + message.ageRange = reader.int32(); + break; + } + case 4: { + message.gender = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarketingDataInsightsAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute} MarketingDataInsightsAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingDataInsightsAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarketingDataInsightsAttribute message. + * @function verify + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarketingDataInsightsAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.userInterestId != null && message.hasOwnProperty("userInterestId")) { + properties._userInterestId = 1; + if (!$util.isInteger(message.userInterestId) && !(message.userInterestId && $util.isInteger(message.userInterestId.low) && $util.isInteger(message.userInterestId.high))) + return "userInterestId: integer|Long expected"; + } + if (message.lift != null && message.hasOwnProperty("lift")) { + properties._lift = 1; + if (typeof message.lift !== "number") + return "lift: number expected"; + } + if (message.ageRange != null && message.hasOwnProperty("ageRange")) { + properties._ageRange = 1; + switch (message.ageRange) { + default: + return "ageRange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.gender != null && message.hasOwnProperty("gender")) { + properties._gender = 1; + switch (message.gender) { + default: + return "gender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a MarketingDataInsightsAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute} MarketingDataInsightsAttribute + */ + MarketingDataInsightsAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute) + return object; + var message = new $root.google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute(); + if (object.userInterestId != null) + if ($util.Long) + (message.userInterestId = $util.Long.fromValue(object.userInterestId)).unsigned = false; + else if (typeof object.userInterestId === "string") + message.userInterestId = parseInt(object.userInterestId, 10); + else if (typeof object.userInterestId === "number") + message.userInterestId = object.userInterestId; + else if (typeof object.userInterestId === "object") + message.userInterestId = new $util.LongBits(object.userInterestId.low >>> 0, object.userInterestId.high >>> 0).toNumber(); + if (object.lift != null) + message.lift = Number(object.lift); + switch (object.ageRange) { + default: + if (typeof object.ageRange === "number") { + message.ageRange = object.ageRange; + break; + } + break; + case "AGE_RANGE_UNSPECIFIED": + case 0: + message.ageRange = 0; + break; + case "AGE_RANGE_UNKNOWN": + case 1: + message.ageRange = 1; + break; + case "AGE_RANGE_18_24": + case 2: + message.ageRange = 2; + break; + case "AGE_RANGE_25_34": + case 3: + message.ageRange = 3; + break; + case "AGE_RANGE_35_44": + case 4: + message.ageRange = 4; + break; + case "AGE_RANGE_45_54": + case 5: + message.ageRange = 5; + break; + case "AGE_RANGE_55_64": + case 6: + message.ageRange = 6; + break; + case "AGE_RANGE_65_UP": + case 7: + message.ageRange = 7; + break; + } + switch (object.gender) { + default: + if (typeof object.gender === "number") { + message.gender = object.gender; + break; + } + break; + case "GENDER_UNSPECIFIED": + case 0: + message.gender = 0; + break; + case "GENDER_UNKNOWN": + case 1: + message.gender = 1; + break; + case "GENDER_MALE": + case 2: + message.gender = 2; + break; + case "GENDER_FEMALE": + case 3: + message.gender = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a MarketingDataInsightsAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute} message MarketingDataInsightsAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarketingDataInsightsAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.userInterestId != null && message.hasOwnProperty("userInterestId")) { + if (typeof message.userInterestId === "number") + object.userInterestId = options.longs === String ? String(message.userInterestId) : message.userInterestId; + else + object.userInterestId = options.longs === String ? $util.Long.prototype.toString.call(message.userInterestId) : options.longs === Number ? new $util.LongBits(message.userInterestId.low >>> 0, message.userInterestId.high >>> 0).toNumber() : message.userInterestId; + if (options.oneofs) + object._userInterestId = "userInterestId"; + } + if (message.lift != null && message.hasOwnProperty("lift")) { + object.lift = options.json && !isFinite(message.lift) ? String(message.lift) : message.lift; + if (options.oneofs) + object._lift = "lift"; + } + if (message.ageRange != null && message.hasOwnProperty("ageRange")) { + object.ageRange = options.enums === String ? $root.google.ads.datamanager.v1.AgeRange[message.ageRange] === undefined ? message.ageRange : $root.google.ads.datamanager.v1.AgeRange[message.ageRange] : message.ageRange; + if (options.oneofs) + object._ageRange = "ageRange"; + } + if (message.gender != null && message.hasOwnProperty("gender")) { + object.gender = options.enums === String ? $root.google.ads.datamanager.v1.Gender[message.gender] === undefined ? message.gender : $root.google.ads.datamanager.v1.Gender[message.gender] : message.gender; + if (options.oneofs) + object._gender = "gender"; + } + return object; + }; + + /** + * Converts this MarketingDataInsightsAttribute to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @instance + * @returns {Object.} JSON object + */ + MarketingDataInsightsAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarketingDataInsightsAttribute + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarketingDataInsightsAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.RetrieveInsightsResponse.MarketingDataInsight.MarketingDataInsightsAttribute"; + }; + + return MarketingDataInsightsAttribute; + })(); + + return MarketingDataInsight; + })(); + + return RetrieveInsightsResponse; + })(); + + v1.PartnerLinkService = (function() { + + /** + * Constructs a new PartnerLinkService service. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PartnerLinkService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function PartnerLinkService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PartnerLinkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PartnerLinkService; + + /** + * Creates new PartnerLinkService service using the specified rpc implementation. + * @function create + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {PartnerLinkService} RPC service. Useful where requests and/or responses are streamed. + */ + PartnerLinkService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|createPartnerLink}. + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @typedef CreatePartnerLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.PartnerLink} [response] PartnerLink + */ + + /** + * Calls CreatePartnerLink. + * @function createPartnerLink + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest} request CreatePartnerLinkRequest message or plain object + * @param {google.ads.datamanager.v1.PartnerLinkService.CreatePartnerLinkCallback} callback Node-style callback called with the error, if any, and PartnerLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PartnerLinkService.prototype.createPartnerLink = function createPartnerLink(request, callback) { + return this.rpcCall(createPartnerLink, $root.google.ads.datamanager.v1.CreatePartnerLinkRequest, $root.google.ads.datamanager.v1.PartnerLink, request, callback); + }, "name", { value: "CreatePartnerLink" }); + + /** + * Calls CreatePartnerLink. + * @function createPartnerLink + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest} request CreatePartnerLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|deletePartnerLink}. + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @typedef DeletePartnerLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePartnerLink. + * @function deletePartnerLink + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest} request DeletePartnerLinkRequest message or plain object + * @param {google.ads.datamanager.v1.PartnerLinkService.DeletePartnerLinkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PartnerLinkService.prototype.deletePartnerLink = function deletePartnerLink(request, callback) { + return this.rpcCall(deletePartnerLink, $root.google.ads.datamanager.v1.DeletePartnerLinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePartnerLink" }); + + /** + * Calls DeletePartnerLink. + * @function deletePartnerLink + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest} request DeletePartnerLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.PartnerLinkService|searchPartnerLinks}. + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @typedef SearchPartnerLinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.SearchPartnerLinksResponse} [response] SearchPartnerLinksResponse + */ + + /** + * Calls SearchPartnerLinks. + * @function searchPartnerLinks + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest} request SearchPartnerLinksRequest message or plain object + * @param {google.ads.datamanager.v1.PartnerLinkService.SearchPartnerLinksCallback} callback Node-style callback called with the error, if any, and SearchPartnerLinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PartnerLinkService.prototype.searchPartnerLinks = function searchPartnerLinks(request, callback) { + return this.rpcCall(searchPartnerLinks, $root.google.ads.datamanager.v1.SearchPartnerLinksRequest, $root.google.ads.datamanager.v1.SearchPartnerLinksResponse, request, callback); + }, "name", { value: "SearchPartnerLinks" }); + + /** + * Calls SearchPartnerLinks. + * @function searchPartnerLinks + * @memberof google.ads.datamanager.v1.PartnerLinkService + * @instance + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest} request SearchPartnerLinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PartnerLinkService; + })(); + + v1.CreatePartnerLinkRequest = (function() { + + /** + * Properties of a CreatePartnerLinkRequest. + * @memberof google.ads.datamanager.v1 + * @interface ICreatePartnerLinkRequest + * @property {string|null} [parent] CreatePartnerLinkRequest parent + * @property {google.ads.datamanager.v1.IPartnerLink|null} [partnerLink] CreatePartnerLinkRequest partnerLink + */ + + /** + * Constructs a new CreatePartnerLinkRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a CreatePartnerLinkRequest. + * @implements ICreatePartnerLinkRequest + * @constructor + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest=} [properties] Properties to set + */ + function CreatePartnerLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePartnerLinkRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @instance + */ + CreatePartnerLinkRequest.prototype.parent = ""; + + /** + * CreatePartnerLinkRequest partnerLink. + * @member {google.ads.datamanager.v1.IPartnerLink|null|undefined} partnerLink + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @instance + */ + CreatePartnerLinkRequest.prototype.partnerLink = null; + + /** + * Creates a new CreatePartnerLinkRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.CreatePartnerLinkRequest} CreatePartnerLinkRequest instance + */ + CreatePartnerLinkRequest.create = function create(properties) { + return new CreatePartnerLinkRequest(properties); + }; + + /** + * Encodes the specified CreatePartnerLinkRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreatePartnerLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest} message CreatePartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePartnerLinkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.partnerLink != null && Object.hasOwnProperty.call(message, "partnerLink")) + $root.google.ads.datamanager.v1.PartnerLink.encode(message.partnerLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePartnerLinkRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreatePartnerLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.ICreatePartnerLinkRequest} message CreatePartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePartnerLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePartnerLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.CreatePartnerLinkRequest} CreatePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePartnerLinkRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.CreatePartnerLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.partnerLink = $root.google.ads.datamanager.v1.PartnerLink.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePartnerLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.CreatePartnerLinkRequest} CreatePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePartnerLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePartnerLinkRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePartnerLinkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.partnerLink != null && message.hasOwnProperty("partnerLink")) { + var error = $root.google.ads.datamanager.v1.PartnerLink.verify(message.partnerLink); + if (error) + return "partnerLink." + error; + } + return null; + }; + + /** + * Creates a CreatePartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.CreatePartnerLinkRequest} CreatePartnerLinkRequest + */ + CreatePartnerLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.CreatePartnerLinkRequest) + return object; + var message = new $root.google.ads.datamanager.v1.CreatePartnerLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.partnerLink != null) { + if (typeof object.partnerLink !== "object") + throw TypeError(".google.ads.datamanager.v1.CreatePartnerLinkRequest.partnerLink: object expected"); + message.partnerLink = $root.google.ads.datamanager.v1.PartnerLink.fromObject(object.partnerLink); + } + return message; + }; + + /** + * Creates a plain object from a CreatePartnerLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.CreatePartnerLinkRequest} message CreatePartnerLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePartnerLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.partnerLink = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.partnerLink != null && message.hasOwnProperty("partnerLink")) + object.partnerLink = $root.google.ads.datamanager.v1.PartnerLink.toObject(message.partnerLink, options); + return object; + }; + + /** + * Converts this CreatePartnerLinkRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePartnerLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePartnerLinkRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.CreatePartnerLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePartnerLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.CreatePartnerLinkRequest"; + }; + + return CreatePartnerLinkRequest; + })(); + + v1.DeletePartnerLinkRequest = (function() { + + /** + * Properties of a DeletePartnerLinkRequest. + * @memberof google.ads.datamanager.v1 + * @interface IDeletePartnerLinkRequest + * @property {string|null} [name] DeletePartnerLinkRequest name + */ + + /** + * Constructs a new DeletePartnerLinkRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a DeletePartnerLinkRequest. + * @implements IDeletePartnerLinkRequest + * @constructor + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest=} [properties] Properties to set + */ + function DeletePartnerLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePartnerLinkRequest name. + * @member {string} name + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @instance + */ + DeletePartnerLinkRequest.prototype.name = ""; + + /** + * Creates a new DeletePartnerLinkRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.DeletePartnerLinkRequest} DeletePartnerLinkRequest instance + */ + DeletePartnerLinkRequest.create = function create(properties) { + return new DeletePartnerLinkRequest(properties); + }; + + /** + * Encodes the specified DeletePartnerLinkRequest message. Does not implicitly {@link google.ads.datamanager.v1.DeletePartnerLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest} message DeletePartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePartnerLinkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeletePartnerLinkRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.DeletePartnerLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.IDeletePartnerLinkRequest} message DeletePartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePartnerLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePartnerLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.DeletePartnerLinkRequest} DeletePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePartnerLinkRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.DeletePartnerLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePartnerLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.DeletePartnerLinkRequest} DeletePartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePartnerLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePartnerLinkRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePartnerLinkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.DeletePartnerLinkRequest} DeletePartnerLinkRequest + */ + DeletePartnerLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.DeletePartnerLinkRequest) + return object; + var message = new $root.google.ads.datamanager.v1.DeletePartnerLinkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePartnerLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {google.ads.datamanager.v1.DeletePartnerLinkRequest} message DeletePartnerLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePartnerLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeletePartnerLinkRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePartnerLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePartnerLinkRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.DeletePartnerLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePartnerLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.DeletePartnerLinkRequest"; + }; + + return DeletePartnerLinkRequest; + })(); + + v1.SearchPartnerLinksRequest = (function() { + + /** + * Properties of a SearchPartnerLinksRequest. + * @memberof google.ads.datamanager.v1 + * @interface ISearchPartnerLinksRequest + * @property {string|null} [parent] SearchPartnerLinksRequest parent + * @property {number|null} [pageSize] SearchPartnerLinksRequest pageSize + * @property {string|null} [pageToken] SearchPartnerLinksRequest pageToken + * @property {string|null} [filter] SearchPartnerLinksRequest filter + */ + + /** + * Constructs a new SearchPartnerLinksRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a SearchPartnerLinksRequest. + * @implements ISearchPartnerLinksRequest + * @constructor + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest=} [properties] Properties to set + */ + function SearchPartnerLinksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchPartnerLinksRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @instance + */ + SearchPartnerLinksRequest.prototype.parent = ""; + + /** + * SearchPartnerLinksRequest pageSize. + * @member {number} pageSize + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @instance + */ + SearchPartnerLinksRequest.prototype.pageSize = 0; + + /** + * SearchPartnerLinksRequest pageToken. + * @member {string} pageToken + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @instance + */ + SearchPartnerLinksRequest.prototype.pageToken = ""; + + /** + * SearchPartnerLinksRequest filter. + * @member {string} filter + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @instance + */ + SearchPartnerLinksRequest.prototype.filter = ""; + + /** + * Creates a new SearchPartnerLinksRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.SearchPartnerLinksRequest} SearchPartnerLinksRequest instance + */ + SearchPartnerLinksRequest.create = function create(properties) { + return new SearchPartnerLinksRequest(properties); + }; + + /** + * Encodes the specified SearchPartnerLinksRequest message. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest} message SearchPartnerLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchPartnerLinksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified SearchPartnerLinksRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksRequest} message SearchPartnerLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchPartnerLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchPartnerLinksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.SearchPartnerLinksRequest} SearchPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchPartnerLinksRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.SearchPartnerLinksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchPartnerLinksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.SearchPartnerLinksRequest} SearchPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchPartnerLinksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchPartnerLinksRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchPartnerLinksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a SearchPartnerLinksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.SearchPartnerLinksRequest} SearchPartnerLinksRequest + */ + SearchPartnerLinksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.SearchPartnerLinksRequest) + return object; + var message = new $root.google.ads.datamanager.v1.SearchPartnerLinksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a SearchPartnerLinksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {google.ads.datamanager.v1.SearchPartnerLinksRequest} message SearchPartnerLinksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchPartnerLinksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this SearchPartnerLinksRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @instance + * @returns {Object.} JSON object + */ + SearchPartnerLinksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchPartnerLinksRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.SearchPartnerLinksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchPartnerLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.SearchPartnerLinksRequest"; + }; + + return SearchPartnerLinksRequest; + })(); + + v1.SearchPartnerLinksResponse = (function() { + + /** + * Properties of a SearchPartnerLinksResponse. + * @memberof google.ads.datamanager.v1 + * @interface ISearchPartnerLinksResponse + * @property {Array.|null} [partnerLinks] SearchPartnerLinksResponse partnerLinks + * @property {string|null} [nextPageToken] SearchPartnerLinksResponse nextPageToken + */ + + /** + * Constructs a new SearchPartnerLinksResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a SearchPartnerLinksResponse. + * @implements ISearchPartnerLinksResponse + * @constructor + * @param {google.ads.datamanager.v1.ISearchPartnerLinksResponse=} [properties] Properties to set + */ + function SearchPartnerLinksResponse(properties) { + this.partnerLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchPartnerLinksResponse partnerLinks. + * @member {Array.} partnerLinks + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @instance + */ + SearchPartnerLinksResponse.prototype.partnerLinks = $util.emptyArray; + + /** + * SearchPartnerLinksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @instance + */ + SearchPartnerLinksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchPartnerLinksResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.SearchPartnerLinksResponse} SearchPartnerLinksResponse instance + */ + SearchPartnerLinksResponse.create = function create(properties) { + return new SearchPartnerLinksResponse(properties); + }; + + /** + * Encodes the specified SearchPartnerLinksResponse message. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksResponse} message SearchPartnerLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchPartnerLinksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partnerLinks != null && message.partnerLinks.length) + for (var i = 0; i < message.partnerLinks.length; ++i) + $root.google.ads.datamanager.v1.PartnerLink.encode(message.partnerLinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchPartnerLinksResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SearchPartnerLinksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {google.ads.datamanager.v1.ISearchPartnerLinksResponse} message SearchPartnerLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchPartnerLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchPartnerLinksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.SearchPartnerLinksResponse} SearchPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchPartnerLinksResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.SearchPartnerLinksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.partnerLinks && message.partnerLinks.length)) + message.partnerLinks = []; + message.partnerLinks.push($root.google.ads.datamanager.v1.PartnerLink.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchPartnerLinksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.SearchPartnerLinksResponse} SearchPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchPartnerLinksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchPartnerLinksResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchPartnerLinksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partnerLinks != null && message.hasOwnProperty("partnerLinks")) { + if (!Array.isArray(message.partnerLinks)) + return "partnerLinks: array expected"; + for (var i = 0; i < message.partnerLinks.length; ++i) { + var error = $root.google.ads.datamanager.v1.PartnerLink.verify(message.partnerLinks[i]); + if (error) + return "partnerLinks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchPartnerLinksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.SearchPartnerLinksResponse} SearchPartnerLinksResponse + */ + SearchPartnerLinksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.SearchPartnerLinksResponse) + return object; + var message = new $root.google.ads.datamanager.v1.SearchPartnerLinksResponse(); + if (object.partnerLinks) { + if (!Array.isArray(object.partnerLinks)) + throw TypeError(".google.ads.datamanager.v1.SearchPartnerLinksResponse.partnerLinks: array expected"); + message.partnerLinks = []; + for (var i = 0; i < object.partnerLinks.length; ++i) { + if (typeof object.partnerLinks[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.SearchPartnerLinksResponse.partnerLinks: object expected"); + message.partnerLinks[i] = $root.google.ads.datamanager.v1.PartnerLink.fromObject(object.partnerLinks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchPartnerLinksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {google.ads.datamanager.v1.SearchPartnerLinksResponse} message SearchPartnerLinksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchPartnerLinksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partnerLinks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.partnerLinks && message.partnerLinks.length) { + object.partnerLinks = []; + for (var j = 0; j < message.partnerLinks.length; ++j) + object.partnerLinks[j] = $root.google.ads.datamanager.v1.PartnerLink.toObject(message.partnerLinks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchPartnerLinksResponse to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @instance + * @returns {Object.} JSON object + */ + SearchPartnerLinksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchPartnerLinksResponse + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.SearchPartnerLinksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchPartnerLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.SearchPartnerLinksResponse"; + }; + + return SearchPartnerLinksResponse; + })(); + + v1.PartnerLink = (function() { + + /** + * Properties of a PartnerLink. + * @memberof google.ads.datamanager.v1 + * @interface IPartnerLink + * @property {string|null} [name] PartnerLink name + * @property {string|null} [partnerLinkId] PartnerLink partnerLinkId + * @property {google.ads.datamanager.v1.IProductAccount|null} [owningAccount] PartnerLink owningAccount + * @property {google.ads.datamanager.v1.IProductAccount|null} [partnerAccount] PartnerLink partnerAccount + */ + + /** + * Constructs a new PartnerLink. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PartnerLink. + * @implements IPartnerLink + * @constructor + * @param {google.ads.datamanager.v1.IPartnerLink=} [properties] Properties to set + */ + function PartnerLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartnerLink name. + * @member {string} name + * @memberof google.ads.datamanager.v1.PartnerLink + * @instance + */ + PartnerLink.prototype.name = ""; + + /** + * PartnerLink partnerLinkId. + * @member {string} partnerLinkId + * @memberof google.ads.datamanager.v1.PartnerLink + * @instance + */ + PartnerLink.prototype.partnerLinkId = ""; + + /** + * PartnerLink owningAccount. + * @member {google.ads.datamanager.v1.IProductAccount|null|undefined} owningAccount + * @memberof google.ads.datamanager.v1.PartnerLink + * @instance + */ + PartnerLink.prototype.owningAccount = null; + + /** + * PartnerLink partnerAccount. + * @member {google.ads.datamanager.v1.IProductAccount|null|undefined} partnerAccount + * @memberof google.ads.datamanager.v1.PartnerLink + * @instance + */ + PartnerLink.prototype.partnerAccount = null; + + /** + * Creates a new PartnerLink instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {google.ads.datamanager.v1.IPartnerLink=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.PartnerLink} PartnerLink instance + */ + PartnerLink.create = function create(properties) { + return new PartnerLink(properties); + }; + + /** + * Encodes the specified PartnerLink message. Does not implicitly {@link google.ads.datamanager.v1.PartnerLink.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {google.ads.datamanager.v1.IPartnerLink} message PartnerLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartnerLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.partnerLinkId != null && Object.hasOwnProperty.call(message, "partnerLinkId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.partnerLinkId); + if (message.owningAccount != null && Object.hasOwnProperty.call(message, "owningAccount")) + $root.google.ads.datamanager.v1.ProductAccount.encode(message.owningAccount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partnerAccount != null && Object.hasOwnProperty.call(message, "partnerAccount")) + $root.google.ads.datamanager.v1.ProductAccount.encode(message.partnerAccount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartnerLink message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PartnerLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {google.ads.datamanager.v1.IPartnerLink} message PartnerLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartnerLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartnerLink message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.PartnerLink} PartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartnerLink.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.PartnerLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.partnerLinkId = reader.string(); + break; + } + case 3: { + message.owningAccount = $root.google.ads.datamanager.v1.ProductAccount.decode(reader, reader.uint32()); + break; + } + case 4: { + message.partnerAccount = $root.google.ads.datamanager.v1.ProductAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartnerLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.PartnerLink} PartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartnerLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartnerLink message. + * @function verify + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartnerLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.partnerLinkId != null && message.hasOwnProperty("partnerLinkId")) + if (!$util.isString(message.partnerLinkId)) + return "partnerLinkId: string expected"; + if (message.owningAccount != null && message.hasOwnProperty("owningAccount")) { + var error = $root.google.ads.datamanager.v1.ProductAccount.verify(message.owningAccount); + if (error) + return "owningAccount." + error; + } + if (message.partnerAccount != null && message.hasOwnProperty("partnerAccount")) { + var error = $root.google.ads.datamanager.v1.ProductAccount.verify(message.partnerAccount); + if (error) + return "partnerAccount." + error; + } + return null; + }; + + /** + * Creates a PartnerLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.PartnerLink} PartnerLink + */ + PartnerLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.PartnerLink) + return object; + var message = new $root.google.ads.datamanager.v1.PartnerLink(); + if (object.name != null) + message.name = String(object.name); + if (object.partnerLinkId != null) + message.partnerLinkId = String(object.partnerLinkId); + if (object.owningAccount != null) { + if (typeof object.owningAccount !== "object") + throw TypeError(".google.ads.datamanager.v1.PartnerLink.owningAccount: object expected"); + message.owningAccount = $root.google.ads.datamanager.v1.ProductAccount.fromObject(object.owningAccount); + } + if (object.partnerAccount != null) { + if (typeof object.partnerAccount !== "object") + throw TypeError(".google.ads.datamanager.v1.PartnerLink.partnerAccount: object expected"); + message.partnerAccount = $root.google.ads.datamanager.v1.ProductAccount.fromObject(object.partnerAccount); + } + return message; + }; + + /** + * Creates a plain object from a PartnerLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {google.ads.datamanager.v1.PartnerLink} message PartnerLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartnerLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.partnerLinkId = ""; + object.owningAccount = null; + object.partnerAccount = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.partnerLinkId != null && message.hasOwnProperty("partnerLinkId")) + object.partnerLinkId = message.partnerLinkId; + if (message.owningAccount != null && message.hasOwnProperty("owningAccount")) + object.owningAccount = $root.google.ads.datamanager.v1.ProductAccount.toObject(message.owningAccount, options); + if (message.partnerAccount != null && message.hasOwnProperty("partnerAccount")) + object.partnerAccount = $root.google.ads.datamanager.v1.ProductAccount.toObject(message.partnerAccount, options); + return object; + }; + + /** + * Converts this PartnerLink to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.PartnerLink + * @instance + * @returns {Object.} JSON object + */ + PartnerLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartnerLink + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.PartnerLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartnerLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.PartnerLink"; + }; + + return PartnerLink; + })(); + + v1.UserList = (function() { + + /** + * Properties of a UserList. + * @memberof google.ads.datamanager.v1 + * @interface IUserList + * @property {string|null} [name] UserList name + * @property {number|Long|null} [id] UserList id + * @property {boolean|null} [readOnly] UserList readOnly + * @property {string|null} [displayName] UserList displayName + * @property {string|null} [description] UserList description + * @property {google.ads.datamanager.v1.UserList.MembershipStatus|null} [membershipStatus] UserList membershipStatus + * @property {string|null} [integrationCode] UserList integrationCode + * @property {google.protobuf.IDuration|null} [membershipDuration] UserList membershipDuration + * @property {google.ads.datamanager.v1.UserList.ClosingReason|null} [closingReason] UserList closingReason + * @property {google.ads.datamanager.v1.UserList.AccessReason|null} [accessReason] UserList accessReason + * @property {google.ads.datamanager.v1.UserList.AccessStatus|null} [accountAccessStatus] UserList accountAccessStatus + * @property {google.ads.datamanager.v1.ISizeInfo|null} [sizeInfo] UserList sizeInfo + * @property {google.ads.datamanager.v1.ITargetNetworkInfo|null} [targetNetworkInfo] UserList targetNetworkInfo + * @property {google.ads.datamanager.v1.IIngestedUserListInfo|null} [ingestedUserListInfo] UserList ingestedUserListInfo + */ + + /** + * Constructs a new UserList. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserList. + * @implements IUserList + * @constructor + * @param {google.ads.datamanager.v1.IUserList=} [properties] Properties to set + */ + function UserList(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserList name. + * @member {string} name + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.name = ""; + + /** + * UserList id. + * @member {number|Long} id + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserList readOnly. + * @member {boolean} readOnly + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.readOnly = false; + + /** + * UserList displayName. + * @member {string|null|undefined} displayName + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.displayName = null; + + /** + * UserList description. + * @member {string|null|undefined} description + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.description = null; + + /** + * UserList membershipStatus. + * @member {google.ads.datamanager.v1.UserList.MembershipStatus|null|undefined} membershipStatus + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.membershipStatus = null; + + /** + * UserList integrationCode. + * @member {string|null|undefined} integrationCode + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.integrationCode = null; + + /** + * UserList membershipDuration. + * @member {google.protobuf.IDuration|null|undefined} membershipDuration + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.membershipDuration = null; + + /** + * UserList closingReason. + * @member {google.ads.datamanager.v1.UserList.ClosingReason|null|undefined} closingReason + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.closingReason = null; + + /** + * UserList accessReason. + * @member {google.ads.datamanager.v1.UserList.AccessReason} accessReason + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.accessReason = 0; + + /** + * UserList accountAccessStatus. + * @member {google.ads.datamanager.v1.UserList.AccessStatus|null|undefined} accountAccessStatus + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.accountAccessStatus = null; + + /** + * UserList sizeInfo. + * @member {google.ads.datamanager.v1.ISizeInfo|null|undefined} sizeInfo + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.sizeInfo = null; + + /** + * UserList targetNetworkInfo. + * @member {google.ads.datamanager.v1.ITargetNetworkInfo|null|undefined} targetNetworkInfo + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.targetNetworkInfo = null; + + /** + * UserList ingestedUserListInfo. + * @member {google.ads.datamanager.v1.IIngestedUserListInfo|null|undefined} ingestedUserListInfo + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + UserList.prototype.ingestedUserListInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_membershipStatus", { + get: $util.oneOfGetter($oneOfFields = ["membershipStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_integrationCode", { + get: $util.oneOfGetter($oneOfFields = ["integrationCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_closingReason", { + get: $util.oneOfGetter($oneOfFields = ["closingReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserList.prototype, "_accountAccessStatus", { + get: $util.oneOfGetter($oneOfFields = ["accountAccessStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UserList userListInfo. + * @member {"ingestedUserListInfo"|undefined} userListInfo + * @memberof google.ads.datamanager.v1.UserList + * @instance + */ + Object.defineProperty(UserList.prototype, "userListInfo", { + get: $util.oneOfGetter($oneOfFields = ["ingestedUserListInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserList instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {google.ads.datamanager.v1.IUserList=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserList} UserList instance + */ + UserList.create = function create(properties) { + return new UserList(properties); + }; + + /** + * Encodes the specified UserList message. Does not implicitly {@link google.ads.datamanager.v1.UserList.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {google.ads.datamanager.v1.IUserList} message UserList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.id); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.readOnly); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.membershipStatus != null && Object.hasOwnProperty.call(message, "membershipStatus")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.membershipStatus); + if (message.integrationCode != null && Object.hasOwnProperty.call(message, "integrationCode")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.integrationCode); + if (message.membershipDuration != null && Object.hasOwnProperty.call(message, "membershipDuration")) + $root.google.protobuf.Duration.encode(message.membershipDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.closingReason != null && Object.hasOwnProperty.call(message, "closingReason")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.closingReason); + if (message.accessReason != null && Object.hasOwnProperty.call(message, "accessReason")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.accessReason); + if (message.accountAccessStatus != null && Object.hasOwnProperty.call(message, "accountAccessStatus")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.accountAccessStatus); + if (message.sizeInfo != null && Object.hasOwnProperty.call(message, "sizeInfo")) + $root.google.ads.datamanager.v1.SizeInfo.encode(message.sizeInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.targetNetworkInfo != null && Object.hasOwnProperty.call(message, "targetNetworkInfo")) + $root.google.ads.datamanager.v1.TargetNetworkInfo.encode(message.targetNetworkInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.ingestedUserListInfo != null && Object.hasOwnProperty.call(message, "ingestedUserListInfo")) + $root.google.ads.datamanager.v1.IngestedUserListInfo.encode(message.ingestedUserListInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserList message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {google.ads.datamanager.v1.IUserList} message UserList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserList message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserList} UserList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.int64(); + break; + } + case 3: { + message.readOnly = reader.bool(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.membershipStatus = reader.int32(); + break; + } + case 7: { + message.integrationCode = reader.string(); + break; + } + case 8: { + message.membershipDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.closingReason = reader.int32(); + break; + } + case 10: { + message.accessReason = reader.int32(); + break; + } + case 11: { + message.accountAccessStatus = reader.int32(); + break; + } + case 12: { + message.sizeInfo = $root.google.ads.datamanager.v1.SizeInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.targetNetworkInfo = $root.google.ads.datamanager.v1.TargetNetworkInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.ingestedUserListInfo = $root.google.ads.datamanager.v1.IngestedUserListInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserList} UserList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserList message. + * @function verify + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + if (typeof message.readOnly !== "boolean") + return "readOnly: boolean expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.membershipStatus != null && message.hasOwnProperty("membershipStatus")) { + properties._membershipStatus = 1; + switch (message.membershipStatus) { + default: + return "membershipStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.integrationCode != null && message.hasOwnProperty("integrationCode")) { + properties._integrationCode = 1; + if (!$util.isString(message.integrationCode)) + return "integrationCode: string expected"; + } + if (message.membershipDuration != null && message.hasOwnProperty("membershipDuration")) { + var error = $root.google.protobuf.Duration.verify(message.membershipDuration); + if (error) + return "membershipDuration." + error; + } + if (message.closingReason != null && message.hasOwnProperty("closingReason")) { + properties._closingReason = 1; + switch (message.closingReason) { + default: + return "closingReason: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.accessReason != null && message.hasOwnProperty("accessReason")) + switch (message.accessReason) { + default: + return "accessReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.accountAccessStatus != null && message.hasOwnProperty("accountAccessStatus")) { + properties._accountAccessStatus = 1; + switch (message.accountAccessStatus) { + default: + return "accountAccessStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.sizeInfo != null && message.hasOwnProperty("sizeInfo")) { + var error = $root.google.ads.datamanager.v1.SizeInfo.verify(message.sizeInfo); + if (error) + return "sizeInfo." + error; + } + if (message.targetNetworkInfo != null && message.hasOwnProperty("targetNetworkInfo")) { + var error = $root.google.ads.datamanager.v1.TargetNetworkInfo.verify(message.targetNetworkInfo); + if (error) + return "targetNetworkInfo." + error; + } + if (message.ingestedUserListInfo != null && message.hasOwnProperty("ingestedUserListInfo")) { + properties.userListInfo = 1; + { + var error = $root.google.ads.datamanager.v1.IngestedUserListInfo.verify(message.ingestedUserListInfo); + if (error) + return "ingestedUserListInfo." + error; + } + } + return null; + }; + + /** + * Creates a UserList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserList} UserList + */ + UserList.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserList) + return object; + var message = new $root.google.ads.datamanager.v1.UserList(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = false; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); + if (object.readOnly != null) + message.readOnly = Boolean(object.readOnly); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.membershipStatus) { + default: + if (typeof object.membershipStatus === "number") { + message.membershipStatus = object.membershipStatus; + break; + } + break; + case "MEMBERSHIP_STATUS_UNSPECIFIED": + case 0: + message.membershipStatus = 0; + break; + case "OPEN": + case 1: + message.membershipStatus = 1; + break; + case "CLOSED": + case 2: + message.membershipStatus = 2; + break; + } + if (object.integrationCode != null) + message.integrationCode = String(object.integrationCode); + if (object.membershipDuration != null) { + if (typeof object.membershipDuration !== "object") + throw TypeError(".google.ads.datamanager.v1.UserList.membershipDuration: object expected"); + message.membershipDuration = $root.google.protobuf.Duration.fromObject(object.membershipDuration); + } + switch (object.closingReason) { + default: + if (typeof object.closingReason === "number") { + message.closingReason = object.closingReason; + break; + } + break; + case "CLOSING_REASON_UNSPECIFIED": + case 0: + message.closingReason = 0; + break; + case "UNUSED": + case 1: + message.closingReason = 1; + break; + } + switch (object.accessReason) { + default: + if (typeof object.accessReason === "number") { + message.accessReason = object.accessReason; + break; + } + break; + case "ACCESS_REASON_UNSPECIFIED": + case 0: + message.accessReason = 0; + break; + case "OWNED": + case 1: + message.accessReason = 1; + break; + case "SHARED": + case 2: + message.accessReason = 2; + break; + case "LICENSED": + case 3: + message.accessReason = 3; + break; + case "SUBSCRIBED": + case 4: + message.accessReason = 4; + break; + case "AFFILIATED": + case 5: + message.accessReason = 5; + break; + } + switch (object.accountAccessStatus) { + default: + if (typeof object.accountAccessStatus === "number") { + message.accountAccessStatus = object.accountAccessStatus; + break; + } + break; + case "ACCESS_STATUS_UNSPECIFIED": + case 0: + message.accountAccessStatus = 0; + break; + case "ENABLED": + case 1: + message.accountAccessStatus = 1; + break; + case "DISABLED": + case 2: + message.accountAccessStatus = 2; + break; + } + if (object.sizeInfo != null) { + if (typeof object.sizeInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.UserList.sizeInfo: object expected"); + message.sizeInfo = $root.google.ads.datamanager.v1.SizeInfo.fromObject(object.sizeInfo); + } + if (object.targetNetworkInfo != null) { + if (typeof object.targetNetworkInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.UserList.targetNetworkInfo: object expected"); + message.targetNetworkInfo = $root.google.ads.datamanager.v1.TargetNetworkInfo.fromObject(object.targetNetworkInfo); + } + if (object.ingestedUserListInfo != null) { + if (typeof object.ingestedUserListInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.UserList.ingestedUserListInfo: object expected"); + message.ingestedUserListInfo = $root.google.ads.datamanager.v1.IngestedUserListInfo.fromObject(object.ingestedUserListInfo); + } + return message; + }; + + /** + * Creates a plain object from a UserList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {google.ads.datamanager.v1.UserList} message UserList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.id = options.longs === String ? "0" : 0; + object.readOnly = false; + object.membershipDuration = null; + object.accessReason = options.enums === String ? "ACCESS_REASON_UNSPECIFIED" : 0; + object.sizeInfo = null; + object.targetNetworkInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + object.readOnly = message.readOnly; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.membershipStatus != null && message.hasOwnProperty("membershipStatus")) { + object.membershipStatus = options.enums === String ? $root.google.ads.datamanager.v1.UserList.MembershipStatus[message.membershipStatus] === undefined ? message.membershipStatus : $root.google.ads.datamanager.v1.UserList.MembershipStatus[message.membershipStatus] : message.membershipStatus; + if (options.oneofs) + object._membershipStatus = "membershipStatus"; + } + if (message.integrationCode != null && message.hasOwnProperty("integrationCode")) { + object.integrationCode = message.integrationCode; + if (options.oneofs) + object._integrationCode = "integrationCode"; + } + if (message.membershipDuration != null && message.hasOwnProperty("membershipDuration")) + object.membershipDuration = $root.google.protobuf.Duration.toObject(message.membershipDuration, options); + if (message.closingReason != null && message.hasOwnProperty("closingReason")) { + object.closingReason = options.enums === String ? $root.google.ads.datamanager.v1.UserList.ClosingReason[message.closingReason] === undefined ? message.closingReason : $root.google.ads.datamanager.v1.UserList.ClosingReason[message.closingReason] : message.closingReason; + if (options.oneofs) + object._closingReason = "closingReason"; + } + if (message.accessReason != null && message.hasOwnProperty("accessReason")) + object.accessReason = options.enums === String ? $root.google.ads.datamanager.v1.UserList.AccessReason[message.accessReason] === undefined ? message.accessReason : $root.google.ads.datamanager.v1.UserList.AccessReason[message.accessReason] : message.accessReason; + if (message.accountAccessStatus != null && message.hasOwnProperty("accountAccessStatus")) { + object.accountAccessStatus = options.enums === String ? $root.google.ads.datamanager.v1.UserList.AccessStatus[message.accountAccessStatus] === undefined ? message.accountAccessStatus : $root.google.ads.datamanager.v1.UserList.AccessStatus[message.accountAccessStatus] : message.accountAccessStatus; + if (options.oneofs) + object._accountAccessStatus = "accountAccessStatus"; + } + if (message.sizeInfo != null && message.hasOwnProperty("sizeInfo")) + object.sizeInfo = $root.google.ads.datamanager.v1.SizeInfo.toObject(message.sizeInfo, options); + if (message.targetNetworkInfo != null && message.hasOwnProperty("targetNetworkInfo")) + object.targetNetworkInfo = $root.google.ads.datamanager.v1.TargetNetworkInfo.toObject(message.targetNetworkInfo, options); + if (message.ingestedUserListInfo != null && message.hasOwnProperty("ingestedUserListInfo")) { + object.ingestedUserListInfo = $root.google.ads.datamanager.v1.IngestedUserListInfo.toObject(message.ingestedUserListInfo, options); + if (options.oneofs) + object.userListInfo = "ingestedUserListInfo"; + } + return object; + }; + + /** + * Converts this UserList to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserList + * @instance + * @returns {Object.} JSON object + */ + UserList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserList + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserList"; + }; + + /** + * MembershipStatus enum. + * @name google.ads.datamanager.v1.UserList.MembershipStatus + * @enum {number} + * @property {number} MEMBERSHIP_STATUS_UNSPECIFIED=0 MEMBERSHIP_STATUS_UNSPECIFIED value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + UserList.MembershipStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * ClosingReason enum. + * @name google.ads.datamanager.v1.UserList.ClosingReason + * @enum {number} + * @property {number} CLOSING_REASON_UNSPECIFIED=0 CLOSING_REASON_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + */ + UserList.ClosingReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLOSING_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + return values; + })(); + + /** + * AccessReason enum. + * @name google.ads.datamanager.v1.UserList.AccessReason + * @enum {number} + * @property {number} ACCESS_REASON_UNSPECIFIED=0 ACCESS_REASON_UNSPECIFIED value + * @property {number} OWNED=1 OWNED value + * @property {number} SHARED=2 SHARED value + * @property {number} LICENSED=3 LICENSED value + * @property {number} SUBSCRIBED=4 SUBSCRIBED value + * @property {number} AFFILIATED=5 AFFILIATED value + */ + UserList.AccessReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "OWNED"] = 1; + values[valuesById[2] = "SHARED"] = 2; + values[valuesById[3] = "LICENSED"] = 3; + values[valuesById[4] = "SUBSCRIBED"] = 4; + values[valuesById[5] = "AFFILIATED"] = 5; + return values; + })(); + + /** + * AccessStatus enum. + * @name google.ads.datamanager.v1.UserList.AccessStatus + * @enum {number} + * @property {number} ACCESS_STATUS_UNSPECIFIED=0 ACCESS_STATUS_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + UserList.AccessStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return UserList; + })(); + + v1.SizeInfo = (function() { + + /** + * Properties of a SizeInfo. + * @memberof google.ads.datamanager.v1 + * @interface ISizeInfo + * @property {number|Long|null} [displayNetworkMembersCount] SizeInfo displayNetworkMembersCount + * @property {number|Long|null} [searchNetworkMembersCount] SizeInfo searchNetworkMembersCount + */ + + /** + * Constructs a new SizeInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a SizeInfo. + * @implements ISizeInfo + * @constructor + * @param {google.ads.datamanager.v1.ISizeInfo=} [properties] Properties to set + */ + function SizeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SizeInfo displayNetworkMembersCount. + * @member {number|Long} displayNetworkMembersCount + * @memberof google.ads.datamanager.v1.SizeInfo + * @instance + */ + SizeInfo.prototype.displayNetworkMembersCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SizeInfo searchNetworkMembersCount. + * @member {number|Long} searchNetworkMembersCount + * @memberof google.ads.datamanager.v1.SizeInfo + * @instance + */ + SizeInfo.prototype.searchNetworkMembersCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SizeInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {google.ads.datamanager.v1.ISizeInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.SizeInfo} SizeInfo instance + */ + SizeInfo.create = function create(properties) { + return new SizeInfo(properties); + }; + + /** + * Encodes the specified SizeInfo message. Does not implicitly {@link google.ads.datamanager.v1.SizeInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {google.ads.datamanager.v1.ISizeInfo} message SizeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SizeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayNetworkMembersCount != null && Object.hasOwnProperty.call(message, "displayNetworkMembersCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.displayNetworkMembersCount); + if (message.searchNetworkMembersCount != null && Object.hasOwnProperty.call(message, "searchNetworkMembersCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.searchNetworkMembersCount); + return writer; + }; + + /** + * Encodes the specified SizeInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.SizeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {google.ads.datamanager.v1.ISizeInfo} message SizeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SizeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SizeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.SizeInfo} SizeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SizeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.SizeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayNetworkMembersCount = reader.int64(); + break; + } + case 2: { + message.searchNetworkMembersCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SizeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.SizeInfo} SizeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SizeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SizeInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SizeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayNetworkMembersCount != null && message.hasOwnProperty("displayNetworkMembersCount")) + if (!$util.isInteger(message.displayNetworkMembersCount) && !(message.displayNetworkMembersCount && $util.isInteger(message.displayNetworkMembersCount.low) && $util.isInteger(message.displayNetworkMembersCount.high))) + return "displayNetworkMembersCount: integer|Long expected"; + if (message.searchNetworkMembersCount != null && message.hasOwnProperty("searchNetworkMembersCount")) + if (!$util.isInteger(message.searchNetworkMembersCount) && !(message.searchNetworkMembersCount && $util.isInteger(message.searchNetworkMembersCount.low) && $util.isInteger(message.searchNetworkMembersCount.high))) + return "searchNetworkMembersCount: integer|Long expected"; + return null; + }; + + /** + * Creates a SizeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.SizeInfo} SizeInfo + */ + SizeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.SizeInfo) + return object; + var message = new $root.google.ads.datamanager.v1.SizeInfo(); + if (object.displayNetworkMembersCount != null) + if ($util.Long) + (message.displayNetworkMembersCount = $util.Long.fromValue(object.displayNetworkMembersCount)).unsigned = false; + else if (typeof object.displayNetworkMembersCount === "string") + message.displayNetworkMembersCount = parseInt(object.displayNetworkMembersCount, 10); + else if (typeof object.displayNetworkMembersCount === "number") + message.displayNetworkMembersCount = object.displayNetworkMembersCount; + else if (typeof object.displayNetworkMembersCount === "object") + message.displayNetworkMembersCount = new $util.LongBits(object.displayNetworkMembersCount.low >>> 0, object.displayNetworkMembersCount.high >>> 0).toNumber(); + if (object.searchNetworkMembersCount != null) + if ($util.Long) + (message.searchNetworkMembersCount = $util.Long.fromValue(object.searchNetworkMembersCount)).unsigned = false; + else if (typeof object.searchNetworkMembersCount === "string") + message.searchNetworkMembersCount = parseInt(object.searchNetworkMembersCount, 10); + else if (typeof object.searchNetworkMembersCount === "number") + message.searchNetworkMembersCount = object.searchNetworkMembersCount; + else if (typeof object.searchNetworkMembersCount === "object") + message.searchNetworkMembersCount = new $util.LongBits(object.searchNetworkMembersCount.low >>> 0, object.searchNetworkMembersCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SizeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {google.ads.datamanager.v1.SizeInfo} message SizeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SizeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.displayNetworkMembersCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.displayNetworkMembersCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.searchNetworkMembersCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.searchNetworkMembersCount = options.longs === String ? "0" : 0; + } + if (message.displayNetworkMembersCount != null && message.hasOwnProperty("displayNetworkMembersCount")) + if (typeof message.displayNetworkMembersCount === "number") + object.displayNetworkMembersCount = options.longs === String ? String(message.displayNetworkMembersCount) : message.displayNetworkMembersCount; + else + object.displayNetworkMembersCount = options.longs === String ? $util.Long.prototype.toString.call(message.displayNetworkMembersCount) : options.longs === Number ? new $util.LongBits(message.displayNetworkMembersCount.low >>> 0, message.displayNetworkMembersCount.high >>> 0).toNumber() : message.displayNetworkMembersCount; + if (message.searchNetworkMembersCount != null && message.hasOwnProperty("searchNetworkMembersCount")) + if (typeof message.searchNetworkMembersCount === "number") + object.searchNetworkMembersCount = options.longs === String ? String(message.searchNetworkMembersCount) : message.searchNetworkMembersCount; + else + object.searchNetworkMembersCount = options.longs === String ? $util.Long.prototype.toString.call(message.searchNetworkMembersCount) : options.longs === Number ? new $util.LongBits(message.searchNetworkMembersCount.low >>> 0, message.searchNetworkMembersCount.high >>> 0).toNumber() : message.searchNetworkMembersCount; + return object; + }; + + /** + * Converts this SizeInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.SizeInfo + * @instance + * @returns {Object.} JSON object + */ + SizeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SizeInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.SizeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SizeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.SizeInfo"; + }; + + return SizeInfo; + })(); + + v1.TargetNetworkInfo = (function() { + + /** + * Properties of a TargetNetworkInfo. + * @memberof google.ads.datamanager.v1 + * @interface ITargetNetworkInfo + * @property {boolean|null} [eligibleForDisplay] TargetNetworkInfo eligibleForDisplay + * @property {boolean|null} [eligibleForSearch] TargetNetworkInfo eligibleForSearch + */ + + /** + * Constructs a new TargetNetworkInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a TargetNetworkInfo. + * @implements ITargetNetworkInfo + * @constructor + * @param {google.ads.datamanager.v1.ITargetNetworkInfo=} [properties] Properties to set + */ + function TargetNetworkInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetNetworkInfo eligibleForDisplay. + * @member {boolean} eligibleForDisplay + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @instance + */ + TargetNetworkInfo.prototype.eligibleForDisplay = false; + + /** + * TargetNetworkInfo eligibleForSearch. + * @member {boolean|null|undefined} eligibleForSearch + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @instance + */ + TargetNetworkInfo.prototype.eligibleForSearch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TargetNetworkInfo.prototype, "_eligibleForSearch", { + get: $util.oneOfGetter($oneOfFields = ["eligibleForSearch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetNetworkInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {google.ads.datamanager.v1.ITargetNetworkInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.TargetNetworkInfo} TargetNetworkInfo instance + */ + TargetNetworkInfo.create = function create(properties) { + return new TargetNetworkInfo(properties); + }; + + /** + * Encodes the specified TargetNetworkInfo message. Does not implicitly {@link google.ads.datamanager.v1.TargetNetworkInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {google.ads.datamanager.v1.ITargetNetworkInfo} message TargetNetworkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNetworkInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eligibleForDisplay != null && Object.hasOwnProperty.call(message, "eligibleForDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.eligibleForDisplay); + if (message.eligibleForSearch != null && Object.hasOwnProperty.call(message, "eligibleForSearch")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.eligibleForSearch); + return writer; + }; + + /** + * Encodes the specified TargetNetworkInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TargetNetworkInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {google.ads.datamanager.v1.ITargetNetworkInfo} message TargetNetworkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNetworkInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetNetworkInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.TargetNetworkInfo} TargetNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNetworkInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.TargetNetworkInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eligibleForDisplay = reader.bool(); + break; + } + case 2: { + message.eligibleForSearch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetNetworkInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.TargetNetworkInfo} TargetNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNetworkInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetNetworkInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetNetworkInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.eligibleForDisplay != null && message.hasOwnProperty("eligibleForDisplay")) + if (typeof message.eligibleForDisplay !== "boolean") + return "eligibleForDisplay: boolean expected"; + if (message.eligibleForSearch != null && message.hasOwnProperty("eligibleForSearch")) { + properties._eligibleForSearch = 1; + if (typeof message.eligibleForSearch !== "boolean") + return "eligibleForSearch: boolean expected"; + } + return null; + }; + + /** + * Creates a TargetNetworkInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.TargetNetworkInfo} TargetNetworkInfo + */ + TargetNetworkInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.TargetNetworkInfo) + return object; + var message = new $root.google.ads.datamanager.v1.TargetNetworkInfo(); + if (object.eligibleForDisplay != null) + message.eligibleForDisplay = Boolean(object.eligibleForDisplay); + if (object.eligibleForSearch != null) + message.eligibleForSearch = Boolean(object.eligibleForSearch); + return message; + }; + + /** + * Creates a plain object from a TargetNetworkInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {google.ads.datamanager.v1.TargetNetworkInfo} message TargetNetworkInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetNetworkInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.eligibleForDisplay = false; + if (message.eligibleForDisplay != null && message.hasOwnProperty("eligibleForDisplay")) + object.eligibleForDisplay = message.eligibleForDisplay; + if (message.eligibleForSearch != null && message.hasOwnProperty("eligibleForSearch")) { + object.eligibleForSearch = message.eligibleForSearch; + if (options.oneofs) + object._eligibleForSearch = "eligibleForSearch"; + } + return object; + }; + + /** + * Converts this TargetNetworkInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @instance + * @returns {Object.} JSON object + */ + TargetNetworkInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetNetworkInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.TargetNetworkInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetNetworkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.TargetNetworkInfo"; + }; + + return TargetNetworkInfo; + })(); + + v1.IngestedUserListInfo = (function() { + + /** + * Properties of an IngestedUserListInfo. + * @memberof google.ads.datamanager.v1 + * @interface IIngestedUserListInfo + * @property {Array.|null} [uploadKeyTypes] IngestedUserListInfo uploadKeyTypes + * @property {google.ads.datamanager.v1.IContactIdInfo|null} [contactIdInfo] IngestedUserListInfo contactIdInfo + * @property {google.ads.datamanager.v1.IMobileIdInfo|null} [mobileIdInfo] IngestedUserListInfo mobileIdInfo + * @property {google.ads.datamanager.v1.IUserIdInfo|null} [userIdInfo] IngestedUserListInfo userIdInfo + * @property {google.ads.datamanager.v1.IPairIdInfo|null} [pairIdInfo] IngestedUserListInfo pairIdInfo + * @property {google.ads.datamanager.v1.IPseudonymousIdInfo|null} [pseudonymousIdInfo] IngestedUserListInfo pseudonymousIdInfo + * @property {google.ads.datamanager.v1.IPartnerAudienceInfo|null} [partnerAudienceInfo] IngestedUserListInfo partnerAudienceInfo + */ + + /** + * Constructs a new IngestedUserListInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents an IngestedUserListInfo. + * @implements IIngestedUserListInfo + * @constructor + * @param {google.ads.datamanager.v1.IIngestedUserListInfo=} [properties] Properties to set + */ + function IngestedUserListInfo(properties) { + this.uploadKeyTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestedUserListInfo uploadKeyTypes. + * @member {Array.} uploadKeyTypes + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.uploadKeyTypes = $util.emptyArray; + + /** + * IngestedUserListInfo contactIdInfo. + * @member {google.ads.datamanager.v1.IContactIdInfo|null|undefined} contactIdInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.contactIdInfo = null; + + /** + * IngestedUserListInfo mobileIdInfo. + * @member {google.ads.datamanager.v1.IMobileIdInfo|null|undefined} mobileIdInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.mobileIdInfo = null; + + /** + * IngestedUserListInfo userIdInfo. + * @member {google.ads.datamanager.v1.IUserIdInfo|null|undefined} userIdInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.userIdInfo = null; + + /** + * IngestedUserListInfo pairIdInfo. + * @member {google.ads.datamanager.v1.IPairIdInfo|null|undefined} pairIdInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.pairIdInfo = null; + + /** + * IngestedUserListInfo pseudonymousIdInfo. + * @member {google.ads.datamanager.v1.IPseudonymousIdInfo|null|undefined} pseudonymousIdInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.pseudonymousIdInfo = null; + + /** + * IngestedUserListInfo partnerAudienceInfo. + * @member {google.ads.datamanager.v1.IPartnerAudienceInfo|null|undefined} partnerAudienceInfo + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + */ + IngestedUserListInfo.prototype.partnerAudienceInfo = null; + + /** + * Creates a new IngestedUserListInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {google.ads.datamanager.v1.IIngestedUserListInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.IngestedUserListInfo} IngestedUserListInfo instance + */ + IngestedUserListInfo.create = function create(properties) { + return new IngestedUserListInfo(properties); + }; + + /** + * Encodes the specified IngestedUserListInfo message. Does not implicitly {@link google.ads.datamanager.v1.IngestedUserListInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {google.ads.datamanager.v1.IIngestedUserListInfo} message IngestedUserListInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestedUserListInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uploadKeyTypes != null && message.uploadKeyTypes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.uploadKeyTypes.length; ++i) + writer.int32(message.uploadKeyTypes[i]); + writer.ldelim(); + } + if (message.contactIdInfo != null && Object.hasOwnProperty.call(message, "contactIdInfo")) + $root.google.ads.datamanager.v1.ContactIdInfo.encode(message.contactIdInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mobileIdInfo != null && Object.hasOwnProperty.call(message, "mobileIdInfo")) + $root.google.ads.datamanager.v1.MobileIdInfo.encode(message.mobileIdInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userIdInfo != null && Object.hasOwnProperty.call(message, "userIdInfo")) + $root.google.ads.datamanager.v1.UserIdInfo.encode(message.userIdInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pairIdInfo != null && Object.hasOwnProperty.call(message, "pairIdInfo")) + $root.google.ads.datamanager.v1.PairIdInfo.encode(message.pairIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pseudonymousIdInfo != null && Object.hasOwnProperty.call(message, "pseudonymousIdInfo")) + $root.google.ads.datamanager.v1.PseudonymousIdInfo.encode(message.pseudonymousIdInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.partnerAudienceInfo != null && Object.hasOwnProperty.call(message, "partnerAudienceInfo")) + $root.google.ads.datamanager.v1.PartnerAudienceInfo.encode(message.partnerAudienceInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestedUserListInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.IngestedUserListInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {google.ads.datamanager.v1.IIngestedUserListInfo} message IngestedUserListInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestedUserListInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestedUserListInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.IngestedUserListInfo} IngestedUserListInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestedUserListInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.IngestedUserListInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.uploadKeyTypes && message.uploadKeyTypes.length)) + message.uploadKeyTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.uploadKeyTypes.push(reader.int32()); + } else + message.uploadKeyTypes.push(reader.int32()); + break; + } + case 2: { + message.contactIdInfo = $root.google.ads.datamanager.v1.ContactIdInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mobileIdInfo = $root.google.ads.datamanager.v1.MobileIdInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.userIdInfo = $root.google.ads.datamanager.v1.UserIdInfo.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pairIdInfo = $root.google.ads.datamanager.v1.PairIdInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pseudonymousIdInfo = $root.google.ads.datamanager.v1.PseudonymousIdInfo.decode(reader, reader.uint32()); + break; + } + case 7: { + message.partnerAudienceInfo = $root.google.ads.datamanager.v1.PartnerAudienceInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestedUserListInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.IngestedUserListInfo} IngestedUserListInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestedUserListInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestedUserListInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestedUserListInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uploadKeyTypes != null && message.hasOwnProperty("uploadKeyTypes")) { + if (!Array.isArray(message.uploadKeyTypes)) + return "uploadKeyTypes: array expected"; + for (var i = 0; i < message.uploadKeyTypes.length; ++i) + switch (message.uploadKeyTypes[i]) { + default: + return "uploadKeyTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.contactIdInfo != null && message.hasOwnProperty("contactIdInfo")) { + var error = $root.google.ads.datamanager.v1.ContactIdInfo.verify(message.contactIdInfo); + if (error) + return "contactIdInfo." + error; + } + if (message.mobileIdInfo != null && message.hasOwnProperty("mobileIdInfo")) { + var error = $root.google.ads.datamanager.v1.MobileIdInfo.verify(message.mobileIdInfo); + if (error) + return "mobileIdInfo." + error; + } + if (message.userIdInfo != null && message.hasOwnProperty("userIdInfo")) { + var error = $root.google.ads.datamanager.v1.UserIdInfo.verify(message.userIdInfo); + if (error) + return "userIdInfo." + error; + } + if (message.pairIdInfo != null && message.hasOwnProperty("pairIdInfo")) { + var error = $root.google.ads.datamanager.v1.PairIdInfo.verify(message.pairIdInfo); + if (error) + return "pairIdInfo." + error; + } + if (message.pseudonymousIdInfo != null && message.hasOwnProperty("pseudonymousIdInfo")) { + var error = $root.google.ads.datamanager.v1.PseudonymousIdInfo.verify(message.pseudonymousIdInfo); + if (error) + return "pseudonymousIdInfo." + error; + } + if (message.partnerAudienceInfo != null && message.hasOwnProperty("partnerAudienceInfo")) { + var error = $root.google.ads.datamanager.v1.PartnerAudienceInfo.verify(message.partnerAudienceInfo); + if (error) + return "partnerAudienceInfo." + error; + } + return null; + }; + + /** + * Creates an IngestedUserListInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.IngestedUserListInfo} IngestedUserListInfo + */ + IngestedUserListInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.IngestedUserListInfo) + return object; + var message = new $root.google.ads.datamanager.v1.IngestedUserListInfo(); + if (object.uploadKeyTypes) { + if (!Array.isArray(object.uploadKeyTypes)) + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.uploadKeyTypes: array expected"); + message.uploadKeyTypes = []; + for (var i = 0; i < object.uploadKeyTypes.length; ++i) + switch (object.uploadKeyTypes[i]) { + default: + if (typeof object.uploadKeyTypes[i] === "number") { + message.uploadKeyTypes[i] = object.uploadKeyTypes[i]; + break; + } + case "UPLOAD_KEY_TYPE_UNSPECIFIED": + case 0: + message.uploadKeyTypes[i] = 0; + break; + case "CONTACT_ID": + case 1: + message.uploadKeyTypes[i] = 1; + break; + case "MOBILE_ID": + case 2: + message.uploadKeyTypes[i] = 2; + break; + case "USER_ID": + case 3: + message.uploadKeyTypes[i] = 3; + break; + case "PAIR_ID": + case 4: + message.uploadKeyTypes[i] = 4; + break; + case "PSEUDONYMOUS_ID": + case 5: + message.uploadKeyTypes[i] = 5; + break; + } + } + if (object.contactIdInfo != null) { + if (typeof object.contactIdInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.contactIdInfo: object expected"); + message.contactIdInfo = $root.google.ads.datamanager.v1.ContactIdInfo.fromObject(object.contactIdInfo); + } + if (object.mobileIdInfo != null) { + if (typeof object.mobileIdInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.mobileIdInfo: object expected"); + message.mobileIdInfo = $root.google.ads.datamanager.v1.MobileIdInfo.fromObject(object.mobileIdInfo); + } + if (object.userIdInfo != null) { + if (typeof object.userIdInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.userIdInfo: object expected"); + message.userIdInfo = $root.google.ads.datamanager.v1.UserIdInfo.fromObject(object.userIdInfo); + } + if (object.pairIdInfo != null) { + if (typeof object.pairIdInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.pairIdInfo: object expected"); + message.pairIdInfo = $root.google.ads.datamanager.v1.PairIdInfo.fromObject(object.pairIdInfo); + } + if (object.pseudonymousIdInfo != null) { + if (typeof object.pseudonymousIdInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.pseudonymousIdInfo: object expected"); + message.pseudonymousIdInfo = $root.google.ads.datamanager.v1.PseudonymousIdInfo.fromObject(object.pseudonymousIdInfo); + } + if (object.partnerAudienceInfo != null) { + if (typeof object.partnerAudienceInfo !== "object") + throw TypeError(".google.ads.datamanager.v1.IngestedUserListInfo.partnerAudienceInfo: object expected"); + message.partnerAudienceInfo = $root.google.ads.datamanager.v1.PartnerAudienceInfo.fromObject(object.partnerAudienceInfo); + } + return message; + }; + + /** + * Creates a plain object from an IngestedUserListInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {google.ads.datamanager.v1.IngestedUserListInfo} message IngestedUserListInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestedUserListInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uploadKeyTypes = []; + if (options.defaults) { + object.contactIdInfo = null; + object.mobileIdInfo = null; + object.userIdInfo = null; + object.pairIdInfo = null; + object.pseudonymousIdInfo = null; + object.partnerAudienceInfo = null; + } + if (message.uploadKeyTypes && message.uploadKeyTypes.length) { + object.uploadKeyTypes = []; + for (var j = 0; j < message.uploadKeyTypes.length; ++j) + object.uploadKeyTypes[j] = options.enums === String ? $root.google.ads.datamanager.v1.IngestedUserListInfo.UploadKeyType[message.uploadKeyTypes[j]] === undefined ? message.uploadKeyTypes[j] : $root.google.ads.datamanager.v1.IngestedUserListInfo.UploadKeyType[message.uploadKeyTypes[j]] : message.uploadKeyTypes[j]; + } + if (message.contactIdInfo != null && message.hasOwnProperty("contactIdInfo")) + object.contactIdInfo = $root.google.ads.datamanager.v1.ContactIdInfo.toObject(message.contactIdInfo, options); + if (message.mobileIdInfo != null && message.hasOwnProperty("mobileIdInfo")) + object.mobileIdInfo = $root.google.ads.datamanager.v1.MobileIdInfo.toObject(message.mobileIdInfo, options); + if (message.userIdInfo != null && message.hasOwnProperty("userIdInfo")) + object.userIdInfo = $root.google.ads.datamanager.v1.UserIdInfo.toObject(message.userIdInfo, options); + if (message.pairIdInfo != null && message.hasOwnProperty("pairIdInfo")) + object.pairIdInfo = $root.google.ads.datamanager.v1.PairIdInfo.toObject(message.pairIdInfo, options); + if (message.pseudonymousIdInfo != null && message.hasOwnProperty("pseudonymousIdInfo")) + object.pseudonymousIdInfo = $root.google.ads.datamanager.v1.PseudonymousIdInfo.toObject(message.pseudonymousIdInfo, options); + if (message.partnerAudienceInfo != null && message.hasOwnProperty("partnerAudienceInfo")) + object.partnerAudienceInfo = $root.google.ads.datamanager.v1.PartnerAudienceInfo.toObject(message.partnerAudienceInfo, options); + return object; + }; + + /** + * Converts this IngestedUserListInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @instance + * @returns {Object.} JSON object + */ + IngestedUserListInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestedUserListInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.IngestedUserListInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestedUserListInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.IngestedUserListInfo"; + }; + + /** + * UploadKeyType enum. + * @name google.ads.datamanager.v1.IngestedUserListInfo.UploadKeyType + * @enum {number} + * @property {number} UPLOAD_KEY_TYPE_UNSPECIFIED=0 UPLOAD_KEY_TYPE_UNSPECIFIED value + * @property {number} CONTACT_ID=1 CONTACT_ID value + * @property {number} MOBILE_ID=2 MOBILE_ID value + * @property {number} USER_ID=3 USER_ID value + * @property {number} PAIR_ID=4 PAIR_ID value + * @property {number} PSEUDONYMOUS_ID=5 PSEUDONYMOUS_ID value + */ + IngestedUserListInfo.UploadKeyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UPLOAD_KEY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTACT_ID"] = 1; + values[valuesById[2] = "MOBILE_ID"] = 2; + values[valuesById[3] = "USER_ID"] = 3; + values[valuesById[4] = "PAIR_ID"] = 4; + values[valuesById[5] = "PSEUDONYMOUS_ID"] = 5; + return values; + })(); + + return IngestedUserListInfo; + })(); + + v1.ContactIdInfo = (function() { + + /** + * Properties of a ContactIdInfo. + * @memberof google.ads.datamanager.v1 + * @interface IContactIdInfo + * @property {google.ads.datamanager.v1.DataSourceType|null} [dataSourceType] ContactIdInfo dataSourceType + * @property {number|null} [matchRatePercentage] ContactIdInfo matchRatePercentage + */ + + /** + * Constructs a new ContactIdInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ContactIdInfo. + * @implements IContactIdInfo + * @constructor + * @param {google.ads.datamanager.v1.IContactIdInfo=} [properties] Properties to set + */ + function ContactIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContactIdInfo dataSourceType. + * @member {google.ads.datamanager.v1.DataSourceType|null|undefined} dataSourceType + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @instance + */ + ContactIdInfo.prototype.dataSourceType = null; + + /** + * ContactIdInfo matchRatePercentage. + * @member {number} matchRatePercentage + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @instance + */ + ContactIdInfo.prototype.matchRatePercentage = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContactIdInfo.prototype, "_dataSourceType", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContactIdInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {google.ads.datamanager.v1.IContactIdInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ContactIdInfo} ContactIdInfo instance + */ + ContactIdInfo.create = function create(properties) { + return new ContactIdInfo(properties); + }; + + /** + * Encodes the specified ContactIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.ContactIdInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {google.ads.datamanager.v1.IContactIdInfo} message ContactIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSourceType != null && Object.hasOwnProperty.call(message, "dataSourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataSourceType); + if (message.matchRatePercentage != null && Object.hasOwnProperty.call(message, "matchRatePercentage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.matchRatePercentage); + return writer; + }; + + /** + * Encodes the specified ContactIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ContactIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {google.ads.datamanager.v1.IContactIdInfo} message ContactIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactIdInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ContactIdInfo} ContactIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactIdInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ContactIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataSourceType = reader.int32(); + break; + } + case 2: { + message.matchRatePercentage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ContactIdInfo} ContactIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactIdInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + properties._dataSourceType = 1; + switch (message.dataSourceType) { + default: + return "dataSourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.matchRatePercentage != null && message.hasOwnProperty("matchRatePercentage")) + if (!$util.isInteger(message.matchRatePercentage)) + return "matchRatePercentage: integer expected"; + return null; + }; + + /** + * Creates a ContactIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ContactIdInfo} ContactIdInfo + */ + ContactIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ContactIdInfo) + return object; + var message = new $root.google.ads.datamanager.v1.ContactIdInfo(); + switch (object.dataSourceType) { + default: + if (typeof object.dataSourceType === "number") { + message.dataSourceType = object.dataSourceType; + break; + } + break; + case "DATA_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.dataSourceType = 0; + break; + case "DATA_SOURCE_TYPE_FIRST_PARTY": + case 1: + message.dataSourceType = 1; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU": + case 2: + message.dataSourceType = 2; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE": + case 3: + message.dataSourceType = 3; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA": + case 4: + message.dataSourceType = 4; + break; + } + if (object.matchRatePercentage != null) + message.matchRatePercentage = object.matchRatePercentage | 0; + return message; + }; + + /** + * Creates a plain object from a ContactIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {google.ads.datamanager.v1.ContactIdInfo} message ContactIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.matchRatePercentage = 0; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + object.dataSourceType = options.enums === String ? $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] === undefined ? message.dataSourceType : $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] : message.dataSourceType; + if (options.oneofs) + object._dataSourceType = "dataSourceType"; + } + if (message.matchRatePercentage != null && message.hasOwnProperty("matchRatePercentage")) + object.matchRatePercentage = message.matchRatePercentage; + return object; + }; + + /** + * Converts this ContactIdInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @instance + * @returns {Object.} JSON object + */ + ContactIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContactIdInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ContactIdInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContactIdInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ContactIdInfo"; + }; + + return ContactIdInfo; + })(); + + v1.MobileIdInfo = (function() { + + /** + * Properties of a MobileIdInfo. + * @memberof google.ads.datamanager.v1 + * @interface IMobileIdInfo + * @property {google.ads.datamanager.v1.DataSourceType|null} [dataSourceType] MobileIdInfo dataSourceType + * @property {google.ads.datamanager.v1.MobileIdInfo.KeySpace|null} [keySpace] MobileIdInfo keySpace + * @property {string|null} [appId] MobileIdInfo appId + */ + + /** + * Constructs a new MobileIdInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a MobileIdInfo. + * @implements IMobileIdInfo + * @constructor + * @param {google.ads.datamanager.v1.IMobileIdInfo=} [properties] Properties to set + */ + function MobileIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MobileIdInfo dataSourceType. + * @member {google.ads.datamanager.v1.DataSourceType|null|undefined} dataSourceType + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @instance + */ + MobileIdInfo.prototype.dataSourceType = null; + + /** + * MobileIdInfo keySpace. + * @member {google.ads.datamanager.v1.MobileIdInfo.KeySpace|null|undefined} keySpace + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @instance + */ + MobileIdInfo.prototype.keySpace = null; + + /** + * MobileIdInfo appId. + * @member {string|null|undefined} appId + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @instance + */ + MobileIdInfo.prototype.appId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobileIdInfo.prototype, "_dataSourceType", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobileIdInfo.prototype, "_keySpace", { + get: $util.oneOfGetter($oneOfFields = ["keySpace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MobileIdInfo.prototype, "_appId", { + get: $util.oneOfGetter($oneOfFields = ["appId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MobileIdInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {google.ads.datamanager.v1.IMobileIdInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.MobileIdInfo} MobileIdInfo instance + */ + MobileIdInfo.create = function create(properties) { + return new MobileIdInfo(properties); + }; + + /** + * Encodes the specified MobileIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.MobileIdInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {google.ads.datamanager.v1.IMobileIdInfo} message MobileIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MobileIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSourceType != null && Object.hasOwnProperty.call(message, "dataSourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataSourceType); + if (message.keySpace != null && Object.hasOwnProperty.call(message, "keySpace")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.keySpace); + if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); + return writer; + }; + + /** + * Encodes the specified MobileIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.MobileIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {google.ads.datamanager.v1.IMobileIdInfo} message MobileIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MobileIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MobileIdInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.MobileIdInfo} MobileIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MobileIdInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.MobileIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataSourceType = reader.int32(); + break; + } + case 2: { + message.keySpace = reader.int32(); + break; + } + case 3: { + message.appId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MobileIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.MobileIdInfo} MobileIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MobileIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MobileIdInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MobileIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + properties._dataSourceType = 1; + switch (message.dataSourceType) { + default: + return "dataSourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.keySpace != null && message.hasOwnProperty("keySpace")) { + properties._keySpace = 1; + switch (message.keySpace) { + default: + return "keySpace: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.appId != null && message.hasOwnProperty("appId")) { + properties._appId = 1; + if (!$util.isString(message.appId)) + return "appId: string expected"; + } + return null; + }; + + /** + * Creates a MobileIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.MobileIdInfo} MobileIdInfo + */ + MobileIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.MobileIdInfo) + return object; + var message = new $root.google.ads.datamanager.v1.MobileIdInfo(); + switch (object.dataSourceType) { + default: + if (typeof object.dataSourceType === "number") { + message.dataSourceType = object.dataSourceType; + break; + } + break; + case "DATA_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.dataSourceType = 0; + break; + case "DATA_SOURCE_TYPE_FIRST_PARTY": + case 1: + message.dataSourceType = 1; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU": + case 2: + message.dataSourceType = 2; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE": + case 3: + message.dataSourceType = 3; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA": + case 4: + message.dataSourceType = 4; + break; + } + switch (object.keySpace) { + default: + if (typeof object.keySpace === "number") { + message.keySpace = object.keySpace; + break; + } + break; + case "KEY_SPACE_UNSPECIFIED": + case 0: + message.keySpace = 0; + break; + case "IOS": + case 1: + message.keySpace = 1; + break; + case "ANDROID": + case 2: + message.keySpace = 2; + break; + } + if (object.appId != null) + message.appId = String(object.appId); + return message; + }; + + /** + * Creates a plain object from a MobileIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {google.ads.datamanager.v1.MobileIdInfo} message MobileIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MobileIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + object.dataSourceType = options.enums === String ? $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] === undefined ? message.dataSourceType : $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] : message.dataSourceType; + if (options.oneofs) + object._dataSourceType = "dataSourceType"; + } + if (message.keySpace != null && message.hasOwnProperty("keySpace")) { + object.keySpace = options.enums === String ? $root.google.ads.datamanager.v1.MobileIdInfo.KeySpace[message.keySpace] === undefined ? message.keySpace : $root.google.ads.datamanager.v1.MobileIdInfo.KeySpace[message.keySpace] : message.keySpace; + if (options.oneofs) + object._keySpace = "keySpace"; + } + if (message.appId != null && message.hasOwnProperty("appId")) { + object.appId = message.appId; + if (options.oneofs) + object._appId = "appId"; + } + return object; + }; + + /** + * Converts this MobileIdInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @instance + * @returns {Object.} JSON object + */ + MobileIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MobileIdInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.MobileIdInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MobileIdInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.MobileIdInfo"; + }; + + /** + * KeySpace enum. + * @name google.ads.datamanager.v1.MobileIdInfo.KeySpace + * @enum {number} + * @property {number} KEY_SPACE_UNSPECIFIED=0 KEY_SPACE_UNSPECIFIED value + * @property {number} IOS=1 IOS value + * @property {number} ANDROID=2 ANDROID value + */ + MobileIdInfo.KeySpace = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_SPACE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IOS"] = 1; + values[valuesById[2] = "ANDROID"] = 2; + return values; + })(); + + return MobileIdInfo; + })(); + + v1.UserIdInfo = (function() { + + /** + * Properties of a UserIdInfo. + * @memberof google.ads.datamanager.v1 + * @interface IUserIdInfo + * @property {google.ads.datamanager.v1.DataSourceType|null} [dataSourceType] UserIdInfo dataSourceType + */ + + /** + * Constructs a new UserIdInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserIdInfo. + * @implements IUserIdInfo + * @constructor + * @param {google.ads.datamanager.v1.IUserIdInfo=} [properties] Properties to set + */ + function UserIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserIdInfo dataSourceType. + * @member {google.ads.datamanager.v1.DataSourceType|null|undefined} dataSourceType + * @memberof google.ads.datamanager.v1.UserIdInfo + * @instance + */ + UserIdInfo.prototype.dataSourceType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserIdInfo.prototype, "_dataSourceType", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserIdInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {google.ads.datamanager.v1.IUserIdInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserIdInfo} UserIdInfo instance + */ + UserIdInfo.create = function create(properties) { + return new UserIdInfo(properties); + }; + + /** + * Encodes the specified UserIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.UserIdInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {google.ads.datamanager.v1.IUserIdInfo} message UserIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSourceType != null && Object.hasOwnProperty.call(message, "dataSourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dataSourceType); + return writer; + }; + + /** + * Encodes the specified UserIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {google.ads.datamanager.v1.IUserIdInfo} message UserIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserIdInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserIdInfo} UserIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserIdInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataSourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserIdInfo} UserIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserIdInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + properties._dataSourceType = 1; + switch (message.dataSourceType) { + default: + return "dataSourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates a UserIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserIdInfo} UserIdInfo + */ + UserIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserIdInfo) + return object; + var message = new $root.google.ads.datamanager.v1.UserIdInfo(); + switch (object.dataSourceType) { + default: + if (typeof object.dataSourceType === "number") { + message.dataSourceType = object.dataSourceType; + break; + } + break; + case "DATA_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.dataSourceType = 0; + break; + case "DATA_SOURCE_TYPE_FIRST_PARTY": + case 1: + message.dataSourceType = 1; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU": + case 2: + message.dataSourceType = 2; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE": + case 3: + message.dataSourceType = 3; + break; + case "DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA": + case 4: + message.dataSourceType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a UserIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {google.ads.datamanager.v1.UserIdInfo} message UserIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataSourceType != null && message.hasOwnProperty("dataSourceType")) { + object.dataSourceType = options.enums === String ? $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] === undefined ? message.dataSourceType : $root.google.ads.datamanager.v1.DataSourceType[message.dataSourceType] : message.dataSourceType; + if (options.oneofs) + object._dataSourceType = "dataSourceType"; + } + return object; + }; + + /** + * Converts this UserIdInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserIdInfo + * @instance + * @returns {Object.} JSON object + */ + UserIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserIdInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserIdInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserIdInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserIdInfo"; + }; + + return UserIdInfo; + })(); + + v1.PairIdInfo = (function() { + + /** + * Properties of a PairIdInfo. + * @memberof google.ads.datamanager.v1 + * @interface IPairIdInfo + * @property {number|Long|null} [publisherId] PairIdInfo publisherId + * @property {string|null} [publisherName] PairIdInfo publisherName + * @property {number|null} [matchRatePercentage] PairIdInfo matchRatePercentage + * @property {number|Long|null} [advertiserIdentifierCount] PairIdInfo advertiserIdentifierCount + * @property {string|null} [cleanRoomIdentifier] PairIdInfo cleanRoomIdentifier + */ + + /** + * Constructs a new PairIdInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PairIdInfo. + * @implements IPairIdInfo + * @constructor + * @param {google.ads.datamanager.v1.IPairIdInfo=} [properties] Properties to set + */ + function PairIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PairIdInfo publisherId. + * @member {number|Long|null|undefined} publisherId + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + */ + PairIdInfo.prototype.publisherId = null; + + /** + * PairIdInfo publisherName. + * @member {string|null|undefined} publisherName + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + */ + PairIdInfo.prototype.publisherName = null; + + /** + * PairIdInfo matchRatePercentage. + * @member {number} matchRatePercentage + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + */ + PairIdInfo.prototype.matchRatePercentage = 0; + + /** + * PairIdInfo advertiserIdentifierCount. + * @member {number|Long} advertiserIdentifierCount + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + */ + PairIdInfo.prototype.advertiserIdentifierCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PairIdInfo cleanRoomIdentifier. + * @member {string|null|undefined} cleanRoomIdentifier + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + */ + PairIdInfo.prototype.cleanRoomIdentifier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairIdInfo.prototype, "_publisherId", { + get: $util.oneOfGetter($oneOfFields = ["publisherId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairIdInfo.prototype, "_publisherName", { + get: $util.oneOfGetter($oneOfFields = ["publisherName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PairIdInfo.prototype, "_cleanRoomIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["cleanRoomIdentifier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PairIdInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {google.ads.datamanager.v1.IPairIdInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.PairIdInfo} PairIdInfo instance + */ + PairIdInfo.create = function create(properties) { + return new PairIdInfo(properties); + }; + + /** + * Encodes the specified PairIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.PairIdInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {google.ads.datamanager.v1.IPairIdInfo} message PairIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PairIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publisherId != null && Object.hasOwnProperty.call(message, "publisherId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.publisherId); + if (message.publisherName != null && Object.hasOwnProperty.call(message, "publisherName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publisherName); + if (message.matchRatePercentage != null && Object.hasOwnProperty.call(message, "matchRatePercentage")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchRatePercentage); + if (message.advertiserIdentifierCount != null && Object.hasOwnProperty.call(message, "advertiserIdentifierCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.advertiserIdentifierCount); + if (message.cleanRoomIdentifier != null && Object.hasOwnProperty.call(message, "cleanRoomIdentifier")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.cleanRoomIdentifier); + return writer; + }; + + /** + * Encodes the specified PairIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PairIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {google.ads.datamanager.v1.IPairIdInfo} message PairIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PairIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PairIdInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.PairIdInfo} PairIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PairIdInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.PairIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.publisherId = reader.int64(); + break; + } + case 2: { + message.publisherName = reader.string(); + break; + } + case 3: { + message.matchRatePercentage = reader.int32(); + break; + } + case 4: { + message.advertiserIdentifierCount = reader.int64(); + break; + } + case 5: { + message.cleanRoomIdentifier = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PairIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.PairIdInfo} PairIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PairIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PairIdInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PairIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.publisherId != null && message.hasOwnProperty("publisherId")) { + properties._publisherId = 1; + if (!$util.isInteger(message.publisherId) && !(message.publisherId && $util.isInteger(message.publisherId.low) && $util.isInteger(message.publisherId.high))) + return "publisherId: integer|Long expected"; + } + if (message.publisherName != null && message.hasOwnProperty("publisherName")) { + properties._publisherName = 1; + if (!$util.isString(message.publisherName)) + return "publisherName: string expected"; + } + if (message.matchRatePercentage != null && message.hasOwnProperty("matchRatePercentage")) + if (!$util.isInteger(message.matchRatePercentage)) + return "matchRatePercentage: integer expected"; + if (message.advertiserIdentifierCount != null && message.hasOwnProperty("advertiserIdentifierCount")) + if (!$util.isInteger(message.advertiserIdentifierCount) && !(message.advertiserIdentifierCount && $util.isInteger(message.advertiserIdentifierCount.low) && $util.isInteger(message.advertiserIdentifierCount.high))) + return "advertiserIdentifierCount: integer|Long expected"; + if (message.cleanRoomIdentifier != null && message.hasOwnProperty("cleanRoomIdentifier")) { + properties._cleanRoomIdentifier = 1; + if (!$util.isString(message.cleanRoomIdentifier)) + return "cleanRoomIdentifier: string expected"; + } + return null; + }; + + /** + * Creates a PairIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.PairIdInfo} PairIdInfo + */ + PairIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.PairIdInfo) + return object; + var message = new $root.google.ads.datamanager.v1.PairIdInfo(); + if (object.publisherId != null) + if ($util.Long) + (message.publisherId = $util.Long.fromValue(object.publisherId)).unsigned = false; + else if (typeof object.publisherId === "string") + message.publisherId = parseInt(object.publisherId, 10); + else if (typeof object.publisherId === "number") + message.publisherId = object.publisherId; + else if (typeof object.publisherId === "object") + message.publisherId = new $util.LongBits(object.publisherId.low >>> 0, object.publisherId.high >>> 0).toNumber(); + if (object.publisherName != null) + message.publisherName = String(object.publisherName); + if (object.matchRatePercentage != null) + message.matchRatePercentage = object.matchRatePercentage | 0; + if (object.advertiserIdentifierCount != null) + if ($util.Long) + (message.advertiserIdentifierCount = $util.Long.fromValue(object.advertiserIdentifierCount)).unsigned = false; + else if (typeof object.advertiserIdentifierCount === "string") + message.advertiserIdentifierCount = parseInt(object.advertiserIdentifierCount, 10); + else if (typeof object.advertiserIdentifierCount === "number") + message.advertiserIdentifierCount = object.advertiserIdentifierCount; + else if (typeof object.advertiserIdentifierCount === "object") + message.advertiserIdentifierCount = new $util.LongBits(object.advertiserIdentifierCount.low >>> 0, object.advertiserIdentifierCount.high >>> 0).toNumber(); + if (object.cleanRoomIdentifier != null) + message.cleanRoomIdentifier = String(object.cleanRoomIdentifier); + return message; + }; + + /** + * Creates a plain object from a PairIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {google.ads.datamanager.v1.PairIdInfo} message PairIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PairIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.matchRatePercentage = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.advertiserIdentifierCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.advertiserIdentifierCount = options.longs === String ? "0" : 0; + } + if (message.publisherId != null && message.hasOwnProperty("publisherId")) { + if (typeof message.publisherId === "number") + object.publisherId = options.longs === String ? String(message.publisherId) : message.publisherId; + else + object.publisherId = options.longs === String ? $util.Long.prototype.toString.call(message.publisherId) : options.longs === Number ? new $util.LongBits(message.publisherId.low >>> 0, message.publisherId.high >>> 0).toNumber() : message.publisherId; + if (options.oneofs) + object._publisherId = "publisherId"; + } + if (message.publisherName != null && message.hasOwnProperty("publisherName")) { + object.publisherName = message.publisherName; + if (options.oneofs) + object._publisherName = "publisherName"; + } + if (message.matchRatePercentage != null && message.hasOwnProperty("matchRatePercentage")) + object.matchRatePercentage = message.matchRatePercentage; + if (message.advertiserIdentifierCount != null && message.hasOwnProperty("advertiserIdentifierCount")) + if (typeof message.advertiserIdentifierCount === "number") + object.advertiserIdentifierCount = options.longs === String ? String(message.advertiserIdentifierCount) : message.advertiserIdentifierCount; + else + object.advertiserIdentifierCount = options.longs === String ? $util.Long.prototype.toString.call(message.advertiserIdentifierCount) : options.longs === Number ? new $util.LongBits(message.advertiserIdentifierCount.low >>> 0, message.advertiserIdentifierCount.high >>> 0).toNumber() : message.advertiserIdentifierCount; + if (message.cleanRoomIdentifier != null && message.hasOwnProperty("cleanRoomIdentifier")) { + object.cleanRoomIdentifier = message.cleanRoomIdentifier; + if (options.oneofs) + object._cleanRoomIdentifier = "cleanRoomIdentifier"; + } + return object; + }; + + /** + * Converts this PairIdInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.PairIdInfo + * @instance + * @returns {Object.} JSON object + */ + PairIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PairIdInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.PairIdInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PairIdInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.PairIdInfo"; + }; + + return PairIdInfo; + })(); + + v1.PartnerAudienceInfo = (function() { + + /** + * Properties of a PartnerAudienceInfo. + * @memberof google.ads.datamanager.v1 + * @interface IPartnerAudienceInfo + * @property {google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|null} [partnerAudienceSource] PartnerAudienceInfo partnerAudienceSource + * @property {string|null} [commercePartner] PartnerAudienceInfo commercePartner + */ + + /** + * Constructs a new PartnerAudienceInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PartnerAudienceInfo. + * @implements IPartnerAudienceInfo + * @constructor + * @param {google.ads.datamanager.v1.IPartnerAudienceInfo=} [properties] Properties to set + */ + function PartnerAudienceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartnerAudienceInfo partnerAudienceSource. + * @member {google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource|null|undefined} partnerAudienceSource + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @instance + */ + PartnerAudienceInfo.prototype.partnerAudienceSource = null; + + /** + * PartnerAudienceInfo commercePartner. + * @member {string|null|undefined} commercePartner + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @instance + */ + PartnerAudienceInfo.prototype.commercePartner = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartnerAudienceInfo.prototype, "_partnerAudienceSource", { + get: $util.oneOfGetter($oneOfFields = ["partnerAudienceSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartnerAudienceInfo.prototype, "_commercePartner", { + get: $util.oneOfGetter($oneOfFields = ["commercePartner"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartnerAudienceInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {google.ads.datamanager.v1.IPartnerAudienceInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.PartnerAudienceInfo} PartnerAudienceInfo instance + */ + PartnerAudienceInfo.create = function create(properties) { + return new PartnerAudienceInfo(properties); + }; + + /** + * Encodes the specified PartnerAudienceInfo message. Does not implicitly {@link google.ads.datamanager.v1.PartnerAudienceInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {google.ads.datamanager.v1.IPartnerAudienceInfo} message PartnerAudienceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartnerAudienceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partnerAudienceSource != null && Object.hasOwnProperty.call(message, "partnerAudienceSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partnerAudienceSource); + if (message.commercePartner != null && Object.hasOwnProperty.call(message, "commercePartner")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commercePartner); + return writer; + }; + + /** + * Encodes the specified PartnerAudienceInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PartnerAudienceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {google.ads.datamanager.v1.IPartnerAudienceInfo} message PartnerAudienceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartnerAudienceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartnerAudienceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.PartnerAudienceInfo} PartnerAudienceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartnerAudienceInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.PartnerAudienceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.partnerAudienceSource = reader.int32(); + break; + } + case 2: { + message.commercePartner = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartnerAudienceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.PartnerAudienceInfo} PartnerAudienceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartnerAudienceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartnerAudienceInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartnerAudienceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.partnerAudienceSource != null && message.hasOwnProperty("partnerAudienceSource")) { + properties._partnerAudienceSource = 1; + switch (message.partnerAudienceSource) { + default: + return "partnerAudienceSource: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.commercePartner != null && message.hasOwnProperty("commercePartner")) { + properties._commercePartner = 1; + if (!$util.isString(message.commercePartner)) + return "commercePartner: string expected"; + } + return null; + }; + + /** + * Creates a PartnerAudienceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.PartnerAudienceInfo} PartnerAudienceInfo + */ + PartnerAudienceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.PartnerAudienceInfo) + return object; + var message = new $root.google.ads.datamanager.v1.PartnerAudienceInfo(); + switch (object.partnerAudienceSource) { + default: + if (typeof object.partnerAudienceSource === "number") { + message.partnerAudienceSource = object.partnerAudienceSource; + break; + } + break; + case "PARTNER_AUDIENCE_SOURCE_UNSPECIFIED": + case 0: + message.partnerAudienceSource = 0; + break; + case "COMMERCE_AUDIENCE": + case 1: + message.partnerAudienceSource = 1; + break; + case "LINEAR_TV_AUDIENCE": + case 2: + message.partnerAudienceSource = 2; + break; + case "AGENCY_PROVIDER_AUDIENCE": + case 3: + message.partnerAudienceSource = 3; + break; + } + if (object.commercePartner != null) + message.commercePartner = String(object.commercePartner); + return message; + }; + + /** + * Creates a plain object from a PartnerAudienceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {google.ads.datamanager.v1.PartnerAudienceInfo} message PartnerAudienceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartnerAudienceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.partnerAudienceSource != null && message.hasOwnProperty("partnerAudienceSource")) { + object.partnerAudienceSource = options.enums === String ? $root.google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource[message.partnerAudienceSource] === undefined ? message.partnerAudienceSource : $root.google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource[message.partnerAudienceSource] : message.partnerAudienceSource; + if (options.oneofs) + object._partnerAudienceSource = "partnerAudienceSource"; + } + if (message.commercePartner != null && message.hasOwnProperty("commercePartner")) { + object.commercePartner = message.commercePartner; + if (options.oneofs) + object._commercePartner = "commercePartner"; + } + return object; + }; + + /** + * Converts this PartnerAudienceInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @instance + * @returns {Object.} JSON object + */ + PartnerAudienceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartnerAudienceInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.PartnerAudienceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartnerAudienceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.PartnerAudienceInfo"; + }; + + /** + * PartnerAudienceSource enum. + * @name google.ads.datamanager.v1.PartnerAudienceInfo.PartnerAudienceSource + * @enum {number} + * @property {number} PARTNER_AUDIENCE_SOURCE_UNSPECIFIED=0 PARTNER_AUDIENCE_SOURCE_UNSPECIFIED value + * @property {number} COMMERCE_AUDIENCE=1 COMMERCE_AUDIENCE value + * @property {number} LINEAR_TV_AUDIENCE=2 LINEAR_TV_AUDIENCE value + * @property {number} AGENCY_PROVIDER_AUDIENCE=3 AGENCY_PROVIDER_AUDIENCE value + */ + PartnerAudienceInfo.PartnerAudienceSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTNER_AUDIENCE_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMMERCE_AUDIENCE"] = 1; + values[valuesById[2] = "LINEAR_TV_AUDIENCE"] = 2; + values[valuesById[3] = "AGENCY_PROVIDER_AUDIENCE"] = 3; + return values; + })(); + + return PartnerAudienceInfo; + })(); + + v1.PseudonymousIdInfo = (function() { + + /** + * Properties of a PseudonymousIdInfo. + * @memberof google.ads.datamanager.v1 + * @interface IPseudonymousIdInfo + * @property {google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|null} [syncStatus] PseudonymousIdInfo syncStatus + * @property {number|Long|null} [billableRecordCount] PseudonymousIdInfo billableRecordCount + */ + + /** + * Constructs a new PseudonymousIdInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a PseudonymousIdInfo. + * @implements IPseudonymousIdInfo + * @constructor + * @param {google.ads.datamanager.v1.IPseudonymousIdInfo=} [properties] Properties to set + */ + function PseudonymousIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PseudonymousIdInfo syncStatus. + * @member {google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus|null|undefined} syncStatus + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @instance + */ + PseudonymousIdInfo.prototype.syncStatus = null; + + /** + * PseudonymousIdInfo billableRecordCount. + * @member {number|Long|null|undefined} billableRecordCount + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @instance + */ + PseudonymousIdInfo.prototype.billableRecordCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PseudonymousIdInfo.prototype, "_syncStatus", { + get: $util.oneOfGetter($oneOfFields = ["syncStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PseudonymousIdInfo.prototype, "_billableRecordCount", { + get: $util.oneOfGetter($oneOfFields = ["billableRecordCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PseudonymousIdInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {google.ads.datamanager.v1.IPseudonymousIdInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.PseudonymousIdInfo} PseudonymousIdInfo instance + */ + PseudonymousIdInfo.create = function create(properties) { + return new PseudonymousIdInfo(properties); + }; + + /** + * Encodes the specified PseudonymousIdInfo message. Does not implicitly {@link google.ads.datamanager.v1.PseudonymousIdInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {google.ads.datamanager.v1.IPseudonymousIdInfo} message PseudonymousIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PseudonymousIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.syncStatus != null && Object.hasOwnProperty.call(message, "syncStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.syncStatus); + if (message.billableRecordCount != null && Object.hasOwnProperty.call(message, "billableRecordCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.billableRecordCount); + return writer; + }; + + /** + * Encodes the specified PseudonymousIdInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.PseudonymousIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {google.ads.datamanager.v1.IPseudonymousIdInfo} message PseudonymousIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PseudonymousIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PseudonymousIdInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.PseudonymousIdInfo} PseudonymousIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PseudonymousIdInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.PseudonymousIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.syncStatus = reader.int32(); + break; + } + case 2: { + message.billableRecordCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PseudonymousIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.PseudonymousIdInfo} PseudonymousIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PseudonymousIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PseudonymousIdInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PseudonymousIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.syncStatus != null && message.hasOwnProperty("syncStatus")) { + properties._syncStatus = 1; + switch (message.syncStatus) { + default: + return "syncStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.billableRecordCount != null && message.hasOwnProperty("billableRecordCount")) { + properties._billableRecordCount = 1; + if (!$util.isInteger(message.billableRecordCount) && !(message.billableRecordCount && $util.isInteger(message.billableRecordCount.low) && $util.isInteger(message.billableRecordCount.high))) + return "billableRecordCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a PseudonymousIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.PseudonymousIdInfo} PseudonymousIdInfo + */ + PseudonymousIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.PseudonymousIdInfo) + return object; + var message = new $root.google.ads.datamanager.v1.PseudonymousIdInfo(); + switch (object.syncStatus) { + default: + if (typeof object.syncStatus === "number") { + message.syncStatus = object.syncStatus; + break; + } + break; + case "SYNC_STATUS_UNSPECIFIED": + case 0: + message.syncStatus = 0; + break; + case "CREATED": + case 1: + message.syncStatus = 1; + break; + case "READY_FOR_USE": + case 2: + message.syncStatus = 2; + break; + case "FAILED": + case 3: + message.syncStatus = 3; + break; + } + if (object.billableRecordCount != null) + if ($util.Long) + (message.billableRecordCount = $util.Long.fromValue(object.billableRecordCount)).unsigned = false; + else if (typeof object.billableRecordCount === "string") + message.billableRecordCount = parseInt(object.billableRecordCount, 10); + else if (typeof object.billableRecordCount === "number") + message.billableRecordCount = object.billableRecordCount; + else if (typeof object.billableRecordCount === "object") + message.billableRecordCount = new $util.LongBits(object.billableRecordCount.low >>> 0, object.billableRecordCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PseudonymousIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {google.ads.datamanager.v1.PseudonymousIdInfo} message PseudonymousIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PseudonymousIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.syncStatus != null && message.hasOwnProperty("syncStatus")) { + object.syncStatus = options.enums === String ? $root.google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus[message.syncStatus] === undefined ? message.syncStatus : $root.google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus[message.syncStatus] : message.syncStatus; + if (options.oneofs) + object._syncStatus = "syncStatus"; + } + if (message.billableRecordCount != null && message.hasOwnProperty("billableRecordCount")) { + if (typeof message.billableRecordCount === "number") + object.billableRecordCount = options.longs === String ? String(message.billableRecordCount) : message.billableRecordCount; + else + object.billableRecordCount = options.longs === String ? $util.Long.prototype.toString.call(message.billableRecordCount) : options.longs === Number ? new $util.LongBits(message.billableRecordCount.low >>> 0, message.billableRecordCount.high >>> 0).toNumber() : message.billableRecordCount; + if (options.oneofs) + object._billableRecordCount = "billableRecordCount"; + } + return object; + }; + + /** + * Converts this PseudonymousIdInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @instance + * @returns {Object.} JSON object + */ + PseudonymousIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PseudonymousIdInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.PseudonymousIdInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PseudonymousIdInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.PseudonymousIdInfo"; + }; + + /** + * SyncStatus enum. + * @name google.ads.datamanager.v1.PseudonymousIdInfo.SyncStatus + * @enum {number} + * @property {number} SYNC_STATUS_UNSPECIFIED=0 SYNC_STATUS_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} READY_FOR_USE=2 READY_FOR_USE value + * @property {number} FAILED=3 FAILED value + */ + PseudonymousIdInfo.SyncStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYNC_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "READY_FOR_USE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return PseudonymousIdInfo; + })(); + + /** + * DataSourceType enum. + * @name google.ads.datamanager.v1.DataSourceType + * @enum {number} + * @property {number} DATA_SOURCE_TYPE_UNSPECIFIED=0 DATA_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DATA_SOURCE_TYPE_FIRST_PARTY=1 DATA_SOURCE_TYPE_FIRST_PARTY value + * @property {number} DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU=2 DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU value + * @property {number} DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE=3 DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE value + * @property {number} DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA=4 DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA value + */ + v1.DataSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATA_SOURCE_TYPE_FIRST_PARTY"] = 1; + values[valuesById[2] = "DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU"] = 2; + values[valuesById[3] = "DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE"] = 3; + values[valuesById[4] = "DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA"] = 4; + return values; + })(); + + v1.UserListDirectLicense = (function() { + + /** + * Properties of a UserListDirectLicense. + * @memberof google.ads.datamanager.v1 + * @interface IUserListDirectLicense + * @property {string|null} [name] UserListDirectLicense name + * @property {number|Long|null} [userListId] UserListDirectLicense userListId + * @property {string|null} [userListDisplayName] UserListDirectLicense userListDisplayName + * @property {google.ads.datamanager.v1.UserListLicenseClientAccountType|null} [clientAccountType] UserListDirectLicense clientAccountType + * @property {number|Long|null} [clientAccountId] UserListDirectLicense clientAccountId + * @property {string|null} [clientAccountDisplayName] UserListDirectLicense clientAccountDisplayName + * @property {google.ads.datamanager.v1.UserListLicenseStatus|null} [status] UserListDirectLicense status + * @property {google.ads.datamanager.v1.IUserListLicensePricing|null} [pricing] UserListDirectLicense pricing + * @property {Array.|null} [historicalPricings] UserListDirectLicense historicalPricings + * @property {google.ads.datamanager.v1.IUserListLicenseMetrics|null} [metrics] UserListDirectLicense metrics + */ + + /** + * Constructs a new UserListDirectLicense. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListDirectLicense. + * @implements IUserListDirectLicense + * @constructor + * @param {google.ads.datamanager.v1.IUserListDirectLicense=} [properties] Properties to set + */ + function UserListDirectLicense(properties) { + this.historicalPricings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserListDirectLicense name. + * @member {string} name + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.name = ""; + + /** + * UserListDirectLicense userListId. + * @member {number|Long|null|undefined} userListId + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.userListId = null; + + /** + * UserListDirectLicense userListDisplayName. + * @member {string} userListDisplayName + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.userListDisplayName = ""; + + /** + * UserListDirectLicense clientAccountType. + * @member {google.ads.datamanager.v1.UserListLicenseClientAccountType|null|undefined} clientAccountType + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.clientAccountType = null; + + /** + * UserListDirectLicense clientAccountId. + * @member {number|Long|null|undefined} clientAccountId + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.clientAccountId = null; + + /** + * UserListDirectLicense clientAccountDisplayName. + * @member {string} clientAccountDisplayName + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.clientAccountDisplayName = ""; + + /** + * UserListDirectLicense status. + * @member {google.ads.datamanager.v1.UserListLicenseStatus|null|undefined} status + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.status = null; + + /** + * UserListDirectLicense pricing. + * @member {google.ads.datamanager.v1.IUserListLicensePricing|null|undefined} pricing + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.pricing = null; + + /** + * UserListDirectLicense historicalPricings. + * @member {Array.} historicalPricings + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.historicalPricings = $util.emptyArray; + + /** + * UserListDirectLicense metrics. + * @member {google.ads.datamanager.v1.IUserListLicenseMetrics|null|undefined} metrics + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + */ + UserListDirectLicense.prototype.metrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListDirectLicense.prototype, "_userListId", { + get: $util.oneOfGetter($oneOfFields = ["userListId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListDirectLicense.prototype, "_clientAccountType", { + get: $util.oneOfGetter($oneOfFields = ["clientAccountType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListDirectLicense.prototype, "_clientAccountId", { + get: $util.oneOfGetter($oneOfFields = ["clientAccountId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListDirectLicense.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserListDirectLicense instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {google.ads.datamanager.v1.IUserListDirectLicense=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserListDirectLicense} UserListDirectLicense instance + */ + UserListDirectLicense.create = function create(properties) { + return new UserListDirectLicense(properties); + }; + + /** + * Encodes the specified UserListDirectLicense message. Does not implicitly {@link google.ads.datamanager.v1.UserListDirectLicense.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {google.ads.datamanager.v1.IUserListDirectLicense} message UserListDirectLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListDirectLicense.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.userListId != null && Object.hasOwnProperty.call(message, "userListId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userListId); + if (message.userListDisplayName != null && Object.hasOwnProperty.call(message, "userListDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userListDisplayName); + if (message.clientAccountType != null && Object.hasOwnProperty.call(message, "clientAccountType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.clientAccountType); + if (message.clientAccountId != null && Object.hasOwnProperty.call(message, "clientAccountId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.clientAccountId); + if (message.clientAccountDisplayName != null && Object.hasOwnProperty.call(message, "clientAccountDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientAccountDisplayName); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.status); + if (message.pricing != null && Object.hasOwnProperty.call(message, "pricing")) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.pricing, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.historicalPricings != null && message.historicalPricings.length) + for (var i = 0; i < message.historicalPricings.length; ++i) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.historicalPricings[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.ads.datamanager.v1.UserListLicenseMetrics.encode(message.metrics, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserListDirectLicense message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListDirectLicense.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {google.ads.datamanager.v1.IUserListDirectLicense} message UserListDirectLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListDirectLicense.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserListDirectLicense message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserListDirectLicense} UserListDirectLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListDirectLicense.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserListDirectLicense(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userListId = reader.int64(); + break; + } + case 3: { + message.userListDisplayName = reader.string(); + break; + } + case 4: { + message.clientAccountType = reader.int32(); + break; + } + case 5: { + message.clientAccountId = reader.int64(); + break; + } + case 6: { + message.clientAccountDisplayName = reader.string(); + break; + } + case 7: { + message.status = reader.int32(); + break; + } + case 8: { + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.historicalPricings && message.historicalPricings.length)) + message.historicalPricings = []; + message.historicalPricings.push($root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32())); + break; + } + case 10: { + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserListDirectLicense message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserListDirectLicense} UserListDirectLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListDirectLicense.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserListDirectLicense message. + * @function verify + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserListDirectLicense.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userListId != null && message.hasOwnProperty("userListId")) { + properties._userListId = 1; + if (!$util.isInteger(message.userListId) && !(message.userListId && $util.isInteger(message.userListId.low) && $util.isInteger(message.userListId.high))) + return "userListId: integer|Long expected"; + } + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + if (!$util.isString(message.userListDisplayName)) + return "userListDisplayName: string expected"; + if (message.clientAccountType != null && message.hasOwnProperty("clientAccountType")) { + properties._clientAccountType = 1; + switch (message.clientAccountType) { + default: + return "clientAccountType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.clientAccountId != null && message.hasOwnProperty("clientAccountId")) { + properties._clientAccountId = 1; + if (!$util.isInteger(message.clientAccountId) && !(message.clientAccountId && $util.isInteger(message.clientAccountId.low) && $util.isInteger(message.clientAccountId.high))) + return "clientAccountId: integer|Long expected"; + } + if (message.clientAccountDisplayName != null && message.hasOwnProperty("clientAccountDisplayName")) + if (!$util.isString(message.clientAccountDisplayName)) + return "clientAccountDisplayName: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.pricing != null && message.hasOwnProperty("pricing")) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.pricing); + if (error) + return "pricing." + error; + } + if (message.historicalPricings != null && message.hasOwnProperty("historicalPricings")) { + if (!Array.isArray(message.historicalPricings)) + return "historicalPricings: array expected"; + for (var i = 0; i < message.historicalPricings.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.historicalPricings[i]); + if (error) + return "historicalPricings." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.ads.datamanager.v1.UserListLicenseMetrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a UserListDirectLicense message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserListDirectLicense} UserListDirectLicense + */ + UserListDirectLicense.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserListDirectLicense) + return object; + var message = new $root.google.ads.datamanager.v1.UserListDirectLicense(); + if (object.name != null) + message.name = String(object.name); + if (object.userListId != null) + if ($util.Long) + (message.userListId = $util.Long.fromValue(object.userListId)).unsigned = false; + else if (typeof object.userListId === "string") + message.userListId = parseInt(object.userListId, 10); + else if (typeof object.userListId === "number") + message.userListId = object.userListId; + else if (typeof object.userListId === "object") + message.userListId = new $util.LongBits(object.userListId.low >>> 0, object.userListId.high >>> 0).toNumber(); + if (object.userListDisplayName != null) + message.userListDisplayName = String(object.userListDisplayName); + switch (object.clientAccountType) { + default: + if (typeof object.clientAccountType === "number") { + message.clientAccountType = object.clientAccountType; + break; + } + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN": + case 0: + message.clientAccountType = 0; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS": + case 1: + message.clientAccountType = 1; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER": + case 2: + message.clientAccountType = 2; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER": + case 3: + message.clientAccountType = 3; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK": + case 4: + message.clientAccountType = 4; + break; + } + if (object.clientAccountId != null) + if ($util.Long) + (message.clientAccountId = $util.Long.fromValue(object.clientAccountId)).unsigned = false; + else if (typeof object.clientAccountId === "string") + message.clientAccountId = parseInt(object.clientAccountId, 10); + else if (typeof object.clientAccountId === "number") + message.clientAccountId = object.clientAccountId; + else if (typeof object.clientAccountId === "object") + message.clientAccountId = new $util.LongBits(object.clientAccountId.low >>> 0, object.clientAccountId.high >>> 0).toNumber(); + if (object.clientAccountDisplayName != null) + message.clientAccountDisplayName = String(object.clientAccountDisplayName); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "USER_LIST_LICENSE_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "USER_LIST_LICENSE_STATUS_ENABLED": + case 1: + message.status = 1; + break; + case "USER_LIST_LICENSE_STATUS_DISABLED": + case 2: + message.status = 2; + break; + } + if (object.pricing != null) { + if (typeof object.pricing !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListDirectLicense.pricing: object expected"); + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.pricing); + } + if (object.historicalPricings) { + if (!Array.isArray(object.historicalPricings)) + throw TypeError(".google.ads.datamanager.v1.UserListDirectLicense.historicalPricings: array expected"); + message.historicalPricings = []; + for (var i = 0; i < object.historicalPricings.length; ++i) { + if (typeof object.historicalPricings[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListDirectLicense.historicalPricings: object expected"); + message.historicalPricings[i] = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.historicalPricings[i]); + } + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListDirectLicense.metrics: object expected"); + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a UserListDirectLicense message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {google.ads.datamanager.v1.UserListDirectLicense} message UserListDirectLicense + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserListDirectLicense.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalPricings = []; + if (options.defaults) { + object.name = ""; + object.userListDisplayName = ""; + object.clientAccountDisplayName = ""; + object.pricing = null; + object.metrics = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userListId != null && message.hasOwnProperty("userListId")) { + if (typeof message.userListId === "number") + object.userListId = options.longs === String ? String(message.userListId) : message.userListId; + else + object.userListId = options.longs === String ? $util.Long.prototype.toString.call(message.userListId) : options.longs === Number ? new $util.LongBits(message.userListId.low >>> 0, message.userListId.high >>> 0).toNumber() : message.userListId; + if (options.oneofs) + object._userListId = "userListId"; + } + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + object.userListDisplayName = message.userListDisplayName; + if (message.clientAccountType != null && message.hasOwnProperty("clientAccountType")) { + object.clientAccountType = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicenseClientAccountType[message.clientAccountType] === undefined ? message.clientAccountType : $root.google.ads.datamanager.v1.UserListLicenseClientAccountType[message.clientAccountType] : message.clientAccountType; + if (options.oneofs) + object._clientAccountType = "clientAccountType"; + } + if (message.clientAccountId != null && message.hasOwnProperty("clientAccountId")) { + if (typeof message.clientAccountId === "number") + object.clientAccountId = options.longs === String ? String(message.clientAccountId) : message.clientAccountId; + else + object.clientAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.clientAccountId) : options.longs === Number ? new $util.LongBits(message.clientAccountId.low >>> 0, message.clientAccountId.high >>> 0).toNumber() : message.clientAccountId; + if (options.oneofs) + object._clientAccountId = "clientAccountId"; + } + if (message.clientAccountDisplayName != null && message.hasOwnProperty("clientAccountDisplayName")) + object.clientAccountDisplayName = message.clientAccountDisplayName; + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] === undefined ? message.status : $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.pricing != null && message.hasOwnProperty("pricing")) + object.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.pricing, options); + if (message.historicalPricings && message.historicalPricings.length) { + object.historicalPricings = []; + for (var j = 0; j < message.historicalPricings.length; ++j) + object.historicalPricings[j] = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.historicalPricings[j], options); + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this UserListDirectLicense to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @instance + * @returns {Object.} JSON object + */ + UserListDirectLicense.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserListDirectLicense + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserListDirectLicense + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserListDirectLicense.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserListDirectLicense"; + }; + + return UserListDirectLicense; + })(); + + /** + * UserListLicenseClientAccountType enum. + * @name google.ads.datamanager.v1.UserListLicenseClientAccountType + * @enum {number} + * @property {number} USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN=0 USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN value + * @property {number} USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS=1 USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS value + * @property {number} USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER=2 USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER value + * @property {number} USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER=3 USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER value + * @property {number} USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK=4 USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK value + */ + v1.UserListLicenseClientAccountType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS"] = 1; + values[valuesById[2] = "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER"] = 2; + values[valuesById[3] = "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER"] = 3; + values[valuesById[4] = "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK"] = 4; + return values; + })(); + + v1.UserListLicenseMetrics = (function() { + + /** + * Properties of a UserListLicenseMetrics. + * @memberof google.ads.datamanager.v1 + * @interface IUserListLicenseMetrics + * @property {number|Long|null} [clickCount] UserListLicenseMetrics clickCount + * @property {number|Long|null} [impressionCount] UserListLicenseMetrics impressionCount + * @property {number|Long|null} [revenueUsdMicros] UserListLicenseMetrics revenueUsdMicros + * @property {number|Long|null} [startDate] UserListLicenseMetrics startDate + * @property {number|Long|null} [endDate] UserListLicenseMetrics endDate + */ + + /** + * Constructs a new UserListLicenseMetrics. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListLicenseMetrics. + * @implements IUserListLicenseMetrics + * @constructor + * @param {google.ads.datamanager.v1.IUserListLicenseMetrics=} [properties] Properties to set + */ + function UserListLicenseMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserListLicenseMetrics clickCount. + * @member {number|Long} clickCount + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + */ + UserListLicenseMetrics.prototype.clickCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListLicenseMetrics impressionCount. + * @member {number|Long} impressionCount + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + */ + UserListLicenseMetrics.prototype.impressionCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListLicenseMetrics revenueUsdMicros. + * @member {number|Long} revenueUsdMicros + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + */ + UserListLicenseMetrics.prototype.revenueUsdMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListLicenseMetrics startDate. + * @member {number|Long} startDate + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + */ + UserListLicenseMetrics.prototype.startDate = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListLicenseMetrics endDate. + * @member {number|Long} endDate + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + */ + UserListLicenseMetrics.prototype.endDate = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UserListLicenseMetrics instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {google.ads.datamanager.v1.IUserListLicenseMetrics=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserListLicenseMetrics} UserListLicenseMetrics instance + */ + UserListLicenseMetrics.create = function create(properties) { + return new UserListLicenseMetrics(properties); + }; + + /** + * Encodes the specified UserListLicenseMetrics message. Does not implicitly {@link google.ads.datamanager.v1.UserListLicenseMetrics.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {google.ads.datamanager.v1.IUserListLicenseMetrics} message UserListLicenseMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListLicenseMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clickCount != null && Object.hasOwnProperty.call(message, "clickCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.clickCount); + if (message.impressionCount != null && Object.hasOwnProperty.call(message, "impressionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.impressionCount); + if (message.revenueUsdMicros != null && Object.hasOwnProperty.call(message, "revenueUsdMicros")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.revenueUsdMicros); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.startDate); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.endDate); + return writer; + }; + + /** + * Encodes the specified UserListLicenseMetrics message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListLicenseMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {google.ads.datamanager.v1.IUserListLicenseMetrics} message UserListLicenseMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListLicenseMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserListLicenseMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserListLicenseMetrics} UserListLicenseMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListLicenseMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserListLicenseMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clickCount = reader.int64(); + break; + } + case 2: { + message.impressionCount = reader.int64(); + break; + } + case 3: { + message.revenueUsdMicros = reader.int64(); + break; + } + case 4: { + message.startDate = reader.int64(); + break; + } + case 5: { + message.endDate = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserListLicenseMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserListLicenseMetrics} UserListLicenseMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListLicenseMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserListLicenseMetrics message. + * @function verify + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserListLicenseMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clickCount != null && message.hasOwnProperty("clickCount")) + if (!$util.isInteger(message.clickCount) && !(message.clickCount && $util.isInteger(message.clickCount.low) && $util.isInteger(message.clickCount.high))) + return "clickCount: integer|Long expected"; + if (message.impressionCount != null && message.hasOwnProperty("impressionCount")) + if (!$util.isInteger(message.impressionCount) && !(message.impressionCount && $util.isInteger(message.impressionCount.low) && $util.isInteger(message.impressionCount.high))) + return "impressionCount: integer|Long expected"; + if (message.revenueUsdMicros != null && message.hasOwnProperty("revenueUsdMicros")) + if (!$util.isInteger(message.revenueUsdMicros) && !(message.revenueUsdMicros && $util.isInteger(message.revenueUsdMicros.low) && $util.isInteger(message.revenueUsdMicros.high))) + return "revenueUsdMicros: integer|Long expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) + if (!$util.isInteger(message.startDate) && !(message.startDate && $util.isInteger(message.startDate.low) && $util.isInteger(message.startDate.high))) + return "startDate: integer|Long expected"; + if (message.endDate != null && message.hasOwnProperty("endDate")) + if (!$util.isInteger(message.endDate) && !(message.endDate && $util.isInteger(message.endDate.low) && $util.isInteger(message.endDate.high))) + return "endDate: integer|Long expected"; + return null; + }; + + /** + * Creates a UserListLicenseMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserListLicenseMetrics} UserListLicenseMetrics + */ + UserListLicenseMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserListLicenseMetrics) + return object; + var message = new $root.google.ads.datamanager.v1.UserListLicenseMetrics(); + if (object.clickCount != null) + if ($util.Long) + (message.clickCount = $util.Long.fromValue(object.clickCount)).unsigned = false; + else if (typeof object.clickCount === "string") + message.clickCount = parseInt(object.clickCount, 10); + else if (typeof object.clickCount === "number") + message.clickCount = object.clickCount; + else if (typeof object.clickCount === "object") + message.clickCount = new $util.LongBits(object.clickCount.low >>> 0, object.clickCount.high >>> 0).toNumber(); + if (object.impressionCount != null) + if ($util.Long) + (message.impressionCount = $util.Long.fromValue(object.impressionCount)).unsigned = false; + else if (typeof object.impressionCount === "string") + message.impressionCount = parseInt(object.impressionCount, 10); + else if (typeof object.impressionCount === "number") + message.impressionCount = object.impressionCount; + else if (typeof object.impressionCount === "object") + message.impressionCount = new $util.LongBits(object.impressionCount.low >>> 0, object.impressionCount.high >>> 0).toNumber(); + if (object.revenueUsdMicros != null) + if ($util.Long) + (message.revenueUsdMicros = $util.Long.fromValue(object.revenueUsdMicros)).unsigned = false; + else if (typeof object.revenueUsdMicros === "string") + message.revenueUsdMicros = parseInt(object.revenueUsdMicros, 10); + else if (typeof object.revenueUsdMicros === "number") + message.revenueUsdMicros = object.revenueUsdMicros; + else if (typeof object.revenueUsdMicros === "object") + message.revenueUsdMicros = new $util.LongBits(object.revenueUsdMicros.low >>> 0, object.revenueUsdMicros.high >>> 0).toNumber(); + if (object.startDate != null) + if ($util.Long) + (message.startDate = $util.Long.fromValue(object.startDate)).unsigned = false; + else if (typeof object.startDate === "string") + message.startDate = parseInt(object.startDate, 10); + else if (typeof object.startDate === "number") + message.startDate = object.startDate; + else if (typeof object.startDate === "object") + message.startDate = new $util.LongBits(object.startDate.low >>> 0, object.startDate.high >>> 0).toNumber(); + if (object.endDate != null) + if ($util.Long) + (message.endDate = $util.Long.fromValue(object.endDate)).unsigned = false; + else if (typeof object.endDate === "string") + message.endDate = parseInt(object.endDate, 10); + else if (typeof object.endDate === "number") + message.endDate = object.endDate; + else if (typeof object.endDate === "object") + message.endDate = new $util.LongBits(object.endDate.low >>> 0, object.endDate.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a UserListLicenseMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {google.ads.datamanager.v1.UserListLicenseMetrics} message UserListLicenseMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserListLicenseMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.clickCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.clickCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.impressionCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.impressionCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.revenueUsdMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revenueUsdMicros = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startDate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startDate = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endDate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endDate = options.longs === String ? "0" : 0; + } + if (message.clickCount != null && message.hasOwnProperty("clickCount")) + if (typeof message.clickCount === "number") + object.clickCount = options.longs === String ? String(message.clickCount) : message.clickCount; + else + object.clickCount = options.longs === String ? $util.Long.prototype.toString.call(message.clickCount) : options.longs === Number ? new $util.LongBits(message.clickCount.low >>> 0, message.clickCount.high >>> 0).toNumber() : message.clickCount; + if (message.impressionCount != null && message.hasOwnProperty("impressionCount")) + if (typeof message.impressionCount === "number") + object.impressionCount = options.longs === String ? String(message.impressionCount) : message.impressionCount; + else + object.impressionCount = options.longs === String ? $util.Long.prototype.toString.call(message.impressionCount) : options.longs === Number ? new $util.LongBits(message.impressionCount.low >>> 0, message.impressionCount.high >>> 0).toNumber() : message.impressionCount; + if (message.revenueUsdMicros != null && message.hasOwnProperty("revenueUsdMicros")) + if (typeof message.revenueUsdMicros === "number") + object.revenueUsdMicros = options.longs === String ? String(message.revenueUsdMicros) : message.revenueUsdMicros; + else + object.revenueUsdMicros = options.longs === String ? $util.Long.prototype.toString.call(message.revenueUsdMicros) : options.longs === Number ? new $util.LongBits(message.revenueUsdMicros.low >>> 0, message.revenueUsdMicros.high >>> 0).toNumber() : message.revenueUsdMicros; + if (message.startDate != null && message.hasOwnProperty("startDate")) + if (typeof message.startDate === "number") + object.startDate = options.longs === String ? String(message.startDate) : message.startDate; + else + object.startDate = options.longs === String ? $util.Long.prototype.toString.call(message.startDate) : options.longs === Number ? new $util.LongBits(message.startDate.low >>> 0, message.startDate.high >>> 0).toNumber() : message.startDate; + if (message.endDate != null && message.hasOwnProperty("endDate")) + if (typeof message.endDate === "number") + object.endDate = options.longs === String ? String(message.endDate) : message.endDate; + else + object.endDate = options.longs === String ? $util.Long.prototype.toString.call(message.endDate) : options.longs === Number ? new $util.LongBits(message.endDate.low >>> 0, message.endDate.high >>> 0).toNumber() : message.endDate; + return object; + }; + + /** + * Converts this UserListLicenseMetrics to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @instance + * @returns {Object.} JSON object + */ + UserListLicenseMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserListLicenseMetrics + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserListLicenseMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserListLicenseMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserListLicenseMetrics"; + }; + + return UserListLicenseMetrics; + })(); + + v1.UserListLicensePricing = (function() { + + /** + * Properties of a UserListLicensePricing. + * @memberof google.ads.datamanager.v1 + * @interface IUserListLicensePricing + * @property {number|Long|null} [pricingId] UserListLicensePricing pricingId + * @property {number|Long|null} [costMicros] UserListLicensePricing costMicros + * @property {string|null} [currencyCode] UserListLicensePricing currencyCode + * @property {google.protobuf.ITimestamp|null} [startTime] UserListLicensePricing startTime + * @property {google.protobuf.ITimestamp|null} [endTime] UserListLicensePricing endTime + * @property {boolean|null} [pricingActive] UserListLicensePricing pricingActive + * @property {google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState|null} [buyerApprovalState] UserListLicensePricing buyerApprovalState + * @property {google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|null} [costType] UserListLicensePricing costType + * @property {number|Long|null} [maxCostMicros] UserListLicensePricing maxCostMicros + */ + + /** + * Constructs a new UserListLicensePricing. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListLicensePricing. + * @implements IUserListLicensePricing + * @constructor + * @param {google.ads.datamanager.v1.IUserListLicensePricing=} [properties] Properties to set + */ + function UserListLicensePricing(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserListLicensePricing pricingId. + * @member {number|Long} pricingId + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.pricingId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListLicensePricing costMicros. + * @member {number|Long|null|undefined} costMicros + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.costMicros = null; + + /** + * UserListLicensePricing currencyCode. + * @member {string|null|undefined} currencyCode + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.currencyCode = null; + + /** + * UserListLicensePricing startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.startTime = null; + + /** + * UserListLicensePricing endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.endTime = null; + + /** + * UserListLicensePricing pricingActive. + * @member {boolean} pricingActive + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.pricingActive = false; + + /** + * UserListLicensePricing buyerApprovalState. + * @member {google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState} buyerApprovalState + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.buyerApprovalState = 0; + + /** + * UserListLicensePricing costType. + * @member {google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType|null|undefined} costType + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.costType = null; + + /** + * UserListLicensePricing maxCostMicros. + * @member {number|Long|null|undefined} maxCostMicros + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + */ + UserListLicensePricing.prototype.maxCostMicros = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListLicensePricing.prototype, "_costMicros", { + get: $util.oneOfGetter($oneOfFields = ["costMicros"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListLicensePricing.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListLicensePricing.prototype, "_costType", { + get: $util.oneOfGetter($oneOfFields = ["costType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListLicensePricing.prototype, "_maxCostMicros", { + get: $util.oneOfGetter($oneOfFields = ["maxCostMicros"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserListLicensePricing instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {google.ads.datamanager.v1.IUserListLicensePricing=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserListLicensePricing} UserListLicensePricing instance + */ + UserListLicensePricing.create = function create(properties) { + return new UserListLicensePricing(properties); + }; + + /** + * Encodes the specified UserListLicensePricing message. Does not implicitly {@link google.ads.datamanager.v1.UserListLicensePricing.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {google.ads.datamanager.v1.IUserListLicensePricing} message UserListLicensePricing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListLicensePricing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pricingId != null && Object.hasOwnProperty.call(message, "pricingId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.pricingId); + if (message.costMicros != null && Object.hasOwnProperty.call(message, "costMicros")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.costMicros); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pricingActive != null && Object.hasOwnProperty.call(message, "pricingActive")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.pricingActive); + if (message.buyerApprovalState != null && Object.hasOwnProperty.call(message, "buyerApprovalState")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.buyerApprovalState); + if (message.costType != null && Object.hasOwnProperty.call(message, "costType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.costType); + if (message.maxCostMicros != null && Object.hasOwnProperty.call(message, "maxCostMicros")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxCostMicros); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.currencyCode); + return writer; + }; + + /** + * Encodes the specified UserListLicensePricing message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListLicensePricing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {google.ads.datamanager.v1.IUserListLicensePricing} message UserListLicensePricing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListLicensePricing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserListLicensePricing message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserListLicensePricing} UserListLicensePricing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListLicensePricing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserListLicensePricing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pricingId = reader.int64(); + break; + } + case 2: { + message.costMicros = reader.int64(); + break; + } + case 9: { + message.currencyCode = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pricingActive = reader.bool(); + break; + } + case 6: { + message.buyerApprovalState = reader.int32(); + break; + } + case 7: { + message.costType = reader.int32(); + break; + } + case 8: { + message.maxCostMicros = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserListLicensePricing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserListLicensePricing} UserListLicensePricing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListLicensePricing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserListLicensePricing message. + * @function verify + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserListLicensePricing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pricingId != null && message.hasOwnProperty("pricingId")) + if (!$util.isInteger(message.pricingId) && !(message.pricingId && $util.isInteger(message.pricingId.low) && $util.isInteger(message.pricingId.high))) + return "pricingId: integer|Long expected"; + if (message.costMicros != null && message.hasOwnProperty("costMicros")) { + properties._costMicros = 1; + if (!$util.isInteger(message.costMicros) && !(message.costMicros && $util.isInteger(message.costMicros.low) && $util.isInteger(message.costMicros.high))) + return "costMicros: integer|Long expected"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + properties._currencyCode = 1; + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.pricingActive != null && message.hasOwnProperty("pricingActive")) + if (typeof message.pricingActive !== "boolean") + return "pricingActive: boolean expected"; + if (message.buyerApprovalState != null && message.hasOwnProperty("buyerApprovalState")) + switch (message.buyerApprovalState) { + default: + return "buyerApprovalState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.costType != null && message.hasOwnProperty("costType")) { + properties._costType = 1; + switch (message.costType) { + default: + return "costType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.maxCostMicros != null && message.hasOwnProperty("maxCostMicros")) { + properties._maxCostMicros = 1; + if (!$util.isInteger(message.maxCostMicros) && !(message.maxCostMicros && $util.isInteger(message.maxCostMicros.low) && $util.isInteger(message.maxCostMicros.high))) + return "maxCostMicros: integer|Long expected"; + } + return null; + }; + + /** + * Creates a UserListLicensePricing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserListLicensePricing} UserListLicensePricing + */ + UserListLicensePricing.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserListLicensePricing) + return object; + var message = new $root.google.ads.datamanager.v1.UserListLicensePricing(); + if (object.pricingId != null) + if ($util.Long) + (message.pricingId = $util.Long.fromValue(object.pricingId)).unsigned = false; + else if (typeof object.pricingId === "string") + message.pricingId = parseInt(object.pricingId, 10); + else if (typeof object.pricingId === "number") + message.pricingId = object.pricingId; + else if (typeof object.pricingId === "object") + message.pricingId = new $util.LongBits(object.pricingId.low >>> 0, object.pricingId.high >>> 0).toNumber(); + if (object.costMicros != null) + if ($util.Long) + (message.costMicros = $util.Long.fromValue(object.costMicros)).unsigned = false; + else if (typeof object.costMicros === "string") + message.costMicros = parseInt(object.costMicros, 10); + else if (typeof object.costMicros === "number") + message.costMicros = object.costMicros; + else if (typeof object.costMicros === "object") + message.costMicros = new $util.LongBits(object.costMicros.low >>> 0, object.costMicros.high >>> 0).toNumber(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListLicensePricing.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListLicensePricing.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.pricingActive != null) + message.pricingActive = Boolean(object.pricingActive); + switch (object.buyerApprovalState) { + default: + if (typeof object.buyerApprovalState === "number") { + message.buyerApprovalState = object.buyerApprovalState; + break; + } + break; + case "USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED": + case 0: + message.buyerApprovalState = 0; + break; + case "PENDING": + case 1: + message.buyerApprovalState = 1; + break; + case "APPROVED": + case 2: + message.buyerApprovalState = 2; + break; + case "REJECTED": + case 3: + message.buyerApprovalState = 3; + break; + } + switch (object.costType) { + default: + if (typeof object.costType === "number") { + message.costType = object.costType; + break; + } + break; + case "USER_LIST_PRICING_COST_TYPE_UNSPECIFIED": + case 0: + message.costType = 0; + break; + case "CPC": + case 1: + message.costType = 1; + break; + case "CPM": + case 2: + message.costType = 2; + break; + case "MEDIA_SHARE": + case 3: + message.costType = 3; + break; + } + if (object.maxCostMicros != null) + if ($util.Long) + (message.maxCostMicros = $util.Long.fromValue(object.maxCostMicros)).unsigned = false; + else if (typeof object.maxCostMicros === "string") + message.maxCostMicros = parseInt(object.maxCostMicros, 10); + else if (typeof object.maxCostMicros === "number") + message.maxCostMicros = object.maxCostMicros; + else if (typeof object.maxCostMicros === "object") + message.maxCostMicros = new $util.LongBits(object.maxCostMicros.low >>> 0, object.maxCostMicros.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a UserListLicensePricing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {google.ads.datamanager.v1.UserListLicensePricing} message UserListLicensePricing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserListLicensePricing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pricingId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pricingId = options.longs === String ? "0" : 0; + object.startTime = null; + object.endTime = null; + object.pricingActive = false; + object.buyerApprovalState = options.enums === String ? "USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED" : 0; + } + if (message.pricingId != null && message.hasOwnProperty("pricingId")) + if (typeof message.pricingId === "number") + object.pricingId = options.longs === String ? String(message.pricingId) : message.pricingId; + else + object.pricingId = options.longs === String ? $util.Long.prototype.toString.call(message.pricingId) : options.longs === Number ? new $util.LongBits(message.pricingId.low >>> 0, message.pricingId.high >>> 0).toNumber() : message.pricingId; + if (message.costMicros != null && message.hasOwnProperty("costMicros")) { + if (typeof message.costMicros === "number") + object.costMicros = options.longs === String ? String(message.costMicros) : message.costMicros; + else + object.costMicros = options.longs === String ? $util.Long.prototype.toString.call(message.costMicros) : options.longs === Number ? new $util.LongBits(message.costMicros.low >>> 0, message.costMicros.high >>> 0).toNumber() : message.costMicros; + if (options.oneofs) + object._costMicros = "costMicros"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.pricingActive != null && message.hasOwnProperty("pricingActive")) + object.pricingActive = message.pricingActive; + if (message.buyerApprovalState != null && message.hasOwnProperty("buyerApprovalState")) + object.buyerApprovalState = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState[message.buyerApprovalState] === undefined ? message.buyerApprovalState : $root.google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState[message.buyerApprovalState] : message.buyerApprovalState; + if (message.costType != null && message.hasOwnProperty("costType")) { + object.costType = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType[message.costType] === undefined ? message.costType : $root.google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType[message.costType] : message.costType; + if (options.oneofs) + object._costType = "costType"; + } + if (message.maxCostMicros != null && message.hasOwnProperty("maxCostMicros")) { + if (typeof message.maxCostMicros === "number") + object.maxCostMicros = options.longs === String ? String(message.maxCostMicros) : message.maxCostMicros; + else + object.maxCostMicros = options.longs === String ? $util.Long.prototype.toString.call(message.maxCostMicros) : options.longs === Number ? new $util.LongBits(message.maxCostMicros.low >>> 0, message.maxCostMicros.high >>> 0).toNumber() : message.maxCostMicros; + if (options.oneofs) + object._maxCostMicros = "maxCostMicros"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + object.currencyCode = message.currencyCode; + if (options.oneofs) + object._currencyCode = "currencyCode"; + } + return object; + }; + + /** + * Converts this UserListLicensePricing to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @instance + * @returns {Object.} JSON object + */ + UserListLicensePricing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserListLicensePricing + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserListLicensePricing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserListLicensePricing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserListLicensePricing"; + }; + + /** + * UserListPricingBuyerApprovalState enum. + * @name google.ads.datamanager.v1.UserListLicensePricing.UserListPricingBuyerApprovalState + * @enum {number} + * @property {number} USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED=0 USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} APPROVED=2 APPROVED value + * @property {number} REJECTED=3 REJECTED value + */ + UserListLicensePricing.UserListPricingBuyerApprovalState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "APPROVED"] = 2; + values[valuesById[3] = "REJECTED"] = 3; + return values; + })(); + + /** + * UserListPricingCostType enum. + * @name google.ads.datamanager.v1.UserListLicensePricing.UserListPricingCostType + * @enum {number} + * @property {number} USER_LIST_PRICING_COST_TYPE_UNSPECIFIED=0 USER_LIST_PRICING_COST_TYPE_UNSPECIFIED value + * @property {number} CPC=1 CPC value + * @property {number} CPM=2 CPM value + * @property {number} MEDIA_SHARE=3 MEDIA_SHARE value + */ + UserListLicensePricing.UserListPricingCostType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_LIST_PRICING_COST_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CPC"] = 1; + values[valuesById[2] = "CPM"] = 2; + values[valuesById[3] = "MEDIA_SHARE"] = 3; + return values; + })(); + + return UserListLicensePricing; + })(); + + /** + * UserListLicenseStatus enum. + * @name google.ads.datamanager.v1.UserListLicenseStatus + * @enum {number} + * @property {number} USER_LIST_LICENSE_STATUS_UNSPECIFIED=0 USER_LIST_LICENSE_STATUS_UNSPECIFIED value + * @property {number} USER_LIST_LICENSE_STATUS_ENABLED=1 USER_LIST_LICENSE_STATUS_ENABLED value + * @property {number} USER_LIST_LICENSE_STATUS_DISABLED=2 USER_LIST_LICENSE_STATUS_DISABLED value + */ + v1.UserListLicenseStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_LIST_LICENSE_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_LIST_LICENSE_STATUS_ENABLED"] = 1; + values[valuesById[2] = "USER_LIST_LICENSE_STATUS_DISABLED"] = 2; + return values; + })(); + + v1.UserListDirectLicenseService = (function() { + + /** + * Constructs a new UserListDirectLicenseService service. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListDirectLicenseService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function UserListDirectLicenseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserListDirectLicenseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserListDirectLicenseService; + + /** + * Creates new UserListDirectLicenseService service using the specified rpc implementation. + * @function create + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {UserListDirectLicenseService} RPC service. Useful where requests and/or responses are streamed. + */ + UserListDirectLicenseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|createUserListDirectLicense}. + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @typedef CreateUserListDirectLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListDirectLicense} [response] UserListDirectLicense + */ + + /** + * Calls CreateUserListDirectLicense. + * @function createUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest} request CreateUserListDirectLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListDirectLicenseService.CreateUserListDirectLicenseCallback} callback Node-style callback called with the error, if any, and UserListDirectLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListDirectLicenseService.prototype.createUserListDirectLicense = function createUserListDirectLicense(request, callback) { + return this.rpcCall(createUserListDirectLicense, $root.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest, $root.google.ads.datamanager.v1.UserListDirectLicense, request, callback); + }, "name", { value: "CreateUserListDirectLicense" }); + + /** + * Calls CreateUserListDirectLicense. + * @function createUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest} request CreateUserListDirectLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|getUserListDirectLicense}. + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @typedef GetUserListDirectLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListDirectLicense} [response] UserListDirectLicense + */ + + /** + * Calls GetUserListDirectLicense. + * @function getUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest} request GetUserListDirectLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListDirectLicenseService.GetUserListDirectLicenseCallback} callback Node-style callback called with the error, if any, and UserListDirectLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListDirectLicenseService.prototype.getUserListDirectLicense = function getUserListDirectLicense(request, callback) { + return this.rpcCall(getUserListDirectLicense, $root.google.ads.datamanager.v1.GetUserListDirectLicenseRequest, $root.google.ads.datamanager.v1.UserListDirectLicense, request, callback); + }, "name", { value: "GetUserListDirectLicense" }); + + /** + * Calls GetUserListDirectLicense. + * @function getUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest} request GetUserListDirectLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|updateUserListDirectLicense}. + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @typedef UpdateUserListDirectLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListDirectLicense} [response] UserListDirectLicense + */ + + /** + * Calls UpdateUserListDirectLicense. + * @function updateUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest} request UpdateUserListDirectLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListDirectLicenseService.UpdateUserListDirectLicenseCallback} callback Node-style callback called with the error, if any, and UserListDirectLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListDirectLicenseService.prototype.updateUserListDirectLicense = function updateUserListDirectLicense(request, callback) { + return this.rpcCall(updateUserListDirectLicense, $root.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest, $root.google.ads.datamanager.v1.UserListDirectLicense, request, callback); + }, "name", { value: "UpdateUserListDirectLicense" }); + + /** + * Calls UpdateUserListDirectLicense. + * @function updateUserListDirectLicense + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest} request UpdateUserListDirectLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListDirectLicenseService|listUserListDirectLicenses}. + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @typedef ListUserListDirectLicensesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} [response] ListUserListDirectLicensesResponse + */ + + /** + * Calls ListUserListDirectLicenses. + * @function listUserListDirectLicenses + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest} request ListUserListDirectLicensesRequest message or plain object + * @param {google.ads.datamanager.v1.UserListDirectLicenseService.ListUserListDirectLicensesCallback} callback Node-style callback called with the error, if any, and ListUserListDirectLicensesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListDirectLicenseService.prototype.listUserListDirectLicenses = function listUserListDirectLicenses(request, callback) { + return this.rpcCall(listUserListDirectLicenses, $root.google.ads.datamanager.v1.ListUserListDirectLicensesRequest, $root.google.ads.datamanager.v1.ListUserListDirectLicensesResponse, request, callback); + }, "name", { value: "ListUserListDirectLicenses" }); + + /** + * Calls ListUserListDirectLicenses. + * @function listUserListDirectLicenses + * @memberof google.ads.datamanager.v1.UserListDirectLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest} request ListUserListDirectLicensesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserListDirectLicenseService; + })(); + + v1.CreateUserListDirectLicenseRequest = (function() { + + /** + * Properties of a CreateUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface ICreateUserListDirectLicenseRequest + * @property {string|null} [parent] CreateUserListDirectLicenseRequest parent + * @property {google.ads.datamanager.v1.IUserListDirectLicense|null} [userListDirectLicense] CreateUserListDirectLicenseRequest userListDirectLicense + */ + + /** + * Constructs a new CreateUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a CreateUserListDirectLicenseRequest. + * @implements ICreateUserListDirectLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest=} [properties] Properties to set + */ + function CreateUserListDirectLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserListDirectLicenseRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @instance + */ + CreateUserListDirectLicenseRequest.prototype.parent = ""; + + /** + * CreateUserListDirectLicenseRequest userListDirectLicense. + * @member {google.ads.datamanager.v1.IUserListDirectLicense|null|undefined} userListDirectLicense + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @instance + */ + CreateUserListDirectLicenseRequest.prototype.userListDirectLicense = null; + + /** + * Creates a new CreateUserListDirectLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.CreateUserListDirectLicenseRequest} CreateUserListDirectLicenseRequest instance + */ + CreateUserListDirectLicenseRequest.create = function create(properties) { + return new CreateUserListDirectLicenseRequest(properties); + }; + + /** + * Encodes the specified CreateUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListDirectLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest} message CreateUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserListDirectLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userListDirectLicense != null && Object.hasOwnProperty.call(message, "userListDirectLicense")) + $root.google.ads.datamanager.v1.UserListDirectLicense.encode(message.userListDirectLicense, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListDirectLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest} message CreateUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserListDirectLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserListDirectLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.CreateUserListDirectLicenseRequest} CreateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserListDirectLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.CreateUserListDirectLicenseRequest} CreateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserListDirectLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserListDirectLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserListDirectLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userListDirectLicense != null && message.hasOwnProperty("userListDirectLicense")) { + var error = $root.google.ads.datamanager.v1.UserListDirectLicense.verify(message.userListDirectLicense); + if (error) + return "userListDirectLicense." + error; + } + return null; + }; + + /** + * Creates a CreateUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.CreateUserListDirectLicenseRequest} CreateUserListDirectLicenseRequest + */ + CreateUserListDirectLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userListDirectLicense != null) { + if (typeof object.userListDirectLicense !== "object") + throw TypeError(".google.ads.datamanager.v1.CreateUserListDirectLicenseRequest.userListDirectLicense: object expected"); + message.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.fromObject(object.userListDirectLicense); + } + return message; + }; + + /** + * Creates a plain object from a CreateUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.CreateUserListDirectLicenseRequest} message CreateUserListDirectLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserListDirectLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userListDirectLicense = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userListDirectLicense != null && message.hasOwnProperty("userListDirectLicense")) + object.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.toObject(message.userListDirectLicense, options); + return object; + }; + + /** + * Converts this CreateUserListDirectLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserListDirectLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserListDirectLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.CreateUserListDirectLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserListDirectLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.CreateUserListDirectLicenseRequest"; + }; + + return CreateUserListDirectLicenseRequest; + })(); + + v1.GetUserListDirectLicenseRequest = (function() { + + /** + * Properties of a GetUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface IGetUserListDirectLicenseRequest + * @property {string|null} [name] GetUserListDirectLicenseRequest name + */ + + /** + * Constructs a new GetUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a GetUserListDirectLicenseRequest. + * @implements IGetUserListDirectLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest=} [properties] Properties to set + */ + function GetUserListDirectLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserListDirectLicenseRequest name. + * @member {string} name + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @instance + */ + GetUserListDirectLicenseRequest.prototype.name = ""; + + /** + * Creates a new GetUserListDirectLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.GetUserListDirectLicenseRequest} GetUserListDirectLicenseRequest instance + */ + GetUserListDirectLicenseRequest.create = function create(properties) { + return new GetUserListDirectLicenseRequest(properties); + }; + + /** + * Encodes the specified GetUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListDirectLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest} message GetUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListDirectLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListDirectLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListDirectLicenseRequest} message GetUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListDirectLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserListDirectLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.GetUserListDirectLicenseRequest} GetUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListDirectLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.GetUserListDirectLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.GetUserListDirectLicenseRequest} GetUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListDirectLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserListDirectLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserListDirectLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.GetUserListDirectLicenseRequest} GetUserListDirectLicenseRequest + */ + GetUserListDirectLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.GetUserListDirectLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.GetUserListDirectLicenseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.GetUserListDirectLicenseRequest} message GetUserListDirectLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserListDirectLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserListDirectLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserListDirectLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserListDirectLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.GetUserListDirectLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserListDirectLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.GetUserListDirectLicenseRequest"; + }; + + return GetUserListDirectLicenseRequest; + })(); + + v1.UpdateUserListDirectLicenseRequest = (function() { + + /** + * Properties of an UpdateUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface IUpdateUserListDirectLicenseRequest + * @property {google.ads.datamanager.v1.IUserListDirectLicense|null} [userListDirectLicense] UpdateUserListDirectLicenseRequest userListDirectLicense + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserListDirectLicenseRequest updateMask + */ + + /** + * Constructs a new UpdateUserListDirectLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents an UpdateUserListDirectLicenseRequest. + * @implements IUpdateUserListDirectLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest=} [properties] Properties to set + */ + function UpdateUserListDirectLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserListDirectLicenseRequest userListDirectLicense. + * @member {google.ads.datamanager.v1.IUserListDirectLicense|null|undefined} userListDirectLicense + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @instance + */ + UpdateUserListDirectLicenseRequest.prototype.userListDirectLicense = null; + + /** + * UpdateUserListDirectLicenseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @instance + */ + UpdateUserListDirectLicenseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateUserListDirectLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest} UpdateUserListDirectLicenseRequest instance + */ + UpdateUserListDirectLicenseRequest.create = function create(properties) { + return new UpdateUserListDirectLicenseRequest(properties); + }; + + /** + * Encodes the specified UpdateUserListDirectLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest} message UpdateUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserListDirectLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userListDirectLicense != null && Object.hasOwnProperty.call(message, "userListDirectLicense")) + $root.google.ads.datamanager.v1.UserListDirectLicense.encode(message.userListDirectLicense, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateUserListDirectLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest} message UpdateUserListDirectLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserListDirectLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserListDirectLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest} UpdateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserListDirectLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserListDirectLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest} UpdateUserListDirectLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserListDirectLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserListDirectLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserListDirectLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userListDirectLicense != null && message.hasOwnProperty("userListDirectLicense")) { + var error = $root.google.ads.datamanager.v1.UserListDirectLicense.verify(message.userListDirectLicense); + if (error) + return "userListDirectLicense." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateUserListDirectLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest} UpdateUserListDirectLicenseRequest + */ + UpdateUserListDirectLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest(); + if (object.userListDirectLicense != null) { + if (typeof object.userListDirectLicense !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.userListDirectLicense: object expected"); + message.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.fromObject(object.userListDirectLicense); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUserListDirectLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest} message UpdateUserListDirectLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserListDirectLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userListDirectLicense = null; + object.updateMask = null; + } + if (message.userListDirectLicense != null && message.hasOwnProperty("userListDirectLicense")) + object.userListDirectLicense = $root.google.ads.datamanager.v1.UserListDirectLicense.toObject(message.userListDirectLicense, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateUserListDirectLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserListDirectLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserListDirectLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserListDirectLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest"; + }; + + return UpdateUserListDirectLicenseRequest; + })(); + + v1.ListUserListDirectLicensesRequest = (function() { + + /** + * Properties of a ListUserListDirectLicensesRequest. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListDirectLicensesRequest + * @property {string|null} [parent] ListUserListDirectLicensesRequest parent + * @property {string|null} [filter] ListUserListDirectLicensesRequest filter + * @property {number|null} [pageSize] ListUserListDirectLicensesRequest pageSize + * @property {string|null} [pageToken] ListUserListDirectLicensesRequest pageToken + */ + + /** + * Constructs a new ListUserListDirectLicensesRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListDirectLicensesRequest. + * @implements IListUserListDirectLicensesRequest + * @constructor + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest=} [properties] Properties to set + */ + function ListUserListDirectLicensesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListDirectLicensesRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @instance + */ + ListUserListDirectLicensesRequest.prototype.parent = ""; + + /** + * ListUserListDirectLicensesRequest filter. + * @member {string} filter + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @instance + */ + ListUserListDirectLicensesRequest.prototype.filter = ""; + + /** + * ListUserListDirectLicensesRequest pageSize. + * @member {number} pageSize + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @instance + */ + ListUserListDirectLicensesRequest.prototype.pageSize = 0; + + /** + * ListUserListDirectLicensesRequest pageToken. + * @member {string} pageToken + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @instance + */ + ListUserListDirectLicensesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUserListDirectLicensesRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesRequest} ListUserListDirectLicensesRequest instance + */ + ListUserListDirectLicensesRequest.create = function create(properties) { + return new ListUserListDirectLicensesRequest(properties); + }; + + /** + * Encodes the specified ListUserListDirectLicensesRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest} message ListUserListDirectLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListDirectLicensesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListDirectLicensesRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesRequest} message ListUserListDirectLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListDirectLicensesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListDirectLicensesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesRequest} ListUserListDirectLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListDirectLicensesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListDirectLicensesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListDirectLicensesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesRequest} ListUserListDirectLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListDirectLicensesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListDirectLicensesRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListDirectLicensesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListDirectLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesRequest} ListUserListDirectLicensesRequest + */ + ListUserListDirectLicensesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListDirectLicensesRequest) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListDirectLicensesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListDirectLicensesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {google.ads.datamanager.v1.ListUserListDirectLicensesRequest} message ListUserListDirectLicensesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListDirectLicensesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUserListDirectLicensesRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @instance + * @returns {Object.} JSON object + */ + ListUserListDirectLicensesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListDirectLicensesRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListDirectLicensesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListDirectLicensesRequest"; + }; + + return ListUserListDirectLicensesRequest; + })(); + + v1.ListUserListDirectLicensesResponse = (function() { + + /** + * Properties of a ListUserListDirectLicensesResponse. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListDirectLicensesResponse + * @property {Array.|null} [userListDirectLicenses] ListUserListDirectLicensesResponse userListDirectLicenses + * @property {string|null} [nextPageToken] ListUserListDirectLicensesResponse nextPageToken + */ + + /** + * Constructs a new ListUserListDirectLicensesResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListDirectLicensesResponse. + * @implements IListUserListDirectLicensesResponse + * @constructor + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesResponse=} [properties] Properties to set + */ + function ListUserListDirectLicensesResponse(properties) { + this.userListDirectLicenses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListDirectLicensesResponse userListDirectLicenses. + * @member {Array.} userListDirectLicenses + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @instance + */ + ListUserListDirectLicensesResponse.prototype.userListDirectLicenses = $util.emptyArray; + + /** + * ListUserListDirectLicensesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @instance + */ + ListUserListDirectLicensesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListUserListDirectLicensesResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} ListUserListDirectLicensesResponse instance + */ + ListUserListDirectLicensesResponse.create = function create(properties) { + return new ListUserListDirectLicensesResponse(properties); + }; + + /** + * Encodes the specified ListUserListDirectLicensesResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesResponse} message ListUserListDirectLicensesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListDirectLicensesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userListDirectLicenses != null && message.userListDirectLicenses.length) + for (var i = 0; i < message.userListDirectLicenses.length; ++i) + $root.google.ads.datamanager.v1.UserListDirectLicense.encode(message.userListDirectLicenses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListDirectLicensesResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListDirectLicensesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListDirectLicensesResponse} message ListUserListDirectLicensesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListDirectLicensesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListDirectLicensesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} ListUserListDirectLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListDirectLicensesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListDirectLicensesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.userListDirectLicenses && message.userListDirectLicenses.length)) + message.userListDirectLicenses = []; + message.userListDirectLicenses.push($root.google.ads.datamanager.v1.UserListDirectLicense.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListDirectLicensesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} ListUserListDirectLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListDirectLicensesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListDirectLicensesResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListDirectLicensesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userListDirectLicenses != null && message.hasOwnProperty("userListDirectLicenses")) { + if (!Array.isArray(message.userListDirectLicenses)) + return "userListDirectLicenses: array expected"; + for (var i = 0; i < message.userListDirectLicenses.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListDirectLicense.verify(message.userListDirectLicenses[i]); + if (error) + return "userListDirectLicenses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListDirectLicensesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} ListUserListDirectLicensesResponse + */ + ListUserListDirectLicensesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListDirectLicensesResponse) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListDirectLicensesResponse(); + if (object.userListDirectLicenses) { + if (!Array.isArray(object.userListDirectLicenses)) + throw TypeError(".google.ads.datamanager.v1.ListUserListDirectLicensesResponse.userListDirectLicenses: array expected"); + message.userListDirectLicenses = []; + for (var i = 0; i < object.userListDirectLicenses.length; ++i) { + if (typeof object.userListDirectLicenses[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.ListUserListDirectLicensesResponse.userListDirectLicenses: object expected"); + message.userListDirectLicenses[i] = $root.google.ads.datamanager.v1.UserListDirectLicense.fromObject(object.userListDirectLicenses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListDirectLicensesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {google.ads.datamanager.v1.ListUserListDirectLicensesResponse} message ListUserListDirectLicensesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListDirectLicensesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userListDirectLicenses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.userListDirectLicenses && message.userListDirectLicenses.length) { + object.userListDirectLicenses = []; + for (var j = 0; j < message.userListDirectLicenses.length; ++j) + object.userListDirectLicenses[j] = $root.google.ads.datamanager.v1.UserListDirectLicense.toObject(message.userListDirectLicenses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListUserListDirectLicensesResponse to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @instance + * @returns {Object.} JSON object + */ + ListUserListDirectLicensesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListDirectLicensesResponse + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListDirectLicensesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListDirectLicensesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListDirectLicensesResponse"; + }; + + return ListUserListDirectLicensesResponse; + })(); + + v1.UserListGlobalLicense = (function() { + + /** + * Properties of a UserListGlobalLicense. + * @memberof google.ads.datamanager.v1 + * @interface IUserListGlobalLicense + * @property {string|null} [name] UserListGlobalLicense name + * @property {number|Long|null} [userListId] UserListGlobalLicense userListId + * @property {string|null} [userListDisplayName] UserListGlobalLicense userListDisplayName + * @property {google.ads.datamanager.v1.UserListGlobalLicenseType|null} [licenseType] UserListGlobalLicense licenseType + * @property {google.ads.datamanager.v1.UserListLicenseStatus|null} [status] UserListGlobalLicense status + * @property {google.ads.datamanager.v1.IUserListLicensePricing|null} [pricing] UserListGlobalLicense pricing + * @property {Array.|null} [historicalPricings] UserListGlobalLicense historicalPricings + * @property {google.ads.datamanager.v1.IUserListLicenseMetrics|null} [metrics] UserListGlobalLicense metrics + */ + + /** + * Constructs a new UserListGlobalLicense. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListGlobalLicense. + * @implements IUserListGlobalLicense + * @constructor + * @param {google.ads.datamanager.v1.IUserListGlobalLicense=} [properties] Properties to set + */ + function UserListGlobalLicense(properties) { + this.historicalPricings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserListGlobalLicense name. + * @member {string} name + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.name = ""; + + /** + * UserListGlobalLicense userListId. + * @member {number|Long|null|undefined} userListId + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.userListId = null; + + /** + * UserListGlobalLicense userListDisplayName. + * @member {string} userListDisplayName + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.userListDisplayName = ""; + + /** + * UserListGlobalLicense licenseType. + * @member {google.ads.datamanager.v1.UserListGlobalLicenseType|null|undefined} licenseType + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.licenseType = null; + + /** + * UserListGlobalLicense status. + * @member {google.ads.datamanager.v1.UserListLicenseStatus|null|undefined} status + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.status = null; + + /** + * UserListGlobalLicense pricing. + * @member {google.ads.datamanager.v1.IUserListLicensePricing|null|undefined} pricing + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.pricing = null; + + /** + * UserListGlobalLicense historicalPricings. + * @member {Array.} historicalPricings + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.historicalPricings = $util.emptyArray; + + /** + * UserListGlobalLicense metrics. + * @member {google.ads.datamanager.v1.IUserListLicenseMetrics|null|undefined} metrics + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + */ + UserListGlobalLicense.prototype.metrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListGlobalLicense.prototype, "_userListId", { + get: $util.oneOfGetter($oneOfFields = ["userListId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListGlobalLicense.prototype, "_licenseType", { + get: $util.oneOfGetter($oneOfFields = ["licenseType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserListGlobalLicense.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserListGlobalLicense instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicense=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserListGlobalLicense} UserListGlobalLicense instance + */ + UserListGlobalLicense.create = function create(properties) { + return new UserListGlobalLicense(properties); + }; + + /** + * Encodes the specified UserListGlobalLicense message. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicense.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicense} message UserListGlobalLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListGlobalLicense.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.userListId != null && Object.hasOwnProperty.call(message, "userListId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userListId); + if (message.userListDisplayName != null && Object.hasOwnProperty.call(message, "userListDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userListDisplayName); + if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.licenseType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.status); + if (message.pricing != null && Object.hasOwnProperty.call(message, "pricing")) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.pricing, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.historicalPricings != null && message.historicalPricings.length) + for (var i = 0; i < message.historicalPricings.length; ++i) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.historicalPricings[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.ads.datamanager.v1.UserListLicenseMetrics.encode(message.metrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserListGlobalLicense message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicense.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicense} message UserListGlobalLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListGlobalLicense.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserListGlobalLicense message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserListGlobalLicense} UserListGlobalLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListGlobalLicense.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserListGlobalLicense(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userListId = reader.int64(); + break; + } + case 3: { + message.userListDisplayName = reader.string(); + break; + } + case 4: { + message.licenseType = reader.int32(); + break; + } + case 5: { + message.status = reader.int32(); + break; + } + case 6: { + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.historicalPricings && message.historicalPricings.length)) + message.historicalPricings = []; + message.historicalPricings.push($root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32())); + break; + } + case 8: { + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserListGlobalLicense message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserListGlobalLicense} UserListGlobalLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListGlobalLicense.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserListGlobalLicense message. + * @function verify + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserListGlobalLicense.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userListId != null && message.hasOwnProperty("userListId")) { + properties._userListId = 1; + if (!$util.isInteger(message.userListId) && !(message.userListId && $util.isInteger(message.userListId.low) && $util.isInteger(message.userListId.high))) + return "userListId: integer|Long expected"; + } + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + if (!$util.isString(message.userListDisplayName)) + return "userListDisplayName: string expected"; + if (message.licenseType != null && message.hasOwnProperty("licenseType")) { + properties._licenseType = 1; + switch (message.licenseType) { + default: + return "licenseType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.pricing != null && message.hasOwnProperty("pricing")) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.pricing); + if (error) + return "pricing." + error; + } + if (message.historicalPricings != null && message.hasOwnProperty("historicalPricings")) { + if (!Array.isArray(message.historicalPricings)) + return "historicalPricings: array expected"; + for (var i = 0; i < message.historicalPricings.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.historicalPricings[i]); + if (error) + return "historicalPricings." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.ads.datamanager.v1.UserListLicenseMetrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a UserListGlobalLicense message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserListGlobalLicense} UserListGlobalLicense + */ + UserListGlobalLicense.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserListGlobalLicense) + return object; + var message = new $root.google.ads.datamanager.v1.UserListGlobalLicense(); + if (object.name != null) + message.name = String(object.name); + if (object.userListId != null) + if ($util.Long) + (message.userListId = $util.Long.fromValue(object.userListId)).unsigned = false; + else if (typeof object.userListId === "string") + message.userListId = parseInt(object.userListId, 10); + else if (typeof object.userListId === "number") + message.userListId = object.userListId; + else if (typeof object.userListId === "object") + message.userListId = new $util.LongBits(object.userListId.low >>> 0, object.userListId.high >>> 0).toNumber(); + if (object.userListDisplayName != null) + message.userListDisplayName = String(object.userListDisplayName); + switch (object.licenseType) { + default: + if (typeof object.licenseType === "number") { + message.licenseType = object.licenseType; + break; + } + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED": + case 0: + message.licenseType = 0; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER": + case 1: + message.licenseType = 1; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE": + case 2: + message.licenseType = 2; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE": + case 3: + message.licenseType = 3; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "USER_LIST_LICENSE_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "USER_LIST_LICENSE_STATUS_ENABLED": + case 1: + message.status = 1; + break; + case "USER_LIST_LICENSE_STATUS_DISABLED": + case 2: + message.status = 2; + break; + } + if (object.pricing != null) { + if (typeof object.pricing !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicense.pricing: object expected"); + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.pricing); + } + if (object.historicalPricings) { + if (!Array.isArray(object.historicalPricings)) + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicense.historicalPricings: array expected"); + message.historicalPricings = []; + for (var i = 0; i < object.historicalPricings.length; ++i) { + if (typeof object.historicalPricings[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicense.historicalPricings: object expected"); + message.historicalPricings[i] = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.historicalPricings[i]); + } + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicense.metrics: object expected"); + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a UserListGlobalLicense message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {google.ads.datamanager.v1.UserListGlobalLicense} message UserListGlobalLicense + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserListGlobalLicense.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalPricings = []; + if (options.defaults) { + object.name = ""; + object.userListDisplayName = ""; + object.pricing = null; + object.metrics = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userListId != null && message.hasOwnProperty("userListId")) { + if (typeof message.userListId === "number") + object.userListId = options.longs === String ? String(message.userListId) : message.userListId; + else + object.userListId = options.longs === String ? $util.Long.prototype.toString.call(message.userListId) : options.longs === Number ? new $util.LongBits(message.userListId.low >>> 0, message.userListId.high >>> 0).toNumber() : message.userListId; + if (options.oneofs) + object._userListId = "userListId"; + } + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + object.userListDisplayName = message.userListDisplayName; + if (message.licenseType != null && message.hasOwnProperty("licenseType")) { + object.licenseType = options.enums === String ? $root.google.ads.datamanager.v1.UserListGlobalLicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.ads.datamanager.v1.UserListGlobalLicenseType[message.licenseType] : message.licenseType; + if (options.oneofs) + object._licenseType = "licenseType"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] === undefined ? message.status : $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.pricing != null && message.hasOwnProperty("pricing")) + object.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.pricing, options); + if (message.historicalPricings && message.historicalPricings.length) { + object.historicalPricings = []; + for (var j = 0; j < message.historicalPricings.length; ++j) + object.historicalPricings[j] = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.historicalPricings[j], options); + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this UserListGlobalLicense to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @instance + * @returns {Object.} JSON object + */ + UserListGlobalLicense.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserListGlobalLicense + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserListGlobalLicense + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserListGlobalLicense.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserListGlobalLicense"; + }; + + return UserListGlobalLicense; + })(); + + v1.UserListGlobalLicenseCustomerInfo = (function() { + + /** + * Properties of a UserListGlobalLicenseCustomerInfo. + * @memberof google.ads.datamanager.v1 + * @interface IUserListGlobalLicenseCustomerInfo + * @property {string|null} [name] UserListGlobalLicenseCustomerInfo name + * @property {number|Long|null} [userListId] UserListGlobalLicenseCustomerInfo userListId + * @property {string|null} [userListDisplayName] UserListGlobalLicenseCustomerInfo userListDisplayName + * @property {google.ads.datamanager.v1.UserListGlobalLicenseType|null} [licenseType] UserListGlobalLicenseCustomerInfo licenseType + * @property {google.ads.datamanager.v1.UserListLicenseStatus|null} [status] UserListGlobalLicenseCustomerInfo status + * @property {google.ads.datamanager.v1.IUserListLicensePricing|null} [pricing] UserListGlobalLicenseCustomerInfo pricing + * @property {google.ads.datamanager.v1.UserListLicenseClientAccountType|null} [clientAccountType] UserListGlobalLicenseCustomerInfo clientAccountType + * @property {number|Long|null} [clientAccountId] UserListGlobalLicenseCustomerInfo clientAccountId + * @property {string|null} [clientAccountDisplayName] UserListGlobalLicenseCustomerInfo clientAccountDisplayName + * @property {Array.|null} [historicalPricings] UserListGlobalLicenseCustomerInfo historicalPricings + * @property {google.ads.datamanager.v1.IUserListLicenseMetrics|null} [metrics] UserListGlobalLicenseCustomerInfo metrics + */ + + /** + * Constructs a new UserListGlobalLicenseCustomerInfo. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListGlobalLicenseCustomerInfo. + * @implements IUserListGlobalLicenseCustomerInfo + * @constructor + * @param {google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo=} [properties] Properties to set + */ + function UserListGlobalLicenseCustomerInfo(properties) { + this.historicalPricings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserListGlobalLicenseCustomerInfo name. + * @member {string} name + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.name = ""; + + /** + * UserListGlobalLicenseCustomerInfo userListId. + * @member {number|Long} userListId + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.userListId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListGlobalLicenseCustomerInfo userListDisplayName. + * @member {string} userListDisplayName + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.userListDisplayName = ""; + + /** + * UserListGlobalLicenseCustomerInfo licenseType. + * @member {google.ads.datamanager.v1.UserListGlobalLicenseType} licenseType + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.licenseType = 0; + + /** + * UserListGlobalLicenseCustomerInfo status. + * @member {google.ads.datamanager.v1.UserListLicenseStatus} status + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.status = 0; + + /** + * UserListGlobalLicenseCustomerInfo pricing. + * @member {google.ads.datamanager.v1.IUserListLicensePricing|null|undefined} pricing + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.pricing = null; + + /** + * UserListGlobalLicenseCustomerInfo clientAccountType. + * @member {google.ads.datamanager.v1.UserListLicenseClientAccountType} clientAccountType + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.clientAccountType = 0; + + /** + * UserListGlobalLicenseCustomerInfo clientAccountId. + * @member {number|Long} clientAccountId + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.clientAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserListGlobalLicenseCustomerInfo clientAccountDisplayName. + * @member {string} clientAccountDisplayName + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.clientAccountDisplayName = ""; + + /** + * UserListGlobalLicenseCustomerInfo historicalPricings. + * @member {Array.} historicalPricings + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.historicalPricings = $util.emptyArray; + + /** + * UserListGlobalLicenseCustomerInfo metrics. + * @member {google.ads.datamanager.v1.IUserListLicenseMetrics|null|undefined} metrics + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + */ + UserListGlobalLicenseCustomerInfo.prototype.metrics = null; + + /** + * Creates a new UserListGlobalLicenseCustomerInfo instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo} UserListGlobalLicenseCustomerInfo instance + */ + UserListGlobalLicenseCustomerInfo.create = function create(properties) { + return new UserListGlobalLicenseCustomerInfo(properties); + }; + + /** + * Encodes the specified UserListGlobalLicenseCustomerInfo message. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo} message UserListGlobalLicenseCustomerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListGlobalLicenseCustomerInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.userListId != null && Object.hasOwnProperty.call(message, "userListId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userListId); + if (message.userListDisplayName != null && Object.hasOwnProperty.call(message, "userListDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userListDisplayName); + if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.licenseType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.status); + if (message.pricing != null && Object.hasOwnProperty.call(message, "pricing")) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.pricing, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.clientAccountType != null && Object.hasOwnProperty.call(message, "clientAccountType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.clientAccountType); + if (message.clientAccountId != null && Object.hasOwnProperty.call(message, "clientAccountId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.clientAccountId); + if (message.clientAccountDisplayName != null && Object.hasOwnProperty.call(message, "clientAccountDisplayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.clientAccountDisplayName); + if (message.historicalPricings != null && message.historicalPricings.length) + for (var i = 0; i < message.historicalPricings.length; ++i) + $root.google.ads.datamanager.v1.UserListLicensePricing.encode(message.historicalPricings[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.ads.datamanager.v1.UserListLicenseMetrics.encode(message.metrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserListGlobalLicenseCustomerInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo} message UserListGlobalLicenseCustomerInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserListGlobalLicenseCustomerInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserListGlobalLicenseCustomerInfo message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo} UserListGlobalLicenseCustomerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListGlobalLicenseCustomerInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userListId = reader.int64(); + break; + } + case 3: { + message.userListDisplayName = reader.string(); + break; + } + case 4: { + message.licenseType = reader.int32(); + break; + } + case 5: { + message.status = reader.int32(); + break; + } + case 6: { + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32()); + break; + } + case 7: { + message.clientAccountType = reader.int32(); + break; + } + case 8: { + message.clientAccountId = reader.int64(); + break; + } + case 9: { + message.clientAccountDisplayName = reader.string(); + break; + } + case 10: { + if (!(message.historicalPricings && message.historicalPricings.length)) + message.historicalPricings = []; + message.historicalPricings.push($root.google.ads.datamanager.v1.UserListLicensePricing.decode(reader, reader.uint32())); + break; + } + case 11: { + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserListGlobalLicenseCustomerInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo} UserListGlobalLicenseCustomerInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserListGlobalLicenseCustomerInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserListGlobalLicenseCustomerInfo message. + * @function verify + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserListGlobalLicenseCustomerInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userListId != null && message.hasOwnProperty("userListId")) + if (!$util.isInteger(message.userListId) && !(message.userListId && $util.isInteger(message.userListId.low) && $util.isInteger(message.userListId.high))) + return "userListId: integer|Long expected"; + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + if (!$util.isString(message.userListDisplayName)) + return "userListDisplayName: string expected"; + if (message.licenseType != null && message.hasOwnProperty("licenseType")) + switch (message.licenseType) { + default: + return "licenseType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pricing != null && message.hasOwnProperty("pricing")) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.pricing); + if (error) + return "pricing." + error; + } + if (message.clientAccountType != null && message.hasOwnProperty("clientAccountType")) + switch (message.clientAccountType) { + default: + return "clientAccountType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.clientAccountId != null && message.hasOwnProperty("clientAccountId")) + if (!$util.isInteger(message.clientAccountId) && !(message.clientAccountId && $util.isInteger(message.clientAccountId.low) && $util.isInteger(message.clientAccountId.high))) + return "clientAccountId: integer|Long expected"; + if (message.clientAccountDisplayName != null && message.hasOwnProperty("clientAccountDisplayName")) + if (!$util.isString(message.clientAccountDisplayName)) + return "clientAccountDisplayName: string expected"; + if (message.historicalPricings != null && message.hasOwnProperty("historicalPricings")) { + if (!Array.isArray(message.historicalPricings)) + return "historicalPricings: array expected"; + for (var i = 0; i < message.historicalPricings.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListLicensePricing.verify(message.historicalPricings[i]); + if (error) + return "historicalPricings." + error; + } + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.ads.datamanager.v1.UserListLicenseMetrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a UserListGlobalLicenseCustomerInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo} UserListGlobalLicenseCustomerInfo + */ + UserListGlobalLicenseCustomerInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo) + return object; + var message = new $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.userListId != null) + if ($util.Long) + (message.userListId = $util.Long.fromValue(object.userListId)).unsigned = false; + else if (typeof object.userListId === "string") + message.userListId = parseInt(object.userListId, 10); + else if (typeof object.userListId === "number") + message.userListId = object.userListId; + else if (typeof object.userListId === "object") + message.userListId = new $util.LongBits(object.userListId.low >>> 0, object.userListId.high >>> 0).toNumber(); + if (object.userListDisplayName != null) + message.userListDisplayName = String(object.userListDisplayName); + switch (object.licenseType) { + default: + if (typeof object.licenseType === "number") { + message.licenseType = object.licenseType; + break; + } + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED": + case 0: + message.licenseType = 0; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER": + case 1: + message.licenseType = 1; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE": + case 2: + message.licenseType = 2; + break; + case "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE": + case 3: + message.licenseType = 3; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "USER_LIST_LICENSE_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "USER_LIST_LICENSE_STATUS_ENABLED": + case 1: + message.status = 1; + break; + case "USER_LIST_LICENSE_STATUS_DISABLED": + case 2: + message.status = 2; + break; + } + if (object.pricing != null) { + if (typeof object.pricing !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.pricing: object expected"); + message.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.pricing); + } + switch (object.clientAccountType) { + default: + if (typeof object.clientAccountType === "number") { + message.clientAccountType = object.clientAccountType; + break; + } + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN": + case 0: + message.clientAccountType = 0; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS": + case 1: + message.clientAccountType = 1; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER": + case 2: + message.clientAccountType = 2; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER": + case 3: + message.clientAccountType = 3; + break; + case "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK": + case 4: + message.clientAccountType = 4; + break; + } + if (object.clientAccountId != null) + if ($util.Long) + (message.clientAccountId = $util.Long.fromValue(object.clientAccountId)).unsigned = false; + else if (typeof object.clientAccountId === "string") + message.clientAccountId = parseInt(object.clientAccountId, 10); + else if (typeof object.clientAccountId === "number") + message.clientAccountId = object.clientAccountId; + else if (typeof object.clientAccountId === "object") + message.clientAccountId = new $util.LongBits(object.clientAccountId.low >>> 0, object.clientAccountId.high >>> 0).toNumber(); + if (object.clientAccountDisplayName != null) + message.clientAccountDisplayName = String(object.clientAccountDisplayName); + if (object.historicalPricings) { + if (!Array.isArray(object.historicalPricings)) + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.historicalPricings: array expected"); + message.historicalPricings = []; + for (var i = 0; i < object.historicalPricings.length; ++i) { + if (typeof object.historicalPricings[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.historicalPricings: object expected"); + message.historicalPricings[i] = $root.google.ads.datamanager.v1.UserListLicensePricing.fromObject(object.historicalPricings[i]); + } + } + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.metrics: object expected"); + message.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a UserListGlobalLicenseCustomerInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo} message UserListGlobalLicenseCustomerInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserListGlobalLicenseCustomerInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalPricings = []; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userListId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userListId = options.longs === String ? "0" : 0; + object.userListDisplayName = ""; + object.licenseType = options.enums === String ? "USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED" : 0; + object.status = options.enums === String ? "USER_LIST_LICENSE_STATUS_UNSPECIFIED" : 0; + object.pricing = null; + object.clientAccountType = options.enums === String ? "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.clientAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.clientAccountId = options.longs === String ? "0" : 0; + object.clientAccountDisplayName = ""; + object.metrics = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userListId != null && message.hasOwnProperty("userListId")) + if (typeof message.userListId === "number") + object.userListId = options.longs === String ? String(message.userListId) : message.userListId; + else + object.userListId = options.longs === String ? $util.Long.prototype.toString.call(message.userListId) : options.longs === Number ? new $util.LongBits(message.userListId.low >>> 0, message.userListId.high >>> 0).toNumber() : message.userListId; + if (message.userListDisplayName != null && message.hasOwnProperty("userListDisplayName")) + object.userListDisplayName = message.userListDisplayName; + if (message.licenseType != null && message.hasOwnProperty("licenseType")) + object.licenseType = options.enums === String ? $root.google.ads.datamanager.v1.UserListGlobalLicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.ads.datamanager.v1.UserListGlobalLicenseType[message.licenseType] : message.licenseType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] === undefined ? message.status : $root.google.ads.datamanager.v1.UserListLicenseStatus[message.status] : message.status; + if (message.pricing != null && message.hasOwnProperty("pricing")) + object.pricing = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.pricing, options); + if (message.clientAccountType != null && message.hasOwnProperty("clientAccountType")) + object.clientAccountType = options.enums === String ? $root.google.ads.datamanager.v1.UserListLicenseClientAccountType[message.clientAccountType] === undefined ? message.clientAccountType : $root.google.ads.datamanager.v1.UserListLicenseClientAccountType[message.clientAccountType] : message.clientAccountType; + if (message.clientAccountId != null && message.hasOwnProperty("clientAccountId")) + if (typeof message.clientAccountId === "number") + object.clientAccountId = options.longs === String ? String(message.clientAccountId) : message.clientAccountId; + else + object.clientAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.clientAccountId) : options.longs === Number ? new $util.LongBits(message.clientAccountId.low >>> 0, message.clientAccountId.high >>> 0).toNumber() : message.clientAccountId; + if (message.clientAccountDisplayName != null && message.hasOwnProperty("clientAccountDisplayName")) + object.clientAccountDisplayName = message.clientAccountDisplayName; + if (message.historicalPricings && message.historicalPricings.length) { + object.historicalPricings = []; + for (var j = 0; j < message.historicalPricings.length; ++j) + object.historicalPricings[j] = $root.google.ads.datamanager.v1.UserListLicensePricing.toObject(message.historicalPricings[j], options); + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.ads.datamanager.v1.UserListLicenseMetrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this UserListGlobalLicenseCustomerInfo to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @instance + * @returns {Object.} JSON object + */ + UserListGlobalLicenseCustomerInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserListGlobalLicenseCustomerInfo + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserListGlobalLicenseCustomerInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo"; + }; + + return UserListGlobalLicenseCustomerInfo; + })(); + + /** + * UserListGlobalLicenseType enum. + * @name google.ads.datamanager.v1.UserListGlobalLicenseType + * @enum {number} + * @property {number} USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED=0 USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED value + * @property {number} USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER=1 USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER value + * @property {number} USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE=2 USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE value + * @property {number} USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE=3 USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE value + */ + v1.UserListGlobalLicenseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER"] = 1; + values[valuesById[2] = "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE"] = 2; + values[valuesById[3] = "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE"] = 3; + return values; + })(); + + v1.UserListGlobalLicenseService = (function() { + + /** + * Constructs a new UserListGlobalLicenseService service. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListGlobalLicenseService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function UserListGlobalLicenseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserListGlobalLicenseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserListGlobalLicenseService; + + /** + * Creates new UserListGlobalLicenseService service using the specified rpc implementation. + * @function create + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {UserListGlobalLicenseService} RPC service. Useful where requests and/or responses are streamed. + */ + UserListGlobalLicenseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|createUserListGlobalLicense}. + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @typedef CreateUserListGlobalLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListGlobalLicense} [response] UserListGlobalLicense + */ + + /** + * Calls CreateUserListGlobalLicense. + * @function createUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest} request CreateUserListGlobalLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListGlobalLicenseService.CreateUserListGlobalLicenseCallback} callback Node-style callback called with the error, if any, and UserListGlobalLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListGlobalLicenseService.prototype.createUserListGlobalLicense = function createUserListGlobalLicense(request, callback) { + return this.rpcCall(createUserListGlobalLicense, $root.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest, $root.google.ads.datamanager.v1.UserListGlobalLicense, request, callback); + }, "name", { value: "CreateUserListGlobalLicense" }); + + /** + * Calls CreateUserListGlobalLicense. + * @function createUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest} request CreateUserListGlobalLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|updateUserListGlobalLicense}. + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @typedef UpdateUserListGlobalLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListGlobalLicense} [response] UserListGlobalLicense + */ + + /** + * Calls UpdateUserListGlobalLicense. + * @function updateUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest} request UpdateUserListGlobalLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListGlobalLicenseService.UpdateUserListGlobalLicenseCallback} callback Node-style callback called with the error, if any, and UserListGlobalLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListGlobalLicenseService.prototype.updateUserListGlobalLicense = function updateUserListGlobalLicense(request, callback) { + return this.rpcCall(updateUserListGlobalLicense, $root.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest, $root.google.ads.datamanager.v1.UserListGlobalLicense, request, callback); + }, "name", { value: "UpdateUserListGlobalLicense" }); + + /** + * Calls UpdateUserListGlobalLicense. + * @function updateUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest} request UpdateUserListGlobalLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|getUserListGlobalLicense}. + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @typedef GetUserListGlobalLicenseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserListGlobalLicense} [response] UserListGlobalLicense + */ + + /** + * Calls GetUserListGlobalLicense. + * @function getUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest} request GetUserListGlobalLicenseRequest message or plain object + * @param {google.ads.datamanager.v1.UserListGlobalLicenseService.GetUserListGlobalLicenseCallback} callback Node-style callback called with the error, if any, and UserListGlobalLicense + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListGlobalLicenseService.prototype.getUserListGlobalLicense = function getUserListGlobalLicense(request, callback) { + return this.rpcCall(getUserListGlobalLicense, $root.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest, $root.google.ads.datamanager.v1.UserListGlobalLicense, request, callback); + }, "name", { value: "GetUserListGlobalLicense" }); + + /** + * Calls GetUserListGlobalLicense. + * @function getUserListGlobalLicense + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest} request GetUserListGlobalLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|listUserListGlobalLicenses}. + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @typedef ListUserListGlobalLicensesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} [response] ListUserListGlobalLicensesResponse + */ + + /** + * Calls ListUserListGlobalLicenses. + * @function listUserListGlobalLicenses + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest} request ListUserListGlobalLicensesRequest message or plain object + * @param {google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicensesCallback} callback Node-style callback called with the error, if any, and ListUserListGlobalLicensesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListGlobalLicenseService.prototype.listUserListGlobalLicenses = function listUserListGlobalLicenses(request, callback) { + return this.rpcCall(listUserListGlobalLicenses, $root.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest, $root.google.ads.datamanager.v1.ListUserListGlobalLicensesResponse, request, callback); + }, "name", { value: "ListUserListGlobalLicenses" }); + + /** + * Calls ListUserListGlobalLicenses. + * @function listUserListGlobalLicenses + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest} request ListUserListGlobalLicensesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListGlobalLicenseService|listUserListGlobalLicenseCustomerInfos}. + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @typedef ListUserListGlobalLicenseCustomerInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} [response] ListUserListGlobalLicenseCustomerInfosResponse + */ + + /** + * Calls ListUserListGlobalLicenseCustomerInfos. + * @function listUserListGlobalLicenseCustomerInfos + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest} request ListUserListGlobalLicenseCustomerInfosRequest message or plain object + * @param {google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenseCustomerInfosCallback} callback Node-style callback called with the error, if any, and ListUserListGlobalLicenseCustomerInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListGlobalLicenseService.prototype.listUserListGlobalLicenseCustomerInfos = function listUserListGlobalLicenseCustomerInfos(request, callback) { + return this.rpcCall(listUserListGlobalLicenseCustomerInfos, $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest, $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse, request, callback); + }, "name", { value: "ListUserListGlobalLicenseCustomerInfos" }); + + /** + * Calls ListUserListGlobalLicenseCustomerInfos. + * @function listUserListGlobalLicenseCustomerInfos + * @memberof google.ads.datamanager.v1.UserListGlobalLicenseService + * @instance + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest} request ListUserListGlobalLicenseCustomerInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserListGlobalLicenseService; + })(); + + v1.CreateUserListGlobalLicenseRequest = (function() { + + /** + * Properties of a CreateUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface ICreateUserListGlobalLicenseRequest + * @property {string|null} [parent] CreateUserListGlobalLicenseRequest parent + * @property {google.ads.datamanager.v1.IUserListGlobalLicense|null} [userListGlobalLicense] CreateUserListGlobalLicenseRequest userListGlobalLicense + */ + + /** + * Constructs a new CreateUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a CreateUserListGlobalLicenseRequest. + * @implements ICreateUserListGlobalLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest=} [properties] Properties to set + */ + function CreateUserListGlobalLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserListGlobalLicenseRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @instance + */ + CreateUserListGlobalLicenseRequest.prototype.parent = ""; + + /** + * CreateUserListGlobalLicenseRequest userListGlobalLicense. + * @member {google.ads.datamanager.v1.IUserListGlobalLicense|null|undefined} userListGlobalLicense + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @instance + */ + CreateUserListGlobalLicenseRequest.prototype.userListGlobalLicense = null; + + /** + * Creates a new CreateUserListGlobalLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest} CreateUserListGlobalLicenseRequest instance + */ + CreateUserListGlobalLicenseRequest.create = function create(properties) { + return new CreateUserListGlobalLicenseRequest(properties); + }; + + /** + * Encodes the specified CreateUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest} message CreateUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserListGlobalLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userListGlobalLicense != null && Object.hasOwnProperty.call(message, "userListGlobalLicense")) + $root.google.ads.datamanager.v1.UserListGlobalLicense.encode(message.userListGlobalLicense, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest} message CreateUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserListGlobalLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserListGlobalLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest} CreateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserListGlobalLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest} CreateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserListGlobalLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserListGlobalLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserListGlobalLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userListGlobalLicense != null && message.hasOwnProperty("userListGlobalLicense")) { + var error = $root.google.ads.datamanager.v1.UserListGlobalLicense.verify(message.userListGlobalLicense); + if (error) + return "userListGlobalLicense." + error; + } + return null; + }; + + /** + * Creates a CreateUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest} CreateUserListGlobalLicenseRequest + */ + CreateUserListGlobalLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userListGlobalLicense != null) { + if (typeof object.userListGlobalLicense !== "object") + throw TypeError(".google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest.userListGlobalLicense: object expected"); + message.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.fromObject(object.userListGlobalLicense); + } + return message; + }; + + /** + * Creates a plain object from a CreateUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest} message CreateUserListGlobalLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserListGlobalLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userListGlobalLicense = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userListGlobalLicense != null && message.hasOwnProperty("userListGlobalLicense")) + object.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.toObject(message.userListGlobalLicense, options); + return object; + }; + + /** + * Converts this CreateUserListGlobalLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserListGlobalLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserListGlobalLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserListGlobalLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest"; + }; + + return CreateUserListGlobalLicenseRequest; + })(); + + v1.UpdateUserListGlobalLicenseRequest = (function() { + + /** + * Properties of an UpdateUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface IUpdateUserListGlobalLicenseRequest + * @property {google.ads.datamanager.v1.IUserListGlobalLicense|null} [userListGlobalLicense] UpdateUserListGlobalLicenseRequest userListGlobalLicense + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserListGlobalLicenseRequest updateMask + */ + + /** + * Constructs a new UpdateUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents an UpdateUserListGlobalLicenseRequest. + * @implements IUpdateUserListGlobalLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest=} [properties] Properties to set + */ + function UpdateUserListGlobalLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserListGlobalLicenseRequest userListGlobalLicense. + * @member {google.ads.datamanager.v1.IUserListGlobalLicense|null|undefined} userListGlobalLicense + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @instance + */ + UpdateUserListGlobalLicenseRequest.prototype.userListGlobalLicense = null; + + /** + * UpdateUserListGlobalLicenseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @instance + */ + UpdateUserListGlobalLicenseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateUserListGlobalLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest} UpdateUserListGlobalLicenseRequest instance + */ + UpdateUserListGlobalLicenseRequest.create = function create(properties) { + return new UpdateUserListGlobalLicenseRequest(properties); + }; + + /** + * Encodes the specified UpdateUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest} message UpdateUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserListGlobalLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userListGlobalLicense != null && Object.hasOwnProperty.call(message, "userListGlobalLicense")) + $root.google.ads.datamanager.v1.UserListGlobalLicense.encode(message.userListGlobalLicense, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest} message UpdateUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserListGlobalLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserListGlobalLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest} UpdateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserListGlobalLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest} UpdateUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserListGlobalLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserListGlobalLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserListGlobalLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userListGlobalLicense != null && message.hasOwnProperty("userListGlobalLicense")) { + var error = $root.google.ads.datamanager.v1.UserListGlobalLicense.verify(message.userListGlobalLicense); + if (error) + return "userListGlobalLicense." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest} UpdateUserListGlobalLicenseRequest + */ + UpdateUserListGlobalLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest(); + if (object.userListGlobalLicense != null) { + if (typeof object.userListGlobalLicense !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.userListGlobalLicense: object expected"); + message.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.fromObject(object.userListGlobalLicense); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest} message UpdateUserListGlobalLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserListGlobalLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userListGlobalLicense = null; + object.updateMask = null; + } + if (message.userListGlobalLicense != null && message.hasOwnProperty("userListGlobalLicense")) + object.userListGlobalLicense = $root.google.ads.datamanager.v1.UserListGlobalLicense.toObject(message.userListGlobalLicense, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateUserListGlobalLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserListGlobalLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserListGlobalLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserListGlobalLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest"; + }; + + return UpdateUserListGlobalLicenseRequest; + })(); + + v1.GetUserListGlobalLicenseRequest = (function() { + + /** + * Properties of a GetUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @interface IGetUserListGlobalLicenseRequest + * @property {string|null} [name] GetUserListGlobalLicenseRequest name + */ + + /** + * Constructs a new GetUserListGlobalLicenseRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a GetUserListGlobalLicenseRequest. + * @implements IGetUserListGlobalLicenseRequest + * @constructor + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest=} [properties] Properties to set + */ + function GetUserListGlobalLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserListGlobalLicenseRequest name. + * @member {string} name + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @instance + */ + GetUserListGlobalLicenseRequest.prototype.name = ""; + + /** + * Creates a new GetUserListGlobalLicenseRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.GetUserListGlobalLicenseRequest} GetUserListGlobalLicenseRequest instance + */ + GetUserListGlobalLicenseRequest.create = function create(properties) { + return new GetUserListGlobalLicenseRequest(properties); + }; + + /** + * Encodes the specified GetUserListGlobalLicenseRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListGlobalLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest} message GetUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListGlobalLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserListGlobalLicenseRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListGlobalLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest} message GetUserListGlobalLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListGlobalLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserListGlobalLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.GetUserListGlobalLicenseRequest} GetUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListGlobalLicenseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserListGlobalLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.GetUserListGlobalLicenseRequest} GetUserListGlobalLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListGlobalLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserListGlobalLicenseRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserListGlobalLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserListGlobalLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.GetUserListGlobalLicenseRequest} GetUserListGlobalLicenseRequest + */ + GetUserListGlobalLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest) + return object; + var message = new $root.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserListGlobalLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {google.ads.datamanager.v1.GetUserListGlobalLicenseRequest} message GetUserListGlobalLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserListGlobalLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserListGlobalLicenseRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserListGlobalLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserListGlobalLicenseRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.GetUserListGlobalLicenseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserListGlobalLicenseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.GetUserListGlobalLicenseRequest"; + }; + + return GetUserListGlobalLicenseRequest; + })(); + + v1.ListUserListGlobalLicensesRequest = (function() { + + /** + * Properties of a ListUserListGlobalLicensesRequest. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListGlobalLicensesRequest + * @property {string|null} [parent] ListUserListGlobalLicensesRequest parent + * @property {string|null} [filter] ListUserListGlobalLicensesRequest filter + * @property {number|null} [pageSize] ListUserListGlobalLicensesRequest pageSize + * @property {string|null} [pageToken] ListUserListGlobalLicensesRequest pageToken + */ + + /** + * Constructs a new ListUserListGlobalLicensesRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListGlobalLicensesRequest. + * @implements IListUserListGlobalLicensesRequest + * @constructor + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest=} [properties] Properties to set + */ + function ListUserListGlobalLicensesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListGlobalLicensesRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @instance + */ + ListUserListGlobalLicensesRequest.prototype.parent = ""; + + /** + * ListUserListGlobalLicensesRequest filter. + * @member {string} filter + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @instance + */ + ListUserListGlobalLicensesRequest.prototype.filter = ""; + + /** + * ListUserListGlobalLicensesRequest pageSize. + * @member {number} pageSize + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @instance + */ + ListUserListGlobalLicensesRequest.prototype.pageSize = 0; + + /** + * ListUserListGlobalLicensesRequest pageToken. + * @member {string} pageToken + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @instance + */ + ListUserListGlobalLicensesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUserListGlobalLicensesRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesRequest} ListUserListGlobalLicensesRequest instance + */ + ListUserListGlobalLicensesRequest.create = function create(properties) { + return new ListUserListGlobalLicensesRequest(properties); + }; + + /** + * Encodes the specified ListUserListGlobalLicensesRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest} message ListUserListGlobalLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicensesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListGlobalLicensesRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesRequest} message ListUserListGlobalLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicensesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListGlobalLicensesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesRequest} ListUserListGlobalLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicensesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListGlobalLicensesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesRequest} ListUserListGlobalLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicensesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListGlobalLicensesRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListGlobalLicensesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListGlobalLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesRequest} ListUserListGlobalLicensesRequest + */ + ListUserListGlobalLicensesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListGlobalLicensesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {google.ads.datamanager.v1.ListUserListGlobalLicensesRequest} message ListUserListGlobalLicensesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListGlobalLicensesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUserListGlobalLicensesRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @instance + * @returns {Object.} JSON object + */ + ListUserListGlobalLicensesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListGlobalLicensesRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListGlobalLicensesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListGlobalLicensesRequest"; + }; + + return ListUserListGlobalLicensesRequest; + })(); + + v1.ListUserListGlobalLicensesResponse = (function() { + + /** + * Properties of a ListUserListGlobalLicensesResponse. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListGlobalLicensesResponse + * @property {Array.|null} [userListGlobalLicenses] ListUserListGlobalLicensesResponse userListGlobalLicenses + * @property {string|null} [nextPageToken] ListUserListGlobalLicensesResponse nextPageToken + */ + + /** + * Constructs a new ListUserListGlobalLicensesResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListGlobalLicensesResponse. + * @implements IListUserListGlobalLicensesResponse + * @constructor + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesResponse=} [properties] Properties to set + */ + function ListUserListGlobalLicensesResponse(properties) { + this.userListGlobalLicenses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListGlobalLicensesResponse userListGlobalLicenses. + * @member {Array.} userListGlobalLicenses + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @instance + */ + ListUserListGlobalLicensesResponse.prototype.userListGlobalLicenses = $util.emptyArray; + + /** + * ListUserListGlobalLicensesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @instance + */ + ListUserListGlobalLicensesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListUserListGlobalLicensesResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} ListUserListGlobalLicensesResponse instance + */ + ListUserListGlobalLicensesResponse.create = function create(properties) { + return new ListUserListGlobalLicensesResponse(properties); + }; + + /** + * Encodes the specified ListUserListGlobalLicensesResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesResponse} message ListUserListGlobalLicensesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicensesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userListGlobalLicenses != null && message.userListGlobalLicenses.length) + for (var i = 0; i < message.userListGlobalLicenses.length; ++i) + $root.google.ads.datamanager.v1.UserListGlobalLicense.encode(message.userListGlobalLicenses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListGlobalLicensesResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicensesResponse} message ListUserListGlobalLicensesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicensesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListGlobalLicensesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} ListUserListGlobalLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicensesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicensesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.userListGlobalLicenses && message.userListGlobalLicenses.length)) + message.userListGlobalLicenses = []; + message.userListGlobalLicenses.push($root.google.ads.datamanager.v1.UserListGlobalLicense.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListGlobalLicensesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} ListUserListGlobalLicensesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicensesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListGlobalLicensesResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListGlobalLicensesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userListGlobalLicenses != null && message.hasOwnProperty("userListGlobalLicenses")) { + if (!Array.isArray(message.userListGlobalLicenses)) + return "userListGlobalLicenses: array expected"; + for (var i = 0; i < message.userListGlobalLicenses.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListGlobalLicense.verify(message.userListGlobalLicenses[i]); + if (error) + return "userListGlobalLicenses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListGlobalLicensesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} ListUserListGlobalLicensesResponse + */ + ListUserListGlobalLicensesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListGlobalLicensesResponse) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicensesResponse(); + if (object.userListGlobalLicenses) { + if (!Array.isArray(object.userListGlobalLicenses)) + throw TypeError(".google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.userListGlobalLicenses: array expected"); + message.userListGlobalLicenses = []; + for (var i = 0; i < object.userListGlobalLicenses.length; ++i) { + if (typeof object.userListGlobalLicenses[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.ListUserListGlobalLicensesResponse.userListGlobalLicenses: object expected"); + message.userListGlobalLicenses[i] = $root.google.ads.datamanager.v1.UserListGlobalLicense.fromObject(object.userListGlobalLicenses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListGlobalLicensesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {google.ads.datamanager.v1.ListUserListGlobalLicensesResponse} message ListUserListGlobalLicensesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListGlobalLicensesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userListGlobalLicenses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.userListGlobalLicenses && message.userListGlobalLicenses.length) { + object.userListGlobalLicenses = []; + for (var j = 0; j < message.userListGlobalLicenses.length; ++j) + object.userListGlobalLicenses[j] = $root.google.ads.datamanager.v1.UserListGlobalLicense.toObject(message.userListGlobalLicenses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListUserListGlobalLicensesResponse to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @instance + * @returns {Object.} JSON object + */ + ListUserListGlobalLicensesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListGlobalLicensesResponse + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicensesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListGlobalLicensesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListGlobalLicensesResponse"; + }; + + return ListUserListGlobalLicensesResponse; + })(); + + v1.ListUserListGlobalLicenseCustomerInfosRequest = (function() { + + /** + * Properties of a ListUserListGlobalLicenseCustomerInfosRequest. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListGlobalLicenseCustomerInfosRequest + * @property {string|null} [parent] ListUserListGlobalLicenseCustomerInfosRequest parent + * @property {string|null} [filter] ListUserListGlobalLicenseCustomerInfosRequest filter + * @property {number|null} [pageSize] ListUserListGlobalLicenseCustomerInfosRequest pageSize + * @property {string|null} [pageToken] ListUserListGlobalLicenseCustomerInfosRequest pageToken + */ + + /** + * Constructs a new ListUserListGlobalLicenseCustomerInfosRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListGlobalLicenseCustomerInfosRequest. + * @implements IListUserListGlobalLicenseCustomerInfosRequest + * @constructor + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest=} [properties] Properties to set + */ + function ListUserListGlobalLicenseCustomerInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListGlobalLicenseCustomerInfosRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @instance + */ + ListUserListGlobalLicenseCustomerInfosRequest.prototype.parent = ""; + + /** + * ListUserListGlobalLicenseCustomerInfosRequest filter. + * @member {string} filter + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @instance + */ + ListUserListGlobalLicenseCustomerInfosRequest.prototype.filter = ""; + + /** + * ListUserListGlobalLicenseCustomerInfosRequest pageSize. + * @member {number} pageSize + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @instance + */ + ListUserListGlobalLicenseCustomerInfosRequest.prototype.pageSize = 0; + + /** + * ListUserListGlobalLicenseCustomerInfosRequest pageToken. + * @member {string} pageToken + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @instance + */ + ListUserListGlobalLicenseCustomerInfosRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUserListGlobalLicenseCustomerInfosRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest} ListUserListGlobalLicenseCustomerInfosRequest instance + */ + ListUserListGlobalLicenseCustomerInfosRequest.create = function create(properties) { + return new ListUserListGlobalLicenseCustomerInfosRequest(properties); + }; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest} message ListUserListGlobalLicenseCustomerInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicenseCustomerInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest} message ListUserListGlobalLicenseCustomerInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicenseCustomerInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest} ListUserListGlobalLicenseCustomerInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicenseCustomerInfosRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest} ListUserListGlobalLicenseCustomerInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicenseCustomerInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListGlobalLicenseCustomerInfosRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListGlobalLicenseCustomerInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListGlobalLicenseCustomerInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest} ListUserListGlobalLicenseCustomerInfosRequest + */ + ListUserListGlobalLicenseCustomerInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListGlobalLicenseCustomerInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest} message ListUserListGlobalLicenseCustomerInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListGlobalLicenseCustomerInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUserListGlobalLicenseCustomerInfosRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @instance + * @returns {Object.} JSON object + */ + ListUserListGlobalLicenseCustomerInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListGlobalLicenseCustomerInfosRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListGlobalLicenseCustomerInfosRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest"; + }; + + return ListUserListGlobalLicenseCustomerInfosRequest; + })(); + + v1.ListUserListGlobalLicenseCustomerInfosResponse = (function() { + + /** + * Properties of a ListUserListGlobalLicenseCustomerInfosResponse. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListGlobalLicenseCustomerInfosResponse + * @property {Array.|null} [userListGlobalLicenseCustomerInfos] ListUserListGlobalLicenseCustomerInfosResponse userListGlobalLicenseCustomerInfos + * @property {string|null} [nextPageToken] ListUserListGlobalLicenseCustomerInfosResponse nextPageToken + */ + + /** + * Constructs a new ListUserListGlobalLicenseCustomerInfosResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListGlobalLicenseCustomerInfosResponse. + * @implements IListUserListGlobalLicenseCustomerInfosResponse + * @constructor + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse=} [properties] Properties to set + */ + function ListUserListGlobalLicenseCustomerInfosResponse(properties) { + this.userListGlobalLicenseCustomerInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListGlobalLicenseCustomerInfosResponse userListGlobalLicenseCustomerInfos. + * @member {Array.} userListGlobalLicenseCustomerInfos + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @instance + */ + ListUserListGlobalLicenseCustomerInfosResponse.prototype.userListGlobalLicenseCustomerInfos = $util.emptyArray; + + /** + * ListUserListGlobalLicenseCustomerInfosResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @instance + */ + ListUserListGlobalLicenseCustomerInfosResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListUserListGlobalLicenseCustomerInfosResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} ListUserListGlobalLicenseCustomerInfosResponse instance + */ + ListUserListGlobalLicenseCustomerInfosResponse.create = function create(properties) { + return new ListUserListGlobalLicenseCustomerInfosResponse(properties); + }; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse} message ListUserListGlobalLicenseCustomerInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicenseCustomerInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userListGlobalLicenseCustomerInfos != null && message.userListGlobalLicenseCustomerInfos.length) + for (var i = 0; i < message.userListGlobalLicenseCustomerInfos.length; ++i) + $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.encode(message.userListGlobalLicenseCustomerInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListGlobalLicenseCustomerInfosResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse} message ListUserListGlobalLicenseCustomerInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListGlobalLicenseCustomerInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} ListUserListGlobalLicenseCustomerInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicenseCustomerInfosResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.userListGlobalLicenseCustomerInfos && message.userListGlobalLicenseCustomerInfos.length)) + message.userListGlobalLicenseCustomerInfos = []; + message.userListGlobalLicenseCustomerInfos.push($root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUserListGlobalLicenseCustomerInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} ListUserListGlobalLicenseCustomerInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListGlobalLicenseCustomerInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListGlobalLicenseCustomerInfosResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListGlobalLicenseCustomerInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userListGlobalLicenseCustomerInfos != null && message.hasOwnProperty("userListGlobalLicenseCustomerInfos")) { + if (!Array.isArray(message.userListGlobalLicenseCustomerInfos)) + return "userListGlobalLicenseCustomerInfos: array expected"; + for (var i = 0; i < message.userListGlobalLicenseCustomerInfos.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.verify(message.userListGlobalLicenseCustomerInfos[i]); + if (error) + return "userListGlobalLicenseCustomerInfos." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListUserListGlobalLicenseCustomerInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} ListUserListGlobalLicenseCustomerInfosResponse + */ + ListUserListGlobalLicenseCustomerInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse(); + if (object.userListGlobalLicenseCustomerInfos) { + if (!Array.isArray(object.userListGlobalLicenseCustomerInfos)) + throw TypeError(".google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.userListGlobalLicenseCustomerInfos: array expected"); + message.userListGlobalLicenseCustomerInfos = []; + for (var i = 0; i < object.userListGlobalLicenseCustomerInfos.length; ++i) { + if (typeof object.userListGlobalLicenseCustomerInfos[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse.userListGlobalLicenseCustomerInfos: object expected"); + message.userListGlobalLicenseCustomerInfos[i] = $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.fromObject(object.userListGlobalLicenseCustomerInfos[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListUserListGlobalLicenseCustomerInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse} message ListUserListGlobalLicenseCustomerInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListGlobalLicenseCustomerInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userListGlobalLicenseCustomerInfos = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.userListGlobalLicenseCustomerInfos && message.userListGlobalLicenseCustomerInfos.length) { + object.userListGlobalLicenseCustomerInfos = []; + for (var j = 0; j < message.userListGlobalLicenseCustomerInfos.length; ++j) + object.userListGlobalLicenseCustomerInfos[j] = $root.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo.toObject(message.userListGlobalLicenseCustomerInfos[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListUserListGlobalLicenseCustomerInfosResponse to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @instance + * @returns {Object.} JSON object + */ + ListUserListGlobalLicenseCustomerInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListGlobalLicenseCustomerInfosResponse + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListGlobalLicenseCustomerInfosResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse"; + }; + + return ListUserListGlobalLicenseCustomerInfosResponse; + })(); + + v1.UserListService = (function() { + + /** + * Constructs a new UserListService service. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a UserListService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function UserListService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserListService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserListService; + + /** + * Creates new UserListService service using the specified rpc implementation. + * @function create + * @memberof google.ads.datamanager.v1.UserListService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {UserListService} RPC service. Useful where requests and/or responses are streamed. + */ + UserListService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|getUserList}. + * @memberof google.ads.datamanager.v1.UserListService + * @typedef GetUserListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserList} [response] UserList + */ + + /** + * Calls GetUserList. + * @function getUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListRequest} request GetUserListRequest message or plain object + * @param {google.ads.datamanager.v1.UserListService.GetUserListCallback} callback Node-style callback called with the error, if any, and UserList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListService.prototype.getUserList = function getUserList(request, callback) { + return this.rpcCall(getUserList, $root.google.ads.datamanager.v1.GetUserListRequest, $root.google.ads.datamanager.v1.UserList, request, callback); + }, "name", { value: "GetUserList" }); + + /** + * Calls GetUserList. + * @function getUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IGetUserListRequest} request GetUserListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|listUserLists}. + * @memberof google.ads.datamanager.v1.UserListService + * @typedef ListUserListsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.ListUserListsResponse} [response] ListUserListsResponse + */ + + /** + * Calls ListUserLists. + * @function listUserLists + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IListUserListsRequest} request ListUserListsRequest message or plain object + * @param {google.ads.datamanager.v1.UserListService.ListUserListsCallback} callback Node-style callback called with the error, if any, and ListUserListsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListService.prototype.listUserLists = function listUserLists(request, callback) { + return this.rpcCall(listUserLists, $root.google.ads.datamanager.v1.ListUserListsRequest, $root.google.ads.datamanager.v1.ListUserListsResponse, request, callback); + }, "name", { value: "ListUserLists" }); + + /** + * Calls ListUserLists. + * @function listUserLists + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IListUserListsRequest} request ListUserListsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|createUserList}. + * @memberof google.ads.datamanager.v1.UserListService + * @typedef CreateUserListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserList} [response] UserList + */ + + /** + * Calls CreateUserList. + * @function createUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListRequest} request CreateUserListRequest message or plain object + * @param {google.ads.datamanager.v1.UserListService.CreateUserListCallback} callback Node-style callback called with the error, if any, and UserList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListService.prototype.createUserList = function createUserList(request, callback) { + return this.rpcCall(createUserList, $root.google.ads.datamanager.v1.CreateUserListRequest, $root.google.ads.datamanager.v1.UserList, request, callback); + }, "name", { value: "CreateUserList" }); + + /** + * Calls CreateUserList. + * @function createUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.ICreateUserListRequest} request CreateUserListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|updateUserList}. + * @memberof google.ads.datamanager.v1.UserListService + * @typedef UpdateUserListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ads.datamanager.v1.UserList} [response] UserList + */ + + /** + * Calls UpdateUserList. + * @function updateUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListRequest} request UpdateUserListRequest message or plain object + * @param {google.ads.datamanager.v1.UserListService.UpdateUserListCallback} callback Node-style callback called with the error, if any, and UserList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListService.prototype.updateUserList = function updateUserList(request, callback) { + return this.rpcCall(updateUserList, $root.google.ads.datamanager.v1.UpdateUserListRequest, $root.google.ads.datamanager.v1.UserList, request, callback); + }, "name", { value: "UpdateUserList" }); + + /** + * Calls UpdateUserList. + * @function updateUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IUpdateUserListRequest} request UpdateUserListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ads.datamanager.v1.UserListService|deleteUserList}. + * @memberof google.ads.datamanager.v1.UserListService + * @typedef DeleteUserListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUserList. + * @function deleteUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IDeleteUserListRequest} request DeleteUserListRequest message or plain object + * @param {google.ads.datamanager.v1.UserListService.DeleteUserListCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserListService.prototype.deleteUserList = function deleteUserList(request, callback) { + return this.rpcCall(deleteUserList, $root.google.ads.datamanager.v1.DeleteUserListRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUserList" }); + + /** + * Calls DeleteUserList. + * @function deleteUserList + * @memberof google.ads.datamanager.v1.UserListService + * @instance + * @param {google.ads.datamanager.v1.IDeleteUserListRequest} request DeleteUserListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserListService; + })(); + + v1.GetUserListRequest = (function() { + + /** + * Properties of a GetUserListRequest. + * @memberof google.ads.datamanager.v1 + * @interface IGetUserListRequest + * @property {string|null} [name] GetUserListRequest name + */ + + /** + * Constructs a new GetUserListRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a GetUserListRequest. + * @implements IGetUserListRequest + * @constructor + * @param {google.ads.datamanager.v1.IGetUserListRequest=} [properties] Properties to set + */ + function GetUserListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserListRequest name. + * @member {string} name + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @instance + */ + GetUserListRequest.prototype.name = ""; + + /** + * Creates a new GetUserListRequest instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.GetUserListRequest} GetUserListRequest instance + */ + GetUserListRequest.create = function create(properties) { + return new GetUserListRequest(properties); + }; + + /** + * Encodes the specified GetUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.GetUserListRequest.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListRequest} message GetUserListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.GetUserListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {google.ads.datamanager.v1.IGetUserListRequest} message GetUserListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Constructs a new ErrorCount. + * Decodes a GetUserListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.GetUserListRequest} GetUserListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.GetUserListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.GetUserListRequest} GetUserListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserListRequest message. + * @function verify + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.GetUserListRequest} GetUserListRequest + */ + GetUserListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.GetUserListRequest) + return object; + var message = new $root.google.ads.datamanager.v1.GetUserListRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {google.ads.datamanager.v1.GetUserListRequest} message GetUserListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserListRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserListRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.GetUserListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.GetUserListRequest"; + }; + + return GetUserListRequest; + })(); + + v1.ListUserListsRequest = (function() { + + /** + * Properties of a ListUserListsRequest. * @memberof google.ads.datamanager.v1 - * @classdesc Represents an ErrorCount. - * @implements IErrorCount + * @interface IListUserListsRequest + * @property {string|null} [parent] ListUserListsRequest parent + * @property {number|null} [pageSize] ListUserListsRequest pageSize + * @property {string|null} [pageToken] ListUserListsRequest pageToken + * @property {string|null} [filter] ListUserListsRequest filter + */ + + /** + * Constructs a new ListUserListsRequest. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListsRequest. + * @implements IListUserListsRequest * @constructor - * @param {google.ads.datamanager.v1.IErrorCount=} [properties] Properties to set + * @param {google.ads.datamanager.v1.IListUserListsRequest=} [properties] Properties to set */ - function ErrorCount(properties) { + function ListUserListsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12790,91 +28968,119 @@ } /** - * ErrorCount recordCount. - * @member {number|Long} recordCount - * @memberof google.ads.datamanager.v1.ErrorCount + * ListUserListsRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @instance */ - ErrorCount.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListUserListsRequest.prototype.parent = ""; /** - * ErrorCount reason. - * @member {google.ads.datamanager.v1.ProcessingErrorReason} reason - * @memberof google.ads.datamanager.v1.ErrorCount + * ListUserListsRequest pageSize. + * @member {number} pageSize + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @instance */ - ErrorCount.prototype.reason = 0; + ListUserListsRequest.prototype.pageSize = 0; /** - * Creates a new ErrorCount instance using the specified properties. + * ListUserListsRequest pageToken. + * @member {string} pageToken + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @instance + */ + ListUserListsRequest.prototype.pageToken = ""; + + /** + * ListUserListsRequest filter. + * @member {string} filter + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @instance + */ + ListUserListsRequest.prototype.filter = ""; + + /** + * Creates a new ListUserListsRequest instance using the specified properties. * @function create - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static - * @param {google.ads.datamanager.v1.IErrorCount=} [properties] Properties to set - * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount instance + * @param {google.ads.datamanager.v1.IListUserListsRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListsRequest} ListUserListsRequest instance */ - ErrorCount.create = function create(properties) { - return new ErrorCount(properties); + ListUserListsRequest.create = function create(properties) { + return new ListUserListsRequest(properties); }; /** - * Encodes the specified ErrorCount message. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * Encodes the specified ListUserListsRequest message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsRequest.verify|verify} messages. * @function encode - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static - * @param {google.ads.datamanager.v1.IErrorCount} message ErrorCount message or plain object to encode + * @param {google.ads.datamanager.v1.IListUserListsRequest} message ListUserListsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorCount.encode = function encode(message, writer) { + ListUserListsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; /** - * Encodes the specified ErrorCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ErrorCount.verify|verify} messages. + * Encodes the specified ListUserListsRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static - * @param {google.ads.datamanager.v1.IErrorCount} message ErrorCount message or plain object to encode + * @param {google.ads.datamanager.v1.IListUserListsRequest} message ListUserListsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorCount.encodeDelimited = function encodeDelimited(message, writer) { + ListUserListsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ErrorCount message from the specified reader or buffer. + * Decodes a ListUserListsRequest message from the specified reader or buffer. * @function decode - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + * @returns {google.ads.datamanager.v1.ListUserListsRequest} ListUserListsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorCount.decode = function decode(reader, length, error) { + ListUserListsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ErrorCount(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.recordCount = reader.int64(); + message.parent = reader.string(); break; } case 2: { - message.reason = reader.int32(); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); break; } default: @@ -12886,295 +29092,399 @@ }; /** - * Decodes an ErrorCount message from the specified reader or buffer, length delimited. + * Decodes a ListUserListsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + * @returns {google.ads.datamanager.v1.ListUserListsRequest} ListUserListsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorCount.decodeDelimited = function decodeDelimited(reader) { + ListUserListsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ErrorCount message. + * Verifies a ListUserListsRequest message. * @function verify - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ErrorCount.verify = function verify(message) { + ListUserListsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) - return "recordCount: integer|Long expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListUserListsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ads.datamanager.v1.ListUserListsRequest} ListUserListsRequest + */ + ListUserListsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListsRequest) + return object; + var message = new $root.google.ads.datamanager.v1.ListUserListsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListUserListsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @static + * @param {google.ads.datamanager.v1.ListUserListsRequest} message ListUserListsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUserListsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListUserListsRequest to JSON. + * @function toJSON + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUserListsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUserListsRequest + * @function getTypeUrl + * @memberof google.ads.datamanager.v1.ListUserListsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUserListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListsRequest"; + }; + + return ListUserListsRequest; + })(); + + v1.ListUserListsResponse = (function() { + + /** + * Properties of a ListUserListsResponse. + * @memberof google.ads.datamanager.v1 + * @interface IListUserListsResponse + * @property {Array.|null} [userLists] ListUserListsResponse userLists + * @property {string|null} [nextPageToken] ListUserListsResponse nextPageToken + */ + + /** + * Constructs a new ListUserListsResponse. + * @memberof google.ads.datamanager.v1 + * @classdesc Represents a ListUserListsResponse. + * @implements IListUserListsResponse + * @constructor + * @param {google.ads.datamanager.v1.IListUserListsResponse=} [properties] Properties to set + */ + function ListUserListsResponse(properties) { + this.userLists = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUserListsResponse userLists. + * @member {Array.} userLists + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @instance + */ + ListUserListsResponse.prototype.userLists = $util.emptyArray; + + /** + * ListUserListsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @instance + */ + ListUserListsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListUserListsResponse instance using the specified properties. + * @function create + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListsResponse=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.ListUserListsResponse} ListUserListsResponse instance + */ + ListUserListsResponse.create = function create(properties) { + return new ListUserListsResponse(properties); + }; + + /** + * Encodes the specified ListUserListsResponse message. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsResponse.verify|verify} messages. + * @function encode + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListsResponse} message ListUserListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userLists != null && message.userLists.length) + for (var i = 0; i < message.userLists.length; ++i) + $root.google.ads.datamanager.v1.UserList.encode(message.userLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListUserListsResponse message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.ListUserListsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {google.ads.datamanager.v1.IListUserListsResponse} message ListUserListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUserListsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUserListsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ads.datamanager.v1.ListUserListsResponse} ListUserListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.ListUserListsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.userLists && message.userLists.length)) + message.userLists = []; + message.userLists.push($root.google.ads.datamanager.v1.UserList.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 27: - case 25: - case 26: + reader.skipType(tag & 7); break; } + } + return message; + }; + + /** + * Decodes a ListUserListsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ads.datamanager.v1.ListUserListsResponse} ListUserListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUserListsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUserListsResponse message. + * @function verify + * @memberof google.ads.datamanager.v1.ListUserListsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUserListsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userLists != null && message.hasOwnProperty("userLists")) { + if (!Array.isArray(message.userLists)) + return "userLists: array expected"; + for (var i = 0; i < message.userLists.length; ++i) { + var error = $root.google.ads.datamanager.v1.UserList.verify(message.userLists[i]); + if (error) + return "userLists." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ErrorCount message from a plain object. Also converts values to their respective internal types. + * Creates a ListUserListsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsResponse * @static * @param {Object.} object Plain object - * @returns {google.ads.datamanager.v1.ErrorCount} ErrorCount + * @returns {google.ads.datamanager.v1.ListUserListsResponse} ListUserListsResponse */ - ErrorCount.fromObject = function fromObject(object) { - if (object instanceof $root.google.ads.datamanager.v1.ErrorCount) + ListUserListsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.ListUserListsResponse) return object; - var message = new $root.google.ads.datamanager.v1.ErrorCount(); - if (object.recordCount != null) - if ($util.Long) - (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; - else if (typeof object.recordCount === "string") - message.recordCount = parseInt(object.recordCount, 10); - else if (typeof object.recordCount === "number") - message.recordCount = object.recordCount; - else if (typeof object.recordCount === "object") - message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; + var message = new $root.google.ads.datamanager.v1.ListUserListsResponse(); + if (object.userLists) { + if (!Array.isArray(object.userLists)) + throw TypeError(".google.ads.datamanager.v1.ListUserListsResponse.userLists: array expected"); + message.userLists = []; + for (var i = 0; i < object.userLists.length; ++i) { + if (typeof object.userLists[i] !== "object") + throw TypeError(".google.ads.datamanager.v1.ListUserListsResponse.userLists: object expected"); + message.userLists[i] = $root.google.ads.datamanager.v1.UserList.fromObject(object.userLists[i]); } - break; - case "PROCESSING_ERROR_REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE": - case 1: - message.reason = 1; - break; - case "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED": - case 2: - message.reason = 2; - break; - case "PROCESSING_ERROR_REASON_EVENT_TOO_OLD": - case 3: - message.reason = 3; - break; - case "PROCESSING_ERROR_REASON_DENIED_CONSENT": - case 4: - message.reason = 4; - break; - case "PROCESSING_ERROR_REASON_NO_CONSENT": - case 5: - message.reason = 5; - break; - case "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT": - case 6: - message.reason = 6; - break; - case "PROCESSING_ERROR_REASON_DUPLICATE_GCLID": - case 7: - message.reason = 7; - break; - case "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID": - case 8: - message.reason = 8; - break; - case "PROCESSING_ERROR_REASON_INVALID_GBRAID": - case 9: - message.reason = 9; - break; - case "PROCESSING_ERROR_REASON_INVALID_GCLID": - case 10: - message.reason = 10; - break; - case "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID": - case 11: - message.reason = 11; - break; - case "PROCESSING_ERROR_REASON_INVALID_WBRAID": - case 12: - message.reason = 12; - break; - case "PROCESSING_ERROR_REASON_INTERNAL_ERROR": - case 13: - message.reason = 13; - break; - case "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED": - case 14: - message.reason = 14; - break; - case "PROCESSING_ERROR_REASON_INVALID_EVENT": - case 15: - message.reason = 15; - break; - case "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS": - case 16: - message.reason = 16; - break; - case "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS": - case 17: - message.reason = 17; - break; - case "PROCESSING_ERROR_REASON_INVALID_FORMAT": - case 18: - message.reason = 18; - break; - case "PROCESSING_ERROR_REASON_DECRYPTION_ERROR": - case 19: - message.reason = 19; - break; - case "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR": - case 20: - message.reason = 20; - break; - case "PROCESSING_ERROR_REASON_INVALID_WIP": - case 21: - message.reason = 21; - break; - case "PROCESSING_ERROR_REASON_INVALID_KEK": - case 22: - message.reason = 22; - break; - case "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED": - case 23: - message.reason = 23; - break; - case "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED": - case 24: - message.reason = 24; - break; - case "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED": - case 27: - message.reason = 27; - break; - case "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": - case 25: - message.reason = 25; - break; - case "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER": - case 26: - message.reason = 26; - break; } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ErrorCount message. Also converts values to other types if specified. + * Creates a plain object from a ListUserListsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsResponse * @static - * @param {google.ads.datamanager.v1.ErrorCount} message ErrorCount + * @param {google.ads.datamanager.v1.ListUserListsResponse} message ListUserListsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ErrorCount.toObject = function toObject(message, options) { + ListUserListsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.recordCount = options.longs === String ? "0" : 0; - object.reason = options.enums === String ? "PROCESSING_ERROR_REASON_UNSPECIFIED" : 0; - } - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (typeof message.recordCount === "number") - object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; - else - object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.ads.datamanager.v1.ProcessingErrorReason[message.reason] === undefined ? message.reason : $root.google.ads.datamanager.v1.ProcessingErrorReason[message.reason] : message.reason; + if (options.arrays || options.defaults) + object.userLists = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.userLists && message.userLists.length) { + object.userLists = []; + for (var j = 0; j < message.userLists.length; ++j) + object.userLists[j] = $root.google.ads.datamanager.v1.UserList.toObject(message.userLists[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ErrorCount to JSON. + * Converts this ListUserListsResponse to JSON. * @function toJSON - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsResponse * @instance * @returns {Object.} JSON object */ - ErrorCount.prototype.toJSON = function toJSON() { + ListUserListsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ErrorCount + * Gets the default type url for ListUserListsResponse * @function getTypeUrl - * @memberof google.ads.datamanager.v1.ErrorCount + * @memberof google.ads.datamanager.v1.ListUserListsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ErrorCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListUserListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ads.datamanager.v1.ErrorCount"; + return typeUrlPrefix + "/google.ads.datamanager.v1.ListUserListsResponse"; }; - return ErrorCount; + return ListUserListsResponse; })(); - v1.WarningInfo = (function() { + v1.CreateUserListRequest = (function() { /** - * Properties of a WarningInfo. + * Properties of a CreateUserListRequest. * @memberof google.ads.datamanager.v1 - * @interface IWarningInfo - * @property {Array.|null} [warningCounts] WarningInfo warningCounts + * @interface ICreateUserListRequest + * @property {string|null} [parent] CreateUserListRequest parent + * @property {google.ads.datamanager.v1.IUserList|null} [userList] CreateUserListRequest userList + * @property {boolean|null} [validateOnly] CreateUserListRequest validateOnly */ /** - * Constructs a new WarningInfo. + * Constructs a new CreateUserListRequest. * @memberof google.ads.datamanager.v1 - * @classdesc Represents a WarningInfo. - * @implements IWarningInfo + * @classdesc Represents a CreateUserListRequest. + * @implements ICreateUserListRequest * @constructor - * @param {google.ads.datamanager.v1.IWarningInfo=} [properties] Properties to set + * @param {google.ads.datamanager.v1.ICreateUserListRequest=} [properties] Properties to set */ - function WarningInfo(properties) { - this.warningCounts = []; + function CreateUserListRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13182,80 +29492,105 @@ } /** - * WarningInfo warningCounts. - * @member {Array.} warningCounts - * @memberof google.ads.datamanager.v1.WarningInfo + * CreateUserListRequest parent. + * @member {string} parent + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @instance */ - WarningInfo.prototype.warningCounts = $util.emptyArray; + CreateUserListRequest.prototype.parent = ""; /** - * Creates a new WarningInfo instance using the specified properties. + * CreateUserListRequest userList. + * @member {google.ads.datamanager.v1.IUserList|null|undefined} userList + * @memberof google.ads.datamanager.v1.CreateUserListRequest + * @instance + */ + CreateUserListRequest.prototype.userList = null; + + /** + * CreateUserListRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.ads.datamanager.v1.CreateUserListRequest + * @instance + */ + CreateUserListRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserListRequest instance using the specified properties. * @function create - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningInfo=} [properties] Properties to set - * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo instance + * @param {google.ads.datamanager.v1.ICreateUserListRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.CreateUserListRequest} CreateUserListRequest instance */ - WarningInfo.create = function create(properties) { - return new WarningInfo(properties); + CreateUserListRequest.create = function create(properties) { + return new CreateUserListRequest(properties); }; /** - * Encodes the specified WarningInfo message. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * Encodes the specified CreateUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListRequest.verify|verify} messages. * @function encode - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningInfo} message WarningInfo message or plain object to encode + * @param {google.ads.datamanager.v1.ICreateUserListRequest} message CreateUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WarningInfo.encode = function encode(message, writer) { + CreateUserListRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.warningCounts != null && message.warningCounts.length) - for (var i = 0; i < message.warningCounts.length; ++i) - $root.google.ads.datamanager.v1.WarningCount.encode(message.warningCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userList != null && Object.hasOwnProperty.call(message, "userList")) + $root.google.ads.datamanager.v1.UserList.encode(message.userList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified WarningInfo message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningInfo.verify|verify} messages. + * Encodes the specified CreateUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.CreateUserListRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningInfo} message WarningInfo message or plain object to encode + * @param {google.ads.datamanager.v1.ICreateUserListRequest} message CreateUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WarningInfo.encodeDelimited = function encodeDelimited(message, writer) { + CreateUserListRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WarningInfo message from the specified reader or buffer. + * Decodes a CreateUserListRequest message from the specified reader or buffer. * @function decode - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + * @returns {google.ads.datamanager.v1.CreateUserListRequest} CreateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WarningInfo.decode = function decode(reader, length, error) { + CreateUserListRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.WarningInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.CreateUserListRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.warningCounts && message.warningCounts.length)) - message.warningCounts = []; - message.warningCounts.push($root.google.ads.datamanager.v1.WarningCount.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + } + case 2: { + message.userList = $root.google.ads.datamanager.v1.UserList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -13267,140 +29602,146 @@ }; /** - * Decodes a WarningInfo message from the specified reader or buffer, length delimited. + * Decodes a CreateUserListRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + * @returns {google.ads.datamanager.v1.CreateUserListRequest} CreateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WarningInfo.decodeDelimited = function decodeDelimited(reader) { + CreateUserListRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WarningInfo message. + * Verifies a CreateUserListRequest message. * @function verify - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WarningInfo.verify = function verify(message) { + CreateUserListRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.warningCounts != null && message.hasOwnProperty("warningCounts")) { - if (!Array.isArray(message.warningCounts)) - return "warningCounts: array expected"; - for (var i = 0; i < message.warningCounts.length; ++i) { - var error = $root.google.ads.datamanager.v1.WarningCount.verify(message.warningCounts[i]); - if (error) - return "warningCounts." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userList != null && message.hasOwnProperty("userList")) { + var error = $root.google.ads.datamanager.v1.UserList.verify(message.userList); + if (error) + return "userList." + error; } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a WarningInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserListRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static * @param {Object.} object Plain object - * @returns {google.ads.datamanager.v1.WarningInfo} WarningInfo + * @returns {google.ads.datamanager.v1.CreateUserListRequest} CreateUserListRequest */ - WarningInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.ads.datamanager.v1.WarningInfo) + CreateUserListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.CreateUserListRequest) return object; - var message = new $root.google.ads.datamanager.v1.WarningInfo(); - if (object.warningCounts) { - if (!Array.isArray(object.warningCounts)) - throw TypeError(".google.ads.datamanager.v1.WarningInfo.warningCounts: array expected"); - message.warningCounts = []; - for (var i = 0; i < object.warningCounts.length; ++i) { - if (typeof object.warningCounts[i] !== "object") - throw TypeError(".google.ads.datamanager.v1.WarningInfo.warningCounts: object expected"); - message.warningCounts[i] = $root.google.ads.datamanager.v1.WarningCount.fromObject(object.warningCounts[i]); - } + var message = new $root.google.ads.datamanager.v1.CreateUserListRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userList != null) { + if (typeof object.userList !== "object") + throw TypeError(".google.ads.datamanager.v1.CreateUserListRequest.userList: object expected"); + message.userList = $root.google.ads.datamanager.v1.UserList.fromObject(object.userList); } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a WarningInfo message. Also converts values to other types if specified. + * Creates a plain object from a CreateUserListRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static - * @param {google.ads.datamanager.v1.WarningInfo} message WarningInfo + * @param {google.ads.datamanager.v1.CreateUserListRequest} message CreateUserListRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WarningInfo.toObject = function toObject(message, options) { + CreateUserListRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.warningCounts = []; - if (message.warningCounts && message.warningCounts.length) { - object.warningCounts = []; - for (var j = 0; j < message.warningCounts.length; ++j) - object.warningCounts[j] = $root.google.ads.datamanager.v1.WarningCount.toObject(message.warningCounts[j], options); + if (options.defaults) { + object.parent = ""; + object.userList = null; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userList != null && message.hasOwnProperty("userList")) + object.userList = $root.google.ads.datamanager.v1.UserList.toObject(message.userList, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this WarningInfo to JSON. + * Converts this CreateUserListRequest to JSON. * @function toJSON - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @instance * @returns {Object.} JSON object */ - WarningInfo.prototype.toJSON = function toJSON() { + CreateUserListRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WarningInfo + * Gets the default type url for CreateUserListRequest * @function getTypeUrl - * @memberof google.ads.datamanager.v1.WarningInfo + * @memberof google.ads.datamanager.v1.CreateUserListRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WarningInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateUserListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ads.datamanager.v1.WarningInfo"; + return typeUrlPrefix + "/google.ads.datamanager.v1.CreateUserListRequest"; }; - return WarningInfo; + return CreateUserListRequest; })(); - v1.WarningCount = (function() { + v1.UpdateUserListRequest = (function() { /** - * Properties of a WarningCount. + * Properties of an UpdateUserListRequest. * @memberof google.ads.datamanager.v1 - * @interface IWarningCount - * @property {number|Long|null} [recordCount] WarningCount recordCount - * @property {google.ads.datamanager.v1.ProcessingWarningReason|null} [reason] WarningCount reason + * @interface IUpdateUserListRequest + * @property {google.ads.datamanager.v1.IUserList|null} [userList] UpdateUserListRequest userList + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserListRequest updateMask + * @property {boolean|null} [validateOnly] UpdateUserListRequest validateOnly */ /** - * Constructs a new WarningCount. + * Constructs a new UpdateUserListRequest. * @memberof google.ads.datamanager.v1 - * @classdesc Represents a WarningCount. - * @implements IWarningCount + * @classdesc Represents an UpdateUserListRequest. + * @implements IUpdateUserListRequest * @constructor - * @param {google.ads.datamanager.v1.IWarningCount=} [properties] Properties to set + * @param {google.ads.datamanager.v1.IUpdateUserListRequest=} [properties] Properties to set */ - function WarningCount(properties) { + function UpdateUserListRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13408,91 +29749,105 @@ } /** - * WarningCount recordCount. - * @member {number|Long} recordCount - * @memberof google.ads.datamanager.v1.WarningCount + * UpdateUserListRequest userList. + * @member {google.ads.datamanager.v1.IUserList|null|undefined} userList + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @instance */ - WarningCount.prototype.recordCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateUserListRequest.prototype.userList = null; /** - * WarningCount reason. - * @member {google.ads.datamanager.v1.ProcessingWarningReason} reason - * @memberof google.ads.datamanager.v1.WarningCount + * UpdateUserListRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @instance */ - WarningCount.prototype.reason = 0; + UpdateUserListRequest.prototype.updateMask = null; /** - * Creates a new WarningCount instance using the specified properties. + * UpdateUserListRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.ads.datamanager.v1.UpdateUserListRequest + * @instance + */ + UpdateUserListRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateUserListRequest instance using the specified properties. * @function create - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningCount=} [properties] Properties to set - * @returns {google.ads.datamanager.v1.WarningCount} WarningCount instance + * @param {google.ads.datamanager.v1.IUpdateUserListRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.UpdateUserListRequest} UpdateUserListRequest instance */ - WarningCount.create = function create(properties) { - return new WarningCount(properties); + UpdateUserListRequest.create = function create(properties) { + return new UpdateUserListRequest(properties); }; /** - * Encodes the specified WarningCount message. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * Encodes the specified UpdateUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListRequest.verify|verify} messages. * @function encode - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningCount} message WarningCount message or plain object to encode + * @param {google.ads.datamanager.v1.IUpdateUserListRequest} message UpdateUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WarningCount.encode = function encode(message, writer) { + UpdateUserListRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.recordCount); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + if (message.userList != null && Object.hasOwnProperty.call(message, "userList")) + $root.google.ads.datamanager.v1.UserList.encode(message.userList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified WarningCount message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.WarningCount.verify|verify} messages. + * Encodes the specified UpdateUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.UpdateUserListRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static - * @param {google.ads.datamanager.v1.IWarningCount} message WarningCount message or plain object to encode + * @param {google.ads.datamanager.v1.IUpdateUserListRequest} message UpdateUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WarningCount.encodeDelimited = function encodeDelimited(message, writer) { + UpdateUserListRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WarningCount message from the specified reader or buffer. + * Decodes an UpdateUserListRequest message from the specified reader or buffer. * @function decode - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + * @returns {google.ads.datamanager.v1.UpdateUserListRequest} UpdateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WarningCount.decode = function decode(reader, length, error) { + UpdateUserListRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.WarningCount(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.UpdateUserListRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.recordCount = reader.int64(); + message.userList = $root.google.ads.datamanager.v1.UserList.decode(reader, reader.uint32()); break; } case 2: { - message.reason = reader.int32(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -13504,300 +29859,150 @@ }; /** - * Decodes a WarningCount message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserListRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + * @returns {google.ads.datamanager.v1.UpdateUserListRequest} UpdateUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WarningCount.decodeDelimited = function decodeDelimited(reader) { + UpdateUserListRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WarningCount message. + * Verifies an UpdateUserListRequest message. * @function verify - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WarningCount.verify = function verify(message) { + UpdateUserListRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) - return "recordCount: integer|Long expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } + if (message.userList != null && message.hasOwnProperty("userList")) { + var error = $root.google.ads.datamanager.v1.UserList.verify(message.userList); + if (error) + return "userList." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a WarningCount message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserListRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static * @param {Object.} object Plain object - * @returns {google.ads.datamanager.v1.WarningCount} WarningCount + * @returns {google.ads.datamanager.v1.UpdateUserListRequest} UpdateUserListRequest */ - WarningCount.fromObject = function fromObject(object) { - if (object instanceof $root.google.ads.datamanager.v1.WarningCount) + UpdateUserListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.UpdateUserListRequest) return object; - var message = new $root.google.ads.datamanager.v1.WarningCount(); - if (object.recordCount != null) - if ($util.Long) - (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; - else if (typeof object.recordCount === "string") - message.recordCount = parseInt(object.recordCount, 10); - else if (typeof object.recordCount === "number") - message.recordCount = object.recordCount; - else if (typeof object.recordCount === "object") - message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "PROCESSING_WARNING_REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED": - case 1: - message.reason = 1; - break; - case "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR": - case 2: - message.reason = 2; - break; - case "PROCESSING_WARNING_REASON_DECRYPTION_ERROR": - case 3: - message.reason = 3; - break; - case "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED": - case 4: - message.reason = 4; - break; - case "PROCESSING_WARNING_REASON_INVALID_WIP": - case 5: - message.reason = 5; - break; - case "PROCESSING_WARNING_REASON_INVALID_KEK": - case 6: - message.reason = 6; - break; - case "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": - case 7: - message.reason = 7; - break; - case "PROCESSING_WARNING_REASON_INTERNAL_ERROR": - case 8: - message.reason = 8; - break; - case "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED": - case 9: - message.reason = 9; - break; + var message = new $root.google.ads.datamanager.v1.UpdateUserListRequest(); + if (object.userList != null) { + if (typeof object.userList !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListRequest.userList: object expected"); + message.userList = $root.google.ads.datamanager.v1.UserList.fromObject(object.userList); } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ads.datamanager.v1.UpdateUserListRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a WarningCount message. Also converts values to other types if specified. + * Creates a plain object from an UpdateUserListRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static - * @param {google.ads.datamanager.v1.WarningCount} message WarningCount + * @param {google.ads.datamanager.v1.UpdateUserListRequest} message UpdateUserListRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WarningCount.toObject = function toObject(message, options) { + UpdateUserListRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.recordCount = options.longs === String ? "0" : 0; - object.reason = options.enums === String ? "PROCESSING_WARNING_REASON_UNSPECIFIED" : 0; + object.userList = null; + object.updateMask = null; + object.validateOnly = false; } - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (typeof message.recordCount === "number") - object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; - else - object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.ads.datamanager.v1.ProcessingWarningReason[message.reason] === undefined ? message.reason : $root.google.ads.datamanager.v1.ProcessingWarningReason[message.reason] : message.reason; + if (message.userList != null && message.hasOwnProperty("userList")) + object.userList = $root.google.ads.datamanager.v1.UserList.toObject(message.userList, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this WarningCount to JSON. + * Converts this UpdateUserListRequest to JSON. * @function toJSON - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @instance * @returns {Object.} JSON object */ - WarningCount.prototype.toJSON = function toJSON() { + UpdateUserListRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WarningCount + * Gets the default type url for UpdateUserListRequest * @function getTypeUrl - * @memberof google.ads.datamanager.v1.WarningCount + * @memberof google.ads.datamanager.v1.UpdateUserListRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WarningCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateUserListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ads.datamanager.v1.WarningCount"; + return typeUrlPrefix + "/google.ads.datamanager.v1.UpdateUserListRequest"; }; - return WarningCount; - })(); - - /** - * ProcessingErrorReason enum. - * @name google.ads.datamanager.v1.ProcessingErrorReason - * @enum {number} - * @property {number} PROCESSING_ERROR_REASON_UNSPECIFIED=0 PROCESSING_ERROR_REASON_UNSPECIFIED value - * @property {number} PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE=1 PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE value - * @property {number} PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED=2 PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED value - * @property {number} PROCESSING_ERROR_REASON_EVENT_TOO_OLD=3 PROCESSING_ERROR_REASON_EVENT_TOO_OLD value - * @property {number} PROCESSING_ERROR_REASON_DENIED_CONSENT=4 PROCESSING_ERROR_REASON_DENIED_CONSENT value - * @property {number} PROCESSING_ERROR_REASON_NO_CONSENT=5 PROCESSING_ERROR_REASON_NO_CONSENT value - * @property {number} PROCESSING_ERROR_REASON_UNKNOWN_CONSENT=6 PROCESSING_ERROR_REASON_UNKNOWN_CONSENT value - * @property {number} PROCESSING_ERROR_REASON_DUPLICATE_GCLID=7 PROCESSING_ERROR_REASON_DUPLICATE_GCLID value - * @property {number} PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID=8 PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID value - * @property {number} PROCESSING_ERROR_REASON_INVALID_GBRAID=9 PROCESSING_ERROR_REASON_INVALID_GBRAID value - * @property {number} PROCESSING_ERROR_REASON_INVALID_GCLID=10 PROCESSING_ERROR_REASON_INVALID_GCLID value - * @property {number} PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID=11 PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID value - * @property {number} PROCESSING_ERROR_REASON_INVALID_WBRAID=12 PROCESSING_ERROR_REASON_INVALID_WBRAID value - * @property {number} PROCESSING_ERROR_REASON_INTERNAL_ERROR=13 PROCESSING_ERROR_REASON_INTERNAL_ERROR value - * @property {number} PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED=14 PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED value - * @property {number} PROCESSING_ERROR_REASON_INVALID_EVENT=15 PROCESSING_ERROR_REASON_INVALID_EVENT value - * @property {number} PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS=16 PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS value - * @property {number} PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS=17 PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS value - * @property {number} PROCESSING_ERROR_REASON_INVALID_FORMAT=18 PROCESSING_ERROR_REASON_INVALID_FORMAT value - * @property {number} PROCESSING_ERROR_REASON_DECRYPTION_ERROR=19 PROCESSING_ERROR_REASON_DECRYPTION_ERROR value - * @property {number} PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR=20 PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR value - * @property {number} PROCESSING_ERROR_REASON_INVALID_WIP=21 PROCESSING_ERROR_REASON_INVALID_WIP value - * @property {number} PROCESSING_ERROR_REASON_INVALID_KEK=22 PROCESSING_ERROR_REASON_INVALID_KEK value - * @property {number} PROCESSING_ERROR_REASON_WIP_AUTH_FAILED=23 PROCESSING_ERROR_REASON_WIP_AUTH_FAILED value - * @property {number} PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED=24 PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED value - * @property {number} PROCESSING_ERROR_REASON_AWS_AUTH_FAILED=27 PROCESSING_ERROR_REASON_AWS_AUTH_FAILED value - * @property {number} PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR=25 PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR value - * @property {number} PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER=26 PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER value - */ - v1.ProcessingErrorReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROCESSING_ERROR_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE"] = 1; - values[valuesById[2] = "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED"] = 2; - values[valuesById[3] = "PROCESSING_ERROR_REASON_EVENT_TOO_OLD"] = 3; - values[valuesById[4] = "PROCESSING_ERROR_REASON_DENIED_CONSENT"] = 4; - values[valuesById[5] = "PROCESSING_ERROR_REASON_NO_CONSENT"] = 5; - values[valuesById[6] = "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT"] = 6; - values[valuesById[7] = "PROCESSING_ERROR_REASON_DUPLICATE_GCLID"] = 7; - values[valuesById[8] = "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID"] = 8; - values[valuesById[9] = "PROCESSING_ERROR_REASON_INVALID_GBRAID"] = 9; - values[valuesById[10] = "PROCESSING_ERROR_REASON_INVALID_GCLID"] = 10; - values[valuesById[11] = "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID"] = 11; - values[valuesById[12] = "PROCESSING_ERROR_REASON_INVALID_WBRAID"] = 12; - values[valuesById[13] = "PROCESSING_ERROR_REASON_INTERNAL_ERROR"] = 13; - values[valuesById[14] = "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED"] = 14; - values[valuesById[15] = "PROCESSING_ERROR_REASON_INVALID_EVENT"] = 15; - values[valuesById[16] = "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS"] = 16; - values[valuesById[17] = "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS"] = 17; - values[valuesById[18] = "PROCESSING_ERROR_REASON_INVALID_FORMAT"] = 18; - values[valuesById[19] = "PROCESSING_ERROR_REASON_DECRYPTION_ERROR"] = 19; - values[valuesById[20] = "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR"] = 20; - values[valuesById[21] = "PROCESSING_ERROR_REASON_INVALID_WIP"] = 21; - values[valuesById[22] = "PROCESSING_ERROR_REASON_INVALID_KEK"] = 22; - values[valuesById[23] = "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED"] = 23; - values[valuesById[24] = "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED"] = 24; - values[valuesById[27] = "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED"] = 27; - values[valuesById[25] = "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR"] = 25; - values[valuesById[26] = "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER"] = 26; - return values; - })(); - - /** - * ProcessingWarningReason enum. - * @name google.ads.datamanager.v1.ProcessingWarningReason - * @enum {number} - * @property {number} PROCESSING_WARNING_REASON_UNSPECIFIED=0 PROCESSING_WARNING_REASON_UNSPECIFIED value - * @property {number} PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED=1 PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED value - * @property {number} PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR=2 PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR value - * @property {number} PROCESSING_WARNING_REASON_DECRYPTION_ERROR=3 PROCESSING_WARNING_REASON_DECRYPTION_ERROR value - * @property {number} PROCESSING_WARNING_REASON_WIP_AUTH_FAILED=4 PROCESSING_WARNING_REASON_WIP_AUTH_FAILED value - * @property {number} PROCESSING_WARNING_REASON_INVALID_WIP=5 PROCESSING_WARNING_REASON_INVALID_WIP value - * @property {number} PROCESSING_WARNING_REASON_INVALID_KEK=6 PROCESSING_WARNING_REASON_INVALID_KEK value - * @property {number} PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR=7 PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR value - * @property {number} PROCESSING_WARNING_REASON_INTERNAL_ERROR=8 PROCESSING_WARNING_REASON_INTERNAL_ERROR value - * @property {number} PROCESSING_WARNING_REASON_AWS_AUTH_FAILED=9 PROCESSING_WARNING_REASON_AWS_AUTH_FAILED value - */ - v1.ProcessingWarningReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROCESSING_WARNING_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED"] = 1; - values[valuesById[2] = "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR"] = 2; - values[valuesById[3] = "PROCESSING_WARNING_REASON_DECRYPTION_ERROR"] = 3; - values[valuesById[4] = "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED"] = 4; - values[valuesById[5] = "PROCESSING_WARNING_REASON_INVALID_WIP"] = 5; - values[valuesById[6] = "PROCESSING_WARNING_REASON_INVALID_KEK"] = 6; - values[valuesById[7] = "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR"] = 7; - values[valuesById[8] = "PROCESSING_WARNING_REASON_INTERNAL_ERROR"] = 8; - values[valuesById[9] = "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED"] = 9; - return values; + return UpdateUserListRequest; })(); - v1.TermsOfService = (function() { + v1.DeleteUserListRequest = (function() { /** - * Properties of a TermsOfService. + * Properties of a DeleteUserListRequest. * @memberof google.ads.datamanager.v1 - * @interface ITermsOfService - * @property {google.ads.datamanager.v1.TermsOfServiceStatus|null} [customerMatchTermsOfServiceStatus] TermsOfService customerMatchTermsOfServiceStatus + * @interface IDeleteUserListRequest + * @property {string|null} [name] DeleteUserListRequest name + * @property {boolean|null} [validateOnly] DeleteUserListRequest validateOnly */ /** - * Constructs a new TermsOfService. + * Constructs a new DeleteUserListRequest. * @memberof google.ads.datamanager.v1 - * @classdesc Represents a TermsOfService. - * @implements ITermsOfService + * @classdesc Represents a DeleteUserListRequest. + * @implements IDeleteUserListRequest * @constructor - * @param {google.ads.datamanager.v1.ITermsOfService=} [properties] Properties to set + * @param {google.ads.datamanager.v1.IDeleteUserListRequest=} [properties] Properties to set */ - function TermsOfService(properties) { + function DeleteUserListRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13805,77 +30010,91 @@ } /** - * TermsOfService customerMatchTermsOfServiceStatus. - * @member {google.ads.datamanager.v1.TermsOfServiceStatus} customerMatchTermsOfServiceStatus - * @memberof google.ads.datamanager.v1.TermsOfService + * DeleteUserListRequest name. + * @member {string} name + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @instance */ - TermsOfService.prototype.customerMatchTermsOfServiceStatus = 0; + DeleteUserListRequest.prototype.name = ""; /** - * Creates a new TermsOfService instance using the specified properties. + * DeleteUserListRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.ads.datamanager.v1.DeleteUserListRequest + * @instance + */ + DeleteUserListRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteUserListRequest instance using the specified properties. * @function create - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static - * @param {google.ads.datamanager.v1.ITermsOfService=} [properties] Properties to set - * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService instance + * @param {google.ads.datamanager.v1.IDeleteUserListRequest=} [properties] Properties to set + * @returns {google.ads.datamanager.v1.DeleteUserListRequest} DeleteUserListRequest instance */ - TermsOfService.create = function create(properties) { - return new TermsOfService(properties); + DeleteUserListRequest.create = function create(properties) { + return new DeleteUserListRequest(properties); }; /** - * Encodes the specified TermsOfService message. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * Encodes the specified DeleteUserListRequest message. Does not implicitly {@link google.ads.datamanager.v1.DeleteUserListRequest.verify|verify} messages. * @function encode - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static - * @param {google.ads.datamanager.v1.ITermsOfService} message TermsOfService message or plain object to encode + * @param {google.ads.datamanager.v1.IDeleteUserListRequest} message DeleteUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TermsOfService.encode = function encode(message, writer) { + DeleteUserListRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.customerMatchTermsOfServiceStatus != null && Object.hasOwnProperty.call(message, "customerMatchTermsOfServiceStatus")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customerMatchTermsOfServiceStatus); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); return writer; }; /** - * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.TermsOfService.verify|verify} messages. + * Encodes the specified DeleteUserListRequest message, length delimited. Does not implicitly {@link google.ads.datamanager.v1.DeleteUserListRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static - * @param {google.ads.datamanager.v1.ITermsOfService} message TermsOfService message or plain object to encode + * @param {google.ads.datamanager.v1.IDeleteUserListRequest} message DeleteUserListRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TermsOfService.encodeDelimited = function encodeDelimited(message, writer) { + DeleteUserListRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TermsOfService message from the specified reader or buffer. + * Decodes a DeleteUserListRequest message from the specified reader or buffer. * @function decode - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + * @returns {google.ads.datamanager.v1.DeleteUserListRequest} DeleteUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TermsOfService.decode = function decode(reader, length, error) { + DeleteUserListRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.TermsOfService(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ads.datamanager.v1.DeleteUserListRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.customerMatchTermsOfServiceStatus = reader.int32(); + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); break; } default: @@ -13887,142 +30106,111 @@ }; /** - * Decodes a TermsOfService message from the specified reader or buffer, length delimited. + * Decodes a DeleteUserListRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + * @returns {google.ads.datamanager.v1.DeleteUserListRequest} DeleteUserListRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TermsOfService.decodeDelimited = function decodeDelimited(reader) { + DeleteUserListRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TermsOfService message. + * Verifies a DeleteUserListRequest message. * @function verify - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TermsOfService.verify = function verify(message) { + DeleteUserListRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.customerMatchTermsOfServiceStatus != null && message.hasOwnProperty("customerMatchTermsOfServiceStatus")) - switch (message.customerMatchTermsOfServiceStatus) { - default: - return "customerMatchTermsOfServiceStatus: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteUserListRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static * @param {Object.} object Plain object - * @returns {google.ads.datamanager.v1.TermsOfService} TermsOfService + * @returns {google.ads.datamanager.v1.DeleteUserListRequest} DeleteUserListRequest */ - TermsOfService.fromObject = function fromObject(object) { - if (object instanceof $root.google.ads.datamanager.v1.TermsOfService) + DeleteUserListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ads.datamanager.v1.DeleteUserListRequest) return object; - var message = new $root.google.ads.datamanager.v1.TermsOfService(); - switch (object.customerMatchTermsOfServiceStatus) { - default: - if (typeof object.customerMatchTermsOfServiceStatus === "number") { - message.customerMatchTermsOfServiceStatus = object.customerMatchTermsOfServiceStatus; - break; - } - break; - case "TERMS_OF_SERVICE_STATUS_UNSPECIFIED": - case 0: - message.customerMatchTermsOfServiceStatus = 0; - break; - case "ACCEPTED": - case 1: - message.customerMatchTermsOfServiceStatus = 1; - break; - case "REJECTED": - case 2: - message.customerMatchTermsOfServiceStatus = 2; - break; - } + var message = new $root.google.ads.datamanager.v1.DeleteUserListRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. + * Creates a plain object from a DeleteUserListRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static - * @param {google.ads.datamanager.v1.TermsOfService} message TermsOfService + * @param {google.ads.datamanager.v1.DeleteUserListRequest} message DeleteUserListRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TermsOfService.toObject = function toObject(message, options) { + DeleteUserListRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.customerMatchTermsOfServiceStatus = options.enums === String ? "TERMS_OF_SERVICE_STATUS_UNSPECIFIED" : 0; - if (message.customerMatchTermsOfServiceStatus != null && message.hasOwnProperty("customerMatchTermsOfServiceStatus")) - object.customerMatchTermsOfServiceStatus = options.enums === String ? $root.google.ads.datamanager.v1.TermsOfServiceStatus[message.customerMatchTermsOfServiceStatus] === undefined ? message.customerMatchTermsOfServiceStatus : $root.google.ads.datamanager.v1.TermsOfServiceStatus[message.customerMatchTermsOfServiceStatus] : message.customerMatchTermsOfServiceStatus; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this TermsOfService to JSON. + * Converts this DeleteUserListRequest to JSON. * @function toJSON - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @instance * @returns {Object.} JSON object */ - TermsOfService.prototype.toJSON = function toJSON() { + DeleteUserListRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TermsOfService + * Gets the default type url for DeleteUserListRequest * @function getTypeUrl - * @memberof google.ads.datamanager.v1.TermsOfService + * @memberof google.ads.datamanager.v1.DeleteUserListRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteUserListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ads.datamanager.v1.TermsOfService"; + return typeUrlPrefix + "/google.ads.datamanager.v1.DeleteUserListRequest"; }; - return TermsOfService; - })(); - - /** - * TermsOfServiceStatus enum. - * @name google.ads.datamanager.v1.TermsOfServiceStatus - * @enum {number} - * @property {number} TERMS_OF_SERVICE_STATUS_UNSPECIFIED=0 TERMS_OF_SERVICE_STATUS_UNSPECIFIED value - * @property {number} ACCEPTED=1 ACCEPTED value - * @property {number} REJECTED=2 REJECTED value - */ - v1.TermsOfServiceStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TERMS_OF_SERVICE_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACCEPTED"] = 1; - values[valuesById[2] = "REJECTED"] = 2; - return values; + return DeleteUserListRequest; })(); return v1; @@ -14071,6 +30259,694 @@ return values; })(); + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + api.Http = (function() { /** @@ -24053,6 +40929,7 @@ * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** @@ -24065,6 +40942,7 @@ */ function FileOptions(properties) { this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24239,6 +41117,14 @@ */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** * Creates a new FileOptions instance using the specified properties. * @function create @@ -24306,6 +41192,9 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -24428,6 +41317,12 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -24540,6 +41435,15 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } return null; }; @@ -24626,6 +41530,16 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } return message; }; @@ -24642,8 +41556,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -24711,6 +41627,11 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } return object; }; @@ -24772,6 +41693,7 @@ * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** @@ -24846,6 +41768,14 @@ */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + /** * Creates a new MessageOptions instance using the specified properties. * @function create @@ -24885,6 +41815,8 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -24951,6 +41883,10 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25015,6 +41951,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } return null; }; @@ -25055,6 +41996,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } return message; }; @@ -25080,6 +42026,7 @@ object.mapEntry = false; object.deprecatedLegacyJsonFieldConflicts = false; object.features = null; + object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; @@ -25098,6 +42045,8 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; @@ -25150,6 +42099,7 @@ * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -25283,6 +42233,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -25339,6 +42297,8 @@ if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -25449,6 +42409,10 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25591,6 +42555,11 @@ break; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } return null; }; @@ -25805,6 +42774,11 @@ break; } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } return message; }; @@ -25838,6 +42812,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -25879,6 +42854,8 @@ for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; @@ -31487,6 +48464,404 @@ return Duration; })(); + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + return protobuf; })(); diff --git a/packages/google-ads-datamanager/protos/protos.json b/packages/google-ads-datamanager/protos/protos.json index ffb98553750..2fefbf18e39 100644 --- a/packages/google-ads-datamanager/protos/protos.json +++ b/packages/google-ads-datamanager/protos/protos.json @@ -11,19 +11,35 @@ "csharp_namespace": "Google.Ads.DataManager.V1", "go_package": "cloud.google.com/go/datamanager/apiv1/datamanagerpb;datamanagerpb", "java_multiple_files": true, - "java_outer_classname": "TermsOfServiceProto", + "java_outer_classname": "UserListServiceProto", "java_package": "com.google.ads.datamanager.v1", "php_namespace": "Google\\Ads\\DataManager\\V1", - "ruby_package": "Google::Ads::DataManager::V1" + "ruby_package": "Google::Ads::DataManager::V1", + "(google.api.resource_definition).type": "datamanager.googleapis.com/Account", + "(google.api.resource_definition).pattern": "accountTypes/{account_type}/accounts/{account}" }, "nested": { + "AgeRange": { + "values": { + "AGE_RANGE_UNSPECIFIED": 0, + "AGE_RANGE_UNKNOWN": 1, + "AGE_RANGE_18_24": 2, + "AGE_RANGE_25_34": 3, + "AGE_RANGE_35_44": 4, + "AGE_RANGE_45_54": 5, + "AGE_RANGE_55_64": 6, + "AGE_RANGE_65_UP": 7 + } + }, "AudienceMember": { "oneofs": { "data": { "oneof": [ "userData", "pairData", - "mobileData" + "mobileData", + "userIdData", + "ppidData" ] } }, @@ -48,6 +64,14 @@ "type": "MobileData", "id": 5 }, + "userIdData": { + "type": "UserIdData", + "id": 6 + }, + "ppidData": { + "type": "PpidData", + "id": 7 + }, "consent": { "type": "Consent", "id": 3, @@ -81,6 +105,29 @@ } } }, + "UserIdData": { + "fields": { + "userId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PpidData": { + "fields": { + "ppids": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "Consent": { "fields": { "adUserData": { @@ -344,7 +391,8 @@ "DISPLAY_VIDEO_PARTNER": 2, "DISPLAY_VIDEO_ADVERTISER": 3, "DATA_PARTNER": 4, - "GOOGLE_ANALYTICS_PROPERTY": 5 + "GOOGLE_ANALYTICS_PROPERTY": 5, + "GOOGLE_AD_MANAGER_AUDIENCE_LINK": 6 } } } @@ -532,10 +580,64 @@ "INVALID_REQUEST_ID": 48, "MULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT": 49, "FIELD_VALUE_TOO_LONG": 50, - "TOO_MANY_ELEMENTS": 51 + "TOO_MANY_ELEMENTS": 51, + "ALREADY_EXISTS": 52, + "IMMUTABLE_FIELD_FOR_UPDATE": 53, + "INVALID_RESOURCE_NAME": 54, + "INVALID_FILTER": 55, + "INVALID_UPDATE_MASK": 56, + "INVALID_PAGE_TOKEN": 57, + "CANNOT_UPDATE_DISABLED_LICENSE": 58, + "CANNOT_CREATE_LICENSE_FOR_SENSITIVE_USERLIST": 59, + "INSUFFICIENT_COST": 60, + "CANNOT_DISABLE_LICENSE": 61, + "INVALID_CLIENT_ACCOUNT_ID": 62, + "PRICING_ONLY_ZERO_COST_ALLOWED": 63, + "PRICE_TOO_HIGH": 64, + "CUSTOMER_NOT_ALLOWED_TO_CREATE_LICENSE": 65, + "INVALID_PRICING_END_DATE": 66, + "CANNOT_LICENSE_LOGICAL_LIST_WITH_LICENSED_OR_SHARED_SEGMENT": 67, + "MISMATCHED_ACCOUNT_TYPE": 68, + "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_LICENSE_TYPE": 69, + "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_CLIENT_CUSTOMER": 70, + "INVALID_MEDIA_SHARE_COST": 71, + "INVALID_COST_TYPE": 72, + "MEDIA_SHARE_COST_NOT_ALLOWED_FOR_NON_COMMERCE_USER_LIST": 73, + "MAX_COST_NOT_ALLOWED": 74, + "COMMERCE_AUDIENCE_CAN_ONLY_BE_DIRECTLY_LICENSED": 75, + "INVALID_DESCRIPTION": 76, + "INVALID_DISPLAY_NAME": 77, + "DISPLAY_NAME_ALREADY_USED": 78, + "OWNERSHIP_REQUIRED_FOR_UPDATE": 79, + "USER_LIST_MUTATION_NOT_SUPPORTED": 80, + "SENSITIVE_USER_LIST_IMMUTABLE": 81, + "BILLABLE_RECORD_COUNT_IMMUTABLE": 82, + "USER_LIST_NAME_RESERVED": 83, + "ADVERTISER_NOT_ALLOWLISTED_FOR_UPLOADED_DATA": 84, + "UNSUPPORTED_PARTNER_AUDIENCE_SOURCE": 85, + "COMMERCE_PARTNER_NOT_ALLOWED": 86, + "UNSUPPORTED_PARTNER_AUDIENCE_INFO": 87, + "PARTNER_MATCH_FOR_MANAGER_ACCOUNT_DISALLOWED": 88, + "DATA_PARTNER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA": 89, + "ADVERTISER_TOS_NOT_ACCEPTED": 90, + "ADVERTISER_NOT_ALLOWLISTED_FOR_THIRD_PARTY_PARTNER_DATA": 91, + "USER_LIST_TYPE_NOT_SUPPORTED_FOR_ACCOUNT": 92, + "INVALID_COMMERCE_PARTNER": 93, + "CUSTOMER_NOT_ALLOWLISTED_FOR_COMMERCE_AUDIENCE": 94, + "UNSUPPORTED_USER_LIST_UPLOAD_KEY_TYPES": 95, + "UNSUPPORTED_INGESTED_USER_LIST_INFO_CONFIG": 96, + "UNSUPPORTED_ACCOUNT_TYPES_FOR_USER_LIST_TYPE": 97, + "UNSUPPORTED_ACCOUNT_TYPE_FOR_PARTNER_LINK": 98 } }, "Event": { + "oneofs": { + "_conversionValue": { + "oneof": [ + "conversionValue" + ] + } + }, "fields": { "destinationReferences": { "rule": "repeated", @@ -598,7 +700,8 @@ "type": "double", "id": 9, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, "eventSource": { @@ -847,6 +950,14 @@ "HIGH": 3 } }, + "Gender": { + "values": { + "GENDER_UNSPECIFIED": 0, + "GENDER_UNKNOWN": 1, + "GENDER_MALE": 2, + "GENDER_FEMALE": 3 + } + }, "IngestionService": { "options": { "(google.api.default_host)": "datamanager.googleapis.com", @@ -1168,7 +1279,9 @@ "oneof": [ "userDataIngestionStatus", "mobileDataIngestionStatus", - "pairDataIngestionStatus" + "pairDataIngestionStatus", + "userIdDataIngestionStatus", + "ppidDataIngestionStatus" ] } }, @@ -1184,6 +1297,14 @@ "pairDataIngestionStatus": { "type": "IngestPairDataStatus", "id": 3 + }, + "userIdDataIngestionStatus": { + "type": "IngestUserIdDataStatus", + "id": 4 + }, + "ppidDataIngestionStatus": { + "type": "IngestPpidDataStatus", + "id": 5 } } }, @@ -1193,7 +1314,9 @@ "oneof": [ "userDataRemovalStatus", "mobileDataRemovalStatus", - "pairDataRemovalStatus" + "pairDataRemovalStatus", + "userIdDataRemovalStatus", + "ppidDataRemovalStatus" ] } }, @@ -1209,6 +1332,14 @@ "pairDataRemovalStatus": { "type": "RemovePairDataStatus", "id": 3 + }, + "userIdDataRemovalStatus": { + "type": "RemoveUserIdDataStatus", + "id": 4 + }, + "ppidDataRemovalStatus": { + "type": "RemovePpidDataStatus", + "id": 5 } } }, @@ -1266,157 +1397,2200 @@ "type": "int64", "id": 1 }, - "mobileIdCount": { - "type": "int64", - "id": 2 + "mobileIdCount": { + "type": "int64", + "id": 2 + } + } + }, + "IngestPairDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "pairIdCount": { + "type": "int64", + "id": 2 + } + } + }, + "RemovePairDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "pairIdCount": { + "type": "int64", + "id": 2 + } + } + }, + "IngestUserIdDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "userIdCount": { + "type": "int64", + "id": 2 + } + } + }, + "RemoveUserIdDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "userIdCount": { + "type": "int64", + "id": 2 + } + } + }, + "IngestPpidDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "ppidCount": { + "type": "int64", + "id": 2 + } + } + }, + "RemovePpidDataStatus": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "ppidCount": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "MatchRateRange": { + "values": { + "MATCH_RATE_RANGE_UNKNOWN": 0, + "MATCH_RATE_RANGE_NOT_ELIGIBLE": 1, + "MATCH_RATE_RANGE_LESS_THAN_20": 2, + "MATCH_RATE_RANGE_20_TO_30": 3, + "MATCH_RATE_RANGE_31_TO_40": 4, + "MATCH_RATE_RANGE_41_TO_50": 5, + "MATCH_RATE_RANGE_51_TO_60": 6, + "MATCH_RATE_RANGE_61_TO_70": 7, + "MATCH_RATE_RANGE_71_TO_80": 8, + "MATCH_RATE_RANGE_81_TO_90": 9, + "MATCH_RATE_RANGE_91_TO_100": 10 + } + }, + "ErrorInfo": { + "fields": { + "errorCounts": { + "rule": "repeated", + "type": "ErrorCount", + "id": 1 + } + } + }, + "ErrorCount": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "reason": { + "type": "ProcessingErrorReason", + "id": 2 + } + } + }, + "WarningInfo": { + "fields": { + "warningCounts": { + "rule": "repeated", + "type": "WarningCount", + "id": 1 + } + } + }, + "WarningCount": { + "fields": { + "recordCount": { + "type": "int64", + "id": 1 + }, + "reason": { + "type": "ProcessingWarningReason", + "id": 2 + } + } + }, + "ProcessingErrorReason": { + "values": { + "PROCESSING_ERROR_REASON_UNSPECIFIED": 0, + "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE": 1, + "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED": 2, + "PROCESSING_ERROR_REASON_EVENT_TOO_OLD": 3, + "PROCESSING_ERROR_REASON_DENIED_CONSENT": 4, + "PROCESSING_ERROR_REASON_NO_CONSENT": 5, + "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT": 6, + "PROCESSING_ERROR_REASON_DUPLICATE_GCLID": 7, + "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID": 8, + "PROCESSING_ERROR_REASON_INVALID_GBRAID": 9, + "PROCESSING_ERROR_REASON_INVALID_GCLID": 10, + "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID": 11, + "PROCESSING_ERROR_REASON_INVALID_WBRAID": 12, + "PROCESSING_ERROR_REASON_INTERNAL_ERROR": 13, + "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED": 14, + "PROCESSING_ERROR_REASON_INVALID_EVENT": 15, + "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS": 16, + "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS": 17, + "PROCESSING_ERROR_REASON_INVALID_FORMAT": 18, + "PROCESSING_ERROR_REASON_DECRYPTION_ERROR": 19, + "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR": 20, + "PROCESSING_ERROR_REASON_INVALID_WIP": 21, + "PROCESSING_ERROR_REASON_INVALID_KEK": 22, + "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED": 23, + "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED": 24, + "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED": 27, + "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": 25, + "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER": 26 + } + }, + "ProcessingWarningReason": { + "values": { + "PROCESSING_WARNING_REASON_UNSPECIFIED": 0, + "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED": 1, + "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR": 2, + "PROCESSING_WARNING_REASON_DECRYPTION_ERROR": 3, + "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED": 4, + "PROCESSING_WARNING_REASON_INVALID_WIP": 5, + "PROCESSING_WARNING_REASON_INVALID_KEK": 6, + "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": 7, + "PROCESSING_WARNING_REASON_INTERNAL_ERROR": 8, + "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED": 9 + } + }, + "TermsOfService": { + "fields": { + "customerMatchTermsOfServiceStatus": { + "type": "TermsOfServiceStatus", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TermsOfServiceStatus": { + "values": { + "TERMS_OF_SERVICE_STATUS_UNSPECIFIED": 0, + "ACCEPTED": 1, + "REJECTED": 2 + } + }, + "MarketingDataInsightsService": { + "options": { + "(google.api.default_host)": "datamanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/datamanager" + }, + "methods": { + "RetrieveInsights": { + "requestType": "RetrieveInsightsRequest", + "responseType": "RetrieveInsightsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=accountTypes/*/accounts/*}/insights:retrieve", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accountTypes/*/accounts/*}/insights:retrieve", + "body": "*" + } + } + ] + } + } + }, + "RetrieveInsightsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "baseline": { + "type": "Baseline", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userListId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Baseline": { + "oneofs": { + "baseline": { + "oneof": [ + "baselineLocation", + "locationAutoDetectionEnabled" + ] + } + }, + "fields": { + "baselineLocation": { + "type": "Location", + "id": 1 + }, + "locationAutoDetectionEnabled": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "Location": { + "fields": { + "regionCodes": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "RetrieveInsightsResponse": { + "fields": { + "marketingDataInsights": { + "rule": "repeated", + "type": "MarketingDataInsight", + "id": 1 + } + }, + "nested": { + "MarketingDataInsight": { + "fields": { + "dimension": { + "type": "AudienceInsightsDimension", + "id": 1 + }, + "attributes": { + "rule": "repeated", + "type": "MarketingDataInsightsAttribute", + "id": 2 + } + }, + "nested": { + "AudienceInsightsDimension": { + "values": { + "AUDIENCE_INSIGHTS_DIMENSION_UNSPECIFIED": 0, + "AUDIENCE_INSIGHTS_DIMENSION_UNKNOWN": 1, + "AFFINITY_USER_INTEREST": 2, + "IN_MARKET_USER_INTEREST": 3, + "AGE_RANGE": 4, + "GENDER": 5 + } + }, + "MarketingDataInsightsAttribute": { + "oneofs": { + "_userInterestId": { + "oneof": [ + "userInterestId" + ] + }, + "_lift": { + "oneof": [ + "lift" + ] + }, + "_ageRange": { + "oneof": [ + "ageRange" + ] + }, + "_gender": { + "oneof": [ + "gender" + ] + } + }, + "fields": { + "userInterestId": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "lift": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "ageRange": { + "type": "AgeRange", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "gender": { + "type": "Gender", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } + }, + "PartnerLinkService": { + "options": { + "(google.api.default_host)": "datamanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/datamanager" + }, + "methods": { + "CreatePartnerLink": { + "requestType": "CreatePartnerLinkRequest", + "responseType": "PartnerLink", + "options": { + "(google.api.http).post": "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks", + "(google.api.http).body": "partner_link", + "(google.api.method_signature)": "parent,partner_link" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks", + "body": "partner_link" + } + }, + { + "(google.api.method_signature)": "parent,partner_link" + } + ] + }, + "DeletePartnerLink": { + "requestType": "DeletePartnerLinkRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=accountTypes/*/accounts/*/partnerLinks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=accountTypes/*/accounts/*/partnerLinks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchPartnerLinks": { + "requestType": "SearchPartnerLinksRequest", + "responseType": "SearchPartnerLinksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks:search", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accountTypes/*/accounts/*}/partnerLinks:search" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreatePartnerLinkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/PartnerLink" + } + }, + "partnerLink": { + "type": "PartnerLink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePartnerLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamanager.googleapis.com/PartnerLink" + } + } + } + }, + "SearchPartnerLinksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/PartnerLink" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchPartnerLinksResponse": { + "fields": { + "partnerLinks": { + "rule": "repeated", + "type": "PartnerLink", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PartnerLink": { + "options": { + "(google.api.resource).type": "datamanager.googleapis.com/PartnerLink", + "(google.api.resource).pattern": "accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}", + "(google.api.resource).plural": "partnerLinks", + "(google.api.resource).singular": "partnerLink" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "partnerLinkId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "owningAccount": { + "type": "ProductAccount", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partnerAccount": { + "type": "ProductAccount", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UserList": { + "options": { + "(google.api.resource).type": "datamanager.googleapis.com/UserList", + "(google.api.resource).pattern": "accountTypes/{account_type}/accounts/{account}/userLists/{user_list}", + "(google.api.resource).plural": "userLists", + "(google.api.resource).singular": "userList" + }, + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_membershipStatus": { + "oneof": [ + "membershipStatus" + ] + }, + "_integrationCode": { + "oneof": [ + "integrationCode" + ] + }, + "_closingReason": { + "oneof": [ + "closingReason" + ] + }, + "_accountAccessStatus": { + "oneof": [ + "accountAccessStatus" + ] + }, + "userListInfo": { + "oneof": [ + "ingestedUserListInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "id": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "readOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "membershipStatus": { + "type": "MembershipStatus", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "integrationCode": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "membershipDuration": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "closingReason": { + "type": "ClosingReason", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "accessReason": { + "type": "AccessReason", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accountAccessStatus": { + "type": "AccessStatus", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "sizeInfo": { + "type": "SizeInfo", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetNetworkInfo": { + "type": "TargetNetworkInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ingestedUserListInfo": { + "type": "IngestedUserListInfo", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MembershipStatus": { + "values": { + "MEMBERSHIP_STATUS_UNSPECIFIED": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "ClosingReason": { + "values": { + "CLOSING_REASON_UNSPECIFIED": 0, + "UNUSED": 1 + } + }, + "AccessReason": { + "values": { + "ACCESS_REASON_UNSPECIFIED": 0, + "OWNED": 1, + "SHARED": 2, + "LICENSED": 3, + "SUBSCRIBED": 4, + "AFFILIATED": 5 + } + }, + "AccessStatus": { + "values": { + "ACCESS_STATUS_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "SizeInfo": { + "fields": { + "displayNetworkMembersCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "searchNetworkMembersCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TargetNetworkInfo": { + "oneofs": { + "_eligibleForSearch": { + "oneof": [ + "eligibleForSearch" + ] + } + }, + "fields": { + "eligibleForDisplay": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eligibleForSearch": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "IngestedUserListInfo": { + "fields": { + "uploadKeyTypes": { + "rule": "repeated", + "type": "UploadKeyType", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "contactIdInfo": { + "type": "ContactIdInfo", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mobileIdInfo": { + "type": "MobileIdInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userIdInfo": { + "type": "UserIdInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pairIdInfo": { + "type": "PairIdInfo", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pseudonymousIdInfo": { + "type": "PseudonymousIdInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partnerAudienceInfo": { + "type": "PartnerAudienceInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UploadKeyType": { + "values": { + "UPLOAD_KEY_TYPE_UNSPECIFIED": 0, + "CONTACT_ID": 1, + "MOBILE_ID": 2, + "USER_ID": 3, + "PAIR_ID": 4, + "PSEUDONYMOUS_ID": 5 + } + } + } + }, + "ContactIdInfo": { + "oneofs": { + "_dataSourceType": { + "oneof": [ + "dataSourceType" + ] + } + }, + "fields": { + "dataSourceType": { + "type": "DataSourceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "matchRatePercentage": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MobileIdInfo": { + "oneofs": { + "_dataSourceType": { + "oneof": [ + "dataSourceType" + ] + }, + "_keySpace": { + "oneof": [ + "keySpace" + ] + }, + "_appId": { + "oneof": [ + "appId" + ] + } + }, + "fields": { + "dataSourceType": { + "type": "DataSourceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "keySpace": { + "type": "KeySpace", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "appId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + }, + "nested": { + "KeySpace": { + "values": { + "KEY_SPACE_UNSPECIFIED": 0, + "IOS": 1, + "ANDROID": 2 + } + } + } + }, + "UserIdInfo": { + "oneofs": { + "_dataSourceType": { + "oneof": [ + "dataSourceType" + ] + } + }, + "fields": { + "dataSourceType": { + "type": "DataSourceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + } + }, + "PairIdInfo": { + "oneofs": { + "_publisherId": { + "oneof": [ + "publisherId" + ] + }, + "_publisherName": { + "oneof": [ + "publisherName" + ] + }, + "_cleanRoomIdentifier": { + "oneof": [ + "cleanRoomIdentifier" + ] + } + }, + "fields": { + "publisherId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "publisherName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "matchRatePercentage": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "advertiserIdentifierCount": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cleanRoomIdentifier": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + } + }, + "PartnerAudienceInfo": { + "oneofs": { + "_partnerAudienceSource": { + "oneof": [ + "partnerAudienceSource" + ] + }, + "_commercePartner": { + "oneof": [ + "commercePartner" + ] + } + }, + "fields": { + "partnerAudienceSource": { + "type": "PartnerAudienceSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "commercePartner": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "PartnerAudienceSource": { + "values": { + "PARTNER_AUDIENCE_SOURCE_UNSPECIFIED": 0, + "COMMERCE_AUDIENCE": 1, + "LINEAR_TV_AUDIENCE": 2, + "AGENCY_PROVIDER_AUDIENCE": 3 + } + } + } + }, + "PseudonymousIdInfo": { + "oneofs": { + "_syncStatus": { + "oneof": [ + "syncStatus" + ] + }, + "_billableRecordCount": { + "oneof": [ + "billableRecordCount" + ] + } + }, + "fields": { + "syncStatus": { + "type": "SyncStatus", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "billableRecordCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + }, + "nested": { + "SyncStatus": { + "values": { + "SYNC_STATUS_UNSPECIFIED": 0, + "CREATED": 1, + "READY_FOR_USE": 2, + "FAILED": 3 + } + } + } + }, + "DataSourceType": { + "values": { + "DATA_SOURCE_TYPE_UNSPECIFIED": 0, + "DATA_SOURCE_TYPE_FIRST_PARTY": 1, + "DATA_SOURCE_TYPE_THIRD_PARTY_CREDIT_BUREAU": 2, + "DATA_SOURCE_TYPE_THIRD_PARTY_VOTER_FILE": 3, + "DATA_SOURCE_TYPE_THIRD_PARTY_PARTNER_DATA": 4 + } + }, + "UserListDirectLicense": { + "options": { + "(google.api.resource).type": "datamanager.googleapis.com/UserListDirectLicense", + "(google.api.resource).pattern": "accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}", + "(google.api.resource).plural": "userListDirectLicenses", + "(google.api.resource).singular": "userListDirectLicense" + }, + "oneofs": { + "_userListId": { + "oneof": [ + "userListId" + ] + }, + "_clientAccountType": { + "oneof": [ + "clientAccountType" + ] + }, + "_clientAccountId": { + "oneof": [ + "clientAccountId" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "userListId": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "userListDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientAccountType": { + "type": "UserListLicenseClientAccountType", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "clientAccountId": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "clientAccountDisplayName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "UserListLicenseStatus", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "pricing": { + "type": "UserListLicensePricing", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "historicalPricings": { + "rule": "repeated", + "type": "UserListLicensePricing", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metrics": { + "type": "UserListLicenseMetrics", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserListLicenseClientAccountType": { + "values": { + "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_UNKNOWN": 0, + "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_ADS": 1, + "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_PARTNER": 2, + "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_DISPLAY_VIDEO_ADVERTISER": 3, + "USER_LIST_LICENSE_CLIENT_ACCOUNT_TYPE_GOOGLE_AD_MANAGER_AUDIENCE_LINK": 4 + } + }, + "UserListLicenseMetrics": { + "fields": { + "clickCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "impressionCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revenueUsdMicros": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startDate": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endDate": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserListLicensePricing": { + "oneofs": { + "_costMicros": { + "oneof": [ + "costMicros" + ] + }, + "_currencyCode": { + "oneof": [ + "currencyCode" + ] + }, + "_costType": { + "oneof": [ + "costType" + ] + }, + "_maxCostMicros": { + "oneof": [ + "maxCostMicros" + ] + } + }, + "fields": { + "pricingId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "costMicros": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "currencyCode": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pricingActive": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buyerApprovalState": { + "type": "UserListPricingBuyerApprovalState", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "costType": { + "type": "UserListPricingCostType", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "maxCostMicros": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "UserListPricingBuyerApprovalState": { + "values": { + "USER_LIST_PRICING_BUYER_APPROVAL_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "APPROVED": 2, + "REJECTED": 3 + } + }, + "UserListPricingCostType": { + "values": { + "USER_LIST_PRICING_COST_TYPE_UNSPECIFIED": 0, + "CPC": 1, + "CPM": 2, + "MEDIA_SHARE": 3 + } + } + } + }, + "UserListLicenseStatus": { + "values": { + "USER_LIST_LICENSE_STATUS_UNSPECIFIED": 0, + "USER_LIST_LICENSE_STATUS_ENABLED": 1, + "USER_LIST_LICENSE_STATUS_DISABLED": 2 + } + }, + "UserListDirectLicenseService": { + "options": { + "(google.api.default_host)": "datamanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/datamanager" + }, + "methods": { + "CreateUserListDirectLicense": { + "requestType": "CreateUserListDirectLicenseRequest", + "responseType": "UserListDirectLicense", + "options": { + "(google.api.http).post": "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses", + "(google.api.http).body": "user_list_direct_license", + "(google.api.method_signature)": "parent,user_list_direct_license" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses", + "body": "user_list_direct_license" + } + }, + { + "(google.api.method_signature)": "parent,user_list_direct_license" + } + ] + }, + "GetUserListDirectLicense": { + "requestType": "GetUserListDirectLicenseRequest", + "responseType": "UserListDirectLicense", + "options": { + "(google.api.http).get": "/v1/{name=accountTypes/*/accounts/*/userListDirectLicenses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accountTypes/*/accounts/*/userListDirectLicenses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateUserListDirectLicense": { + "requestType": "UpdateUserListDirectLicenseRequest", + "responseType": "UserListDirectLicense", + "options": { + "(google.api.http).patch": "/v1/{user_list_direct_license.name=accountTypes/*/accounts/*/userListDirectLicenses/*}", + "(google.api.http).body": "user_list_direct_license", + "(google.api.method_signature)": "user_list_direct_license,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{user_list_direct_license.name=accountTypes/*/accounts/*/userListDirectLicenses/*}", + "body": "user_list_direct_license" + } + }, + { + "(google.api.method_signature)": "user_list_direct_license,update_mask" + } + ] + }, + "ListUserListDirectLicenses": { + "requestType": "ListUserListDirectLicensesRequest", + "responseType": "ListUserListDirectLicensesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accountTypes/*/accounts/*}/userListDirectLicenses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateUserListDirectLicenseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserListDirectLicense" + } + }, + "userListDirectLicense": { + "type": "UserListDirectLicense", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetUserListDirectLicenseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamanager.googleapis.com/UserListDirectLicense" + } + } + } + }, + "UpdateUserListDirectLicenseRequest": { + "fields": { + "userListDirectLicense": { + "type": "UserListDirectLicense", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUserListDirectLicensesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserListDirectLicense" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUserListDirectLicensesResponse": { + "fields": { + "userListDirectLicenses": { + "rule": "repeated", + "type": "UserListDirectLicense", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UserListGlobalLicense": { + "options": { + "(google.api.resource).type": "datamanager.googleapis.com/UserListGlobalLicense", + "(google.api.resource).pattern": "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}", + "(google.api.resource).plural": "userListGlobalLicenses", + "(google.api.resource).singular": "userListGlobalLicense" + }, + "oneofs": { + "_userListId": { + "oneof": [ + "userListId" + ] + }, + "_licenseType": { + "oneof": [ + "licenseType" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "userListId": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "userListDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "licenseType": { + "type": "UserListGlobalLicenseType", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "status": { + "type": "UserListLicenseStatus", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "pricing": { + "type": "UserListLicensePricing", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "historicalPricings": { + "rule": "repeated", + "type": "UserListLicensePricing", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metrics": { + "type": "UserListLicenseMetrics", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserListGlobalLicenseCustomerInfo": { + "options": { + "(google.api.resource).type": "datamanager.googleapis.com/UserListGlobalLicenseCustomerInfo", + "(google.api.resource).pattern": "accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}", + "(google.api.resource).plural": "userListGlobalLicenseCustomerInfos", + "(google.api.resource).singular": "userListGlobalLicenseCustomerInfo" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "userListId": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userListDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "licenseType": { + "type": "UserListGlobalLicenseType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "UserListLicenseStatus", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pricing": { + "type": "UserListLicensePricing", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientAccountType": { + "type": "UserListLicenseClientAccountType", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientAccountId": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientAccountDisplayName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "historicalPricings": { + "rule": "repeated", + "type": "UserListLicensePricing", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metrics": { + "type": "UserListLicenseMetrics", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserListGlobalLicenseType": { + "values": { + "USER_LIST_GLOBAL_LICENSE_TYPE_UNSPECIFIED": 0, + "USER_LIST_GLOBAL_LICENSE_TYPE_RESELLER": 1, + "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_SELL_SIDE": 2, + "USER_LIST_GLOBAL_LICENSE_TYPE_DATA_MART_BUY_SIDE": 3 + } + }, + "UserListGlobalLicenseService": { + "options": { + "(google.api.default_host)": "datamanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/datamanager" + }, + "methods": { + "CreateUserListGlobalLicense": { + "requestType": "CreateUserListGlobalLicenseRequest", + "responseType": "UserListGlobalLicense", + "options": { + "(google.api.http).post": "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses", + "(google.api.http).body": "user_list_global_license", + "(google.api.method_signature)": "parent,user_list_global_license" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses", + "body": "user_list_global_license" + } + }, + { + "(google.api.method_signature)": "parent,user_list_global_license" + } + ] + }, + "UpdateUserListGlobalLicense": { + "requestType": "UpdateUserListGlobalLicenseRequest", + "responseType": "UserListGlobalLicense", + "options": { + "(google.api.http).patch": "/v1/{user_list_global_license.name=accountTypes/*/accounts/*/userListGlobalLicenses/*}", + "(google.api.http).body": "user_list_global_license", + "(google.api.method_signature)": "user_list_global_license,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{user_list_global_license.name=accountTypes/*/accounts/*/userListGlobalLicenses/*}", + "body": "user_list_global_license" + } + }, + { + "(google.api.method_signature)": "user_list_global_license,update_mask" + } + ] + }, + "GetUserListGlobalLicense": { + "requestType": "GetUserListGlobalLicenseRequest", + "responseType": "UserListGlobalLicense", + "options": { + "(google.api.http).get": "/v1/{name=accountTypes/*/accounts/*/userListGlobalLicenses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accountTypes/*/accounts/*/userListGlobalLicenses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListUserListGlobalLicenses": { + "requestType": "ListUserListGlobalLicensesRequest", + "responseType": "ListUserListGlobalLicensesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accountTypes/*/accounts/*}/userListGlobalLicenses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUserListGlobalLicenseCustomerInfos": { + "requestType": "ListUserListGlobalLicenseCustomerInfosRequest", + "responseType": "ListUserListGlobalLicenseCustomerInfosResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accountTypes/*/accounts/*/userListGlobalLicenses/*}/userListGlobalLicenseCustomerInfos", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accountTypes/*/accounts/*/userListGlobalLicenses/*}/userListGlobalLicenseCustomerInfos" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateUserListGlobalLicenseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserListGlobalLicense" + } + }, + "userListGlobalLicense": { + "type": "UserListGlobalLicense", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateUserListGlobalLicenseRequest": { + "fields": { + "userListGlobalLicense": { + "type": "UserListGlobalLicense", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetUserListGlobalLicenseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamanager.googleapis.com/UserListGlobalLicense" + } + } + } + }, + "ListUserListGlobalLicensesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserListGlobalLicense" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUserListGlobalLicensesResponse": { + "fields": { + "userListGlobalLicenses": { + "rule": "repeated", + "type": "UserListGlobalLicense", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListUserListGlobalLicenseCustomerInfosRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserListGlobalLicenseCustomerInfo" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUserListGlobalLicenseCustomerInfosResponse": { + "fields": { + "userListGlobalLicenseCustomerInfos": { + "rule": "repeated", + "type": "UserListGlobalLicenseCustomerInfo", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UserListService": { + "options": { + "(google.api.default_host)": "datamanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/datamanager" + }, + "methods": { + "GetUserList": { + "requestType": "GetUserListRequest", + "responseType": "UserList", + "options": { + "(google.api.http).get": "/v1/{name=accountTypes/*/accounts/*/userLists/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accountTypes/*/accounts/*/userLists/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListUserLists": { + "requestType": "ListUserListsRequest", + "responseType": "ListUserListsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accountTypes/*/accounts/*}/userLists", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accountTypes/*/accounts/*}/userLists" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateUserList": { + "requestType": "CreateUserListRequest", + "responseType": "UserList", + "options": { + "(google.api.http).post": "/v1/{parent=accountTypes/*/accounts/*}/userLists", + "(google.api.http).body": "user_list", + "(google.api.method_signature)": "parent,user_list" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accountTypes/*/accounts/*}/userLists", + "body": "user_list" + } + }, + { + "(google.api.method_signature)": "parent,user_list" } - } + ] }, - "IngestPairDataStatus": { - "fields": { - "recordCount": { - "type": "int64", - "id": 1 + "UpdateUserList": { + "requestType": "UpdateUserListRequest", + "responseType": "UserList", + "options": { + "(google.api.http).patch": "/v1/{user_list.name=accountTypes/*/accounts/*/userLists/*}", + "(google.api.http).body": "user_list", + "(google.api.method_signature)": "user_list,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{user_list.name=accountTypes/*/accounts/*/userLists/*}", + "body": "user_list" + } }, - "pairIdCount": { - "type": "int64", - "id": 2 + { + "(google.api.method_signature)": "user_list,update_mask" } - } + ] }, - "RemovePairDataStatus": { - "fields": { - "recordCount": { - "type": "int64", - "id": 1 + "DeleteUserList": { + "requestType": "DeleteUserListRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=accountTypes/*/accounts/*/userLists/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=accountTypes/*/accounts/*/userLists/*}" + } }, - "pairIdCount": { - "type": "int64", - "id": 2 + { + "(google.api.method_signature)": "name" } - } + ] } } }, - "MatchRateRange": { - "values": { - "MATCH_RATE_RANGE_UNKNOWN": 0, - "MATCH_RATE_RANGE_NOT_ELIGIBLE": 1, - "MATCH_RATE_RANGE_LESS_THAN_20": 2, - "MATCH_RATE_RANGE_20_TO_30": 3, - "MATCH_RATE_RANGE_31_TO_40": 4, - "MATCH_RATE_RANGE_41_TO_50": 5, - "MATCH_RATE_RANGE_51_TO_60": 6, - "MATCH_RATE_RANGE_61_TO_70": 7, - "MATCH_RATE_RANGE_71_TO_80": 8, - "MATCH_RATE_RANGE_81_TO_90": 9, - "MATCH_RATE_RANGE_91_TO_100": 10 - } - }, - "ErrorInfo": { + "GetUserListRequest": { "fields": { - "errorCounts": { - "rule": "repeated", - "type": "ErrorCount", - "id": 1 + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamanager.googleapis.com/UserList" + } } } }, - "ErrorCount": { + "ListUserListsRequest": { "fields": { - "recordCount": { - "type": "int64", - "id": 1 + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserList" + } }, - "reason": { - "type": "ProcessingErrorReason", - "id": 2 + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "WarningInfo": { + "ListUserListsResponse": { "fields": { - "warningCounts": { + "userLists": { "rule": "repeated", - "type": "WarningCount", + "type": "UserList", "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 } } }, - "WarningCount": { + "CreateUserListRequest": { "fields": { - "recordCount": { - "type": "int64", - "id": 1 + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamanager.googleapis.com/UserList" + } }, - "reason": { - "type": "ProcessingWarningReason", - "id": 2 + "userList": { + "type": "UserList", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "ProcessingErrorReason": { - "values": { - "PROCESSING_ERROR_REASON_UNSPECIFIED": 0, - "PROCESSING_ERROR_REASON_INVALID_CUSTOM_VARIABLE": 1, - "PROCESSING_ERROR_REASON_CUSTOM_VARIABLE_NOT_ENABLED": 2, - "PROCESSING_ERROR_REASON_EVENT_TOO_OLD": 3, - "PROCESSING_ERROR_REASON_DENIED_CONSENT": 4, - "PROCESSING_ERROR_REASON_NO_CONSENT": 5, - "PROCESSING_ERROR_REASON_UNKNOWN_CONSENT": 6, - "PROCESSING_ERROR_REASON_DUPLICATE_GCLID": 7, - "PROCESSING_ERROR_REASON_DUPLICATE_TRANSACTION_ID": 8, - "PROCESSING_ERROR_REASON_INVALID_GBRAID": 9, - "PROCESSING_ERROR_REASON_INVALID_GCLID": 10, - "PROCESSING_ERROR_REASON_INVALID_MERCHANT_ID": 11, - "PROCESSING_ERROR_REASON_INVALID_WBRAID": 12, - "PROCESSING_ERROR_REASON_INTERNAL_ERROR": 13, - "PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED": 14, - "PROCESSING_ERROR_REASON_INVALID_EVENT": 15, - "PROCESSING_ERROR_REASON_INSUFFICIENT_MATCHED_TRANSACTIONS": 16, - "PROCESSING_ERROR_REASON_INSUFFICIENT_TRANSACTIONS": 17, - "PROCESSING_ERROR_REASON_INVALID_FORMAT": 18, - "PROCESSING_ERROR_REASON_DECRYPTION_ERROR": 19, - "PROCESSING_ERROR_REASON_DEK_DECRYPTION_ERROR": 20, - "PROCESSING_ERROR_REASON_INVALID_WIP": 21, - "PROCESSING_ERROR_REASON_INVALID_KEK": 22, - "PROCESSING_ERROR_REASON_WIP_AUTH_FAILED": 23, - "PROCESSING_ERROR_REASON_KEK_PERMISSION_DENIED": 24, - "PROCESSING_ERROR_REASON_AWS_AUTH_FAILED": 27, - "PROCESSING_ERROR_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": 25, - "PROCESSING_ERROR_OPERATING_ACCOUNT_MISMATCH_FOR_AD_IDENTIFIER": 26 - } - }, - "ProcessingWarningReason": { - "values": { - "PROCESSING_WARNING_REASON_UNSPECIFIED": 0, - "PROCESSING_WARNING_REASON_KEK_PERMISSION_DENIED": 1, - "PROCESSING_WARNING_REASON_DEK_DECRYPTION_ERROR": 2, - "PROCESSING_WARNING_REASON_DECRYPTION_ERROR": 3, - "PROCESSING_WARNING_REASON_WIP_AUTH_FAILED": 4, - "PROCESSING_WARNING_REASON_INVALID_WIP": 5, - "PROCESSING_WARNING_REASON_INVALID_KEK": 6, - "PROCESSING_WARNING_REASON_USER_IDENTIFIER_DECRYPTION_ERROR": 7, - "PROCESSING_WARNING_REASON_INTERNAL_ERROR": 8, - "PROCESSING_WARNING_REASON_AWS_AUTH_FAILED": 9 - } - }, - "TermsOfService": { + "UpdateUserListRequest": { "fields": { - "customerMatchTermsOfServiceStatus": { - "type": "TermsOfServiceStatus", + "userList": { + "type": "UserList", "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } } } }, - "TermsOfServiceStatus": { - "values": { - "TERMS_OF_SERVICE_STATUS_UNSPECIFIED": 0, - "ACCEPTED": 1, - "REJECTED": 2 + "DeleteUserListRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamanager.googleapis.com/UserList" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } } } } @@ -1457,6 +3631,83 @@ "IDENTIFIER": 8 } }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -3184,6 +5435,18 @@ "id": 2 } } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } } diff --git a/packages/google-ads-datamanager/samples/generated/v1/marketing_data_insights_service.retrieve_insights.js b/packages/google-ads-datamanager/samples/generated/v1/marketing_data_insights_service.retrieve_insights.js new file mode 100644 index 00000000000..ca47194e9a5 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/marketing_data_insights_service.retrieve_insights.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, baseline, userListId) { + // [START datamanager_v1_generated_MarketingDataInsightsService_RetrieveInsights_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent account that owns the user list. + * Format: `accountTypes/{account_type}/accounts/{account}` + */ + // const parent = 'abc123' + /** + * Required. Baseline for the insights requested. + */ + // const baseline = {} + /** + * Required. The user list ID for which insights are requested. + */ + // const userListId = 'abc123' + + // Imports the Datamanager library + const {MarketingDataInsightsServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new MarketingDataInsightsServiceClient(); + + async function callRetrieveInsights() { + // Construct request + const request = { + parent, + baseline, + userListId, + }; + + // Run request + const response = await datamanagerClient.retrieveInsights(request); + console.log(response); + } + + callRetrieveInsights(); + // [END datamanager_v1_generated_MarketingDataInsightsService_RetrieveInsights_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.create_partner_link.js b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.create_partner_link.js new file mode 100644 index 00000000000..86c8cb19ea7 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.create_partner_link.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, partnerLink) { + // [START datamanager_v1_generated_PartnerLinkService_CreatePartnerLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of partner links. + * Format: accountTypes/{account_type}/accounts/{account} + */ + // const parent = 'abc123' + /** + * Required. The partner link to create. + */ + // const partnerLink = {} + + // Imports the Datamanager library + const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new PartnerLinkServiceClient(); + + async function callCreatePartnerLink() { + // Construct request + const request = { + parent, + partnerLink, + }; + + // Run request + const response = await datamanagerClient.createPartnerLink(request); + console.log(response); + } + + callCreatePartnerLink(); + // [END datamanager_v1_generated_PartnerLinkService_CreatePartnerLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.delete_partner_link.js b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.delete_partner_link.js new file mode 100644 index 00000000000..10d70ee0f16 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.delete_partner_link.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamanager_v1_generated_PartnerLinkService_DeletePartnerLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the partner link to delete. + * Format: + * accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link} + */ + // const name = 'abc123' + + // Imports the Datamanager library + const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new PartnerLinkServiceClient(); + + async function callDeletePartnerLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datamanagerClient.deletePartnerLink(request); + console.log(response); + } + + callDeletePartnerLink(); + // [END datamanager_v1_generated_PartnerLinkService_DeletePartnerLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.search_partner_links.js b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.search_partner_links.js new file mode 100644 index 00000000000..8ef0b9dbaa5 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/partner_link_service.search_partner_links.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamanager_v1_generated_PartnerLinkService_SearchPartnerLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Account to search for partner links. If no `filter` is specified, + * all partner links where this account is either the `owning_account` or + * `partner_account` are returned. + * Format: `accountTypes/{account_type}/accounts/{account}` + */ + // const parent = 'abc123' + /** + * The maximum number of partner links to return. The service may return + * fewer than this value. + * If unspecified, at most 10 partner links will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `SearchPartnerLinks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `SearchPartnerLinks` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter string (//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `partner_link_id = + * 123456789`). + * Supported operations: + * - `AND` + * - `=` + * - `!=` + * Supported fields: + * - `partner_link_id` + * - `owning_account.account_type` + * - `owning_account.account_id` + * - `partner_account.account_type` + * - `partner_account.account_id` + * Example: + * `owning_account.account_type = "GOOGLE_ADS" OR partner_account.account_id = + * 987654321` + */ + // const filter = 'abc123' + + // Imports the Datamanager library + const {PartnerLinkServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new PartnerLinkServiceClient(); + + async function callSearchPartnerLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = datamanagerClient.searchPartnerLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchPartnerLinks(); + // [END datamanager_v1_generated_PartnerLinkService_SearchPartnerLinks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/snippet_metadata_google.ads.datamanager.v1.json b/packages/google-ads-datamanager/samples/generated/v1/snippet_metadata_google.ads.datamanager.v1.json index 18c375ea831..08c06e3ea9f 100644 --- a/packages/google-ads-datamanager/samples/generated/v1/snippet_metadata_google.ads.datamanager.v1.json +++ b/packages/google-ads-datamanager/samples/generated/v1/snippet_metadata_google.ads.datamanager.v1.json @@ -230,6 +230,834 @@ } } } + }, + { + "regionTag": "datamanager_v1_generated_MarketingDataInsightsService_RetrieveInsights_async", + "title": "IngestionService retrieveInsights Sample", + "origin": "API_DEFINITION", + "description": " Retrieves marketing data insights for a given user list. This feature is only available to data partners. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "marketing_data_insights_service.retrieve_insights.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveInsights", + "fullName": "google.ads.datamanager.v1.MarketingDataInsightsService.RetrieveInsights", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "baseline", + "type": ".google.ads.datamanager.v1.Baseline" + }, + { + "name": "user_list_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.RetrieveInsightsResponse", + "client": { + "shortName": "MarketingDataInsightsServiceClient", + "fullName": "google.ads.datamanager.v1.MarketingDataInsightsServiceClient" + }, + "method": { + "shortName": "RetrieveInsights", + "fullName": "google.ads.datamanager.v1.MarketingDataInsightsService.RetrieveInsights", + "service": { + "shortName": "MarketingDataInsightsService", + "fullName": "google.ads.datamanager.v1.MarketingDataInsightsService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_PartnerLinkService_CreatePartnerLink_async", + "title": "IngestionService createPartnerLink Sample", + "origin": "API_DEFINITION", + "description": " Creates a partner link for the given account. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "partner_link_service.create_partner_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePartnerLink", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.CreatePartnerLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "partner_link", + "type": ".google.ads.datamanager.v1.PartnerLink" + } + ], + "resultType": ".google.ads.datamanager.v1.PartnerLink", + "client": { + "shortName": "PartnerLinkServiceClient", + "fullName": "google.ads.datamanager.v1.PartnerLinkServiceClient" + }, + "method": { + "shortName": "CreatePartnerLink", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.CreatePartnerLink", + "service": { + "shortName": "PartnerLinkService", + "fullName": "google.ads.datamanager.v1.PartnerLinkService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_PartnerLinkService_DeletePartnerLink_async", + "title": "IngestionService deletePartnerLink Sample", + "origin": "API_DEFINITION", + "description": " Deletes a partner link for the given account. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "partner_link_service.delete_partner_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePartnerLink", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.DeletePartnerLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "PartnerLinkServiceClient", + "fullName": "google.ads.datamanager.v1.PartnerLinkServiceClient" + }, + "method": { + "shortName": "DeletePartnerLink", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.DeletePartnerLink", + "service": { + "shortName": "PartnerLinkService", + "fullName": "google.ads.datamanager.v1.PartnerLinkService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_PartnerLinkService_SearchPartnerLinks_async", + "title": "IngestionService searchPartnerLinks Sample", + "origin": "API_DEFINITION", + "description": " Searches for all partner links to and from a given account. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "partner_link_service.search_partner_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchPartnerLinks", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.SearchPartnerLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.SearchPartnerLinksResponse", + "client": { + "shortName": "PartnerLinkServiceClient", + "fullName": "google.ads.datamanager.v1.PartnerLinkServiceClient" + }, + "method": { + "shortName": "SearchPartnerLinks", + "fullName": "google.ads.datamanager.v1.PartnerLinkService.SearchPartnerLinks", + "service": { + "shortName": "PartnerLinkService", + "fullName": "google.ads.datamanager.v1.PartnerLinkService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListDirectLicenseService_CreateUserListDirectLicense_async", + "title": "IngestionService createUserListDirectLicense Sample", + "origin": "API_DEFINITION", + "description": " Creates a user list direct license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_direct_license_service.create_user_list_direct_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.CreateUserListDirectLicense", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_list_direct_license", + "type": ".google.ads.datamanager.v1.UserListDirectLicense" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListDirectLicense", + "client": { + "shortName": "UserListDirectLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseServiceClient" + }, + "method": { + "shortName": "CreateUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.CreateUserListDirectLicense", + "service": { + "shortName": "UserListDirectLicenseService", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListDirectLicenseService_GetUserListDirectLicense_async", + "title": "IngestionService getUserListDirectLicense Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a user list direct license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_direct_license_service.get_user_list_direct_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.GetUserListDirectLicense", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListDirectLicense", + "client": { + "shortName": "UserListDirectLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseServiceClient" + }, + "method": { + "shortName": "GetUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.GetUserListDirectLicense", + "service": { + "shortName": "UserListDirectLicenseService", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListDirectLicenseService_UpdateUserListDirectLicense_async", + "title": "IngestionService updateUserListDirectLicense Sample", + "origin": "API_DEFINITION", + "description": " Updates a user list direct license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_direct_license_service.update_user_list_direct_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.UpdateUserListDirectLicense", + "async": true, + "parameters": [ + { + "name": "user_list_direct_license", + "type": ".google.ads.datamanager.v1.UserListDirectLicense" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListDirectLicense", + "client": { + "shortName": "UserListDirectLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseServiceClient" + }, + "method": { + "shortName": "UpdateUserListDirectLicense", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.UpdateUserListDirectLicense", + "service": { + "shortName": "UserListDirectLicenseService", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListDirectLicenseService_ListUserListDirectLicenses_async", + "title": "IngestionService listUserListDirectLicenses Sample", + "origin": "API_DEFINITION", + "description": " Lists all user list direct licenses owned by the parent account. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_direct_license_service.list_user_list_direct_licenses.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUserListDirectLicenses", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.ListUserListDirectLicenses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.ListUserListDirectLicensesResponse", + "client": { + "shortName": "UserListDirectLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseServiceClient" + }, + "method": { + "shortName": "ListUserListDirectLicenses", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService.ListUserListDirectLicenses", + "service": { + "shortName": "UserListDirectLicenseService", + "fullName": "google.ads.datamanager.v1.UserListDirectLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListGlobalLicenseService_CreateUserListGlobalLicense_async", + "title": "IngestionService createUserListGlobalLicense Sample", + "origin": "API_DEFINITION", + "description": " Creates a user list global license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_global_license_service.create_user_list_global_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.CreateUserListGlobalLicense", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_list_global_license", + "type": ".google.ads.datamanager.v1.UserListGlobalLicense" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListGlobalLicense", + "client": { + "shortName": "UserListGlobalLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseServiceClient" + }, + "method": { + "shortName": "CreateUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.CreateUserListGlobalLicense", + "service": { + "shortName": "UserListGlobalLicenseService", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListGlobalLicenseService_UpdateUserListGlobalLicense_async", + "title": "IngestionService updateUserListGlobalLicense Sample", + "origin": "API_DEFINITION", + "description": " Updates a user list global license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_global_license_service.update_user_list_global_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.UpdateUserListGlobalLicense", + "async": true, + "parameters": [ + { + "name": "user_list_global_license", + "type": ".google.ads.datamanager.v1.UserListGlobalLicense" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListGlobalLicense", + "client": { + "shortName": "UserListGlobalLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseServiceClient" + }, + "method": { + "shortName": "UpdateUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.UpdateUserListGlobalLicense", + "service": { + "shortName": "UserListGlobalLicenseService", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListGlobalLicenseService_GetUserListGlobalLicense_async", + "title": "IngestionService getUserListGlobalLicense Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a user list global license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_global_license_service.get_user_list_global_license.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.GetUserListGlobalLicense", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.UserListGlobalLicense", + "client": { + "shortName": "UserListGlobalLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseServiceClient" + }, + "method": { + "shortName": "GetUserListGlobalLicense", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.GetUserListGlobalLicense", + "service": { + "shortName": "UserListGlobalLicenseService", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenses_async", + "title": "IngestionService listUserListGlobalLicenses Sample", + "origin": "API_DEFINITION", + "description": " Lists all user list global licenses owned by the parent account. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_global_license_service.list_user_list_global_licenses.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUserListGlobalLicenses", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.ListUserListGlobalLicensesResponse", + "client": { + "shortName": "UserListGlobalLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseServiceClient" + }, + "method": { + "shortName": "ListUserListGlobalLicenses", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenses", + "service": { + "shortName": "UserListGlobalLicenseService", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenseCustomerInfos_async", + "title": "IngestionService listUserListGlobalLicenseCustomerInfos Sample", + "origin": "API_DEFINITION", + "description": " Lists all customer info for a user list global license. This feature is only available to data partners.", + "canonical": true, + "file": "user_list_global_license_service.list_user_list_global_license_customer_infos.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUserListGlobalLicenseCustomerInfos", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenseCustomerInfos", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosResponse", + "client": { + "shortName": "UserListGlobalLicenseServiceClient", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseServiceClient" + }, + "method": { + "shortName": "ListUserListGlobalLicenseCustomerInfos", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService.ListUserListGlobalLicenseCustomerInfos", + "service": { + "shortName": "UserListGlobalLicenseService", + "fullName": "google.ads.datamanager.v1.UserListGlobalLicenseService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListService_GetUserList_async", + "title": "IngestionService getUserList Sample", + "origin": "API_DEFINITION", + "description": " Gets a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "user_list_service.get_user_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUserList", + "fullName": "google.ads.datamanager.v1.UserListService.GetUserList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.UserList", + "client": { + "shortName": "UserListServiceClient", + "fullName": "google.ads.datamanager.v1.UserListServiceClient" + }, + "method": { + "shortName": "GetUserList", + "fullName": "google.ads.datamanager.v1.UserListService.GetUserList", + "service": { + "shortName": "UserListService", + "fullName": "google.ads.datamanager.v1.UserListService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListService_ListUserLists_async", + "title": "IngestionService listUserLists Sample", + "origin": "API_DEFINITION", + "description": " Lists UserLists. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "user_list_service.list_user_lists.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUserLists", + "fullName": "google.ads.datamanager.v1.UserListService.ListUserLists", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ads.datamanager.v1.ListUserListsResponse", + "client": { + "shortName": "UserListServiceClient", + "fullName": "google.ads.datamanager.v1.UserListServiceClient" + }, + "method": { + "shortName": "ListUserLists", + "fullName": "google.ads.datamanager.v1.UserListService.ListUserLists", + "service": { + "shortName": "UserListService", + "fullName": "google.ads.datamanager.v1.UserListService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListService_CreateUserList_async", + "title": "IngestionService createUserList Sample", + "origin": "API_DEFINITION", + "description": " Creates a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "user_list_service.create_user_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUserList", + "fullName": "google.ads.datamanager.v1.UserListService.CreateUserList", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_list", + "type": ".google.ads.datamanager.v1.UserList" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.ads.datamanager.v1.UserList", + "client": { + "shortName": "UserListServiceClient", + "fullName": "google.ads.datamanager.v1.UserListServiceClient" + }, + "method": { + "shortName": "CreateUserList", + "fullName": "google.ads.datamanager.v1.UserListService.CreateUserList", + "service": { + "shortName": "UserListService", + "fullName": "google.ads.datamanager.v1.UserListService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListService_UpdateUserList_async", + "title": "IngestionService updateUserList Sample", + "origin": "API_DEFINITION", + "description": " Updates a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "user_list_service.update_user_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUserList", + "fullName": "google.ads.datamanager.v1.UserListService.UpdateUserList", + "async": true, + "parameters": [ + { + "name": "user_list", + "type": ".google.ads.datamanager.v1.UserList" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.ads.datamanager.v1.UserList", + "client": { + "shortName": "UserListServiceClient", + "fullName": "google.ads.datamanager.v1.UserListServiceClient" + }, + "method": { + "shortName": "UpdateUserList", + "fullName": "google.ads.datamanager.v1.UserListService.UpdateUserList", + "service": { + "shortName": "UserListService", + "fullName": "google.ads.datamanager.v1.UserListService" + } + } + } + }, + { + "regionTag": "datamanager_v1_generated_UserListService_DeleteUserList_async", + "title": "IngestionService deleteUserList Sample", + "origin": "API_DEFINITION", + "description": " Deletes a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request: * `login-account`: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format: `accountTypes/{loginAccountType}/accounts/{loginAccountId}` * `linked-account`: (Optional) The resource name of the account with an established product link to the `login-account`. Format: `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`", + "canonical": true, + "file": "user_list_service.delete_user_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUserList", + "fullName": "google.ads.datamanager.v1.UserListService.DeleteUserList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "UserListServiceClient", + "fullName": "google.ads.datamanager.v1.UserListServiceClient" + }, + "method": { + "shortName": "DeleteUserList", + "fullName": "google.ads.datamanager.v1.UserListService.DeleteUserList", + "service": { + "shortName": "UserListService", + "fullName": "google.ads.datamanager.v1.UserListService" + } + } + } } ] } diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.create_user_list_direct_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.create_user_list_direct_license.js new file mode 100644 index 00000000000..4b513d1787a --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.create_user_list_direct_license.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userListDirectLicense) { + // [START datamanager_v1_generated_UserListDirectLicenseService_CreateUserListDirectLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account that owns the user list being licensed. Should be in + * the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + */ + // const parent = 'abc123' + /** + * Required. The user list direct license to create. + */ + // const userListDirectLicense = {} + + // Imports the Datamanager library + const {UserListDirectLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListDirectLicenseServiceClient(); + + async function callCreateUserListDirectLicense() { + // Construct request + const request = { + parent, + userListDirectLicense, + }; + + // Run request + const response = await datamanagerClient.createUserListDirectLicense(request); + console.log(response); + } + + callCreateUserListDirectLicense(); + // [END datamanager_v1_generated_UserListDirectLicenseService_CreateUserListDirectLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.get_user_list_direct_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.get_user_list_direct_license.js new file mode 100644 index 00000000000..0e980721de4 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.get_user_list_direct_license.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamanager_v1_generated_UserListDirectLicenseService_GetUserListDirectLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the user list direct license. + */ + // const name = 'abc123' + + // Imports the Datamanager library + const {UserListDirectLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListDirectLicenseServiceClient(); + + async function callGetUserListDirectLicense() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datamanagerClient.getUserListDirectLicense(request); + console.log(response); + } + + callGetUserListDirectLicense(); + // [END datamanager_v1_generated_UserListDirectLicenseService_GetUserListDirectLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.list_user_list_direct_licenses.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.list_user_list_direct_licenses.js new file mode 100644 index 00000000000..53966c05ebd --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.list_user_list_direct_licenses.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamanager_v1_generated_UserListDirectLicenseService_ListUserListDirectLicenses_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + */ + // const parent = 'abc123' + /** + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * **Supported Operations:** + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * **Unsupported Fields:** + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of licenses to return per page. The service + * may return fewer than this value. If unspecified, at most 50 licenses will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Datamanager library + const {UserListDirectLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListDirectLicenseServiceClient(); + + async function callListUserListDirectLicenses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = datamanagerClient.listUserListDirectLicensesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUserListDirectLicenses(); + // [END datamanager_v1_generated_UserListDirectLicenseService_ListUserListDirectLicenses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.update_user_list_direct_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.update_user_list_direct_license.js new file mode 100644 index 00000000000..52d487d06c7 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_direct_license_service.update_user_list_direct_license.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(userListDirectLicense) { + // [START datamanager_v1_generated_UserListDirectLicenseService_UpdateUserListDirectLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The licenses' `name` field is used to identify the license to + * update. + */ + // const userListDirectLicense = {} + /** + * Optional. The list of fields to update. The special character `*` is not + * supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + */ + // const updateMask = {} + + // Imports the Datamanager library + const {UserListDirectLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListDirectLicenseServiceClient(); + + async function callUpdateUserListDirectLicense() { + // Construct request + const request = { + userListDirectLicense, + }; + + // Run request + const response = await datamanagerClient.updateUserListDirectLicense(request); + console.log(response); + } + + callUpdateUserListDirectLicense(); + // [END datamanager_v1_generated_UserListDirectLicenseService_UpdateUserListDirectLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.create_user_list_global_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.create_user_list_global_license.js new file mode 100644 index 00000000000..7948a9ae927 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.create_user_list_global_license.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userListGlobalLicense) { + // [START datamanager_v1_generated_UserListGlobalLicenseService_CreateUserListGlobalLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account that owns the user list being licensed. Should be in + * the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + */ + // const parent = 'abc123' + /** + * Required. The user list global license to create. + */ + // const userListGlobalLicense = {} + + // Imports the Datamanager library + const {UserListGlobalLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListGlobalLicenseServiceClient(); + + async function callCreateUserListGlobalLicense() { + // Construct request + const request = { + parent, + userListGlobalLicense, + }; + + // Run request + const response = await datamanagerClient.createUserListGlobalLicense(request); + console.log(response); + } + + callCreateUserListGlobalLicense(); + // [END datamanager_v1_generated_UserListGlobalLicenseService_CreateUserListGlobalLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.get_user_list_global_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.get_user_list_global_license.js new file mode 100644 index 00000000000..a8005ccbf8a --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.get_user_list_global_license.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamanager_v1_generated_UserListGlobalLicenseService_GetUserListGlobalLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the user list global license. + */ + // const name = 'abc123' + + // Imports the Datamanager library + const {UserListGlobalLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListGlobalLicenseServiceClient(); + + async function callGetUserListGlobalLicense() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datamanagerClient.getUserListGlobalLicense(request); + console.log(response); + } + + callGetUserListGlobalLicense(); + // [END datamanager_v1_generated_UserListGlobalLicenseService_GetUserListGlobalLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_license_customer_infos.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_license_customer_infos.js new file mode 100644 index 00000000000..b39cfce6a77 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_license_customer_infos.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenseCustomerInfos_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The global license whose customer info are being queried. Should + * be in the format + * `accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID}/userListGlobalLicenses/{USER_LIST_GLOBAL_LICENSE_ID}`. + * To list all global license customer info under an account, replace the user + * list global license id with a '-' (for example, + * `accountTypes/DATA_PARTNER/accounts/123/userListGlobalLicenses/-`) + */ + // const parent = 'abc123' + /** + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * **Supported Operations:** + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * **Unsupported Fields:** + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Datamanager library + const {UserListGlobalLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListGlobalLicenseServiceClient(); + + async function callListUserListGlobalLicenseCustomerInfos() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = datamanagerClient.listUserListGlobalLicenseCustomerInfosAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUserListGlobalLicenseCustomerInfos(); + // [END datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenseCustomerInfos_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_licenses.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_licenses.js new file mode 100644 index 00000000000..183e342fedd --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.list_user_list_global_licenses.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenses_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + */ + // const parent = 'abc123' + /** + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * **Supported Operations:** + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * **Unsupported Fields:** + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListUserListGlobalLicense` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Datamanager library + const {UserListGlobalLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListGlobalLicenseServiceClient(); + + async function callListUserListGlobalLicenses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = datamanagerClient.listUserListGlobalLicensesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUserListGlobalLicenses(); + // [END datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.update_user_list_global_license.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.update_user_list_global_license.js new file mode 100644 index 00000000000..f20d08a3ebc --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_global_license_service.update_user_list_global_license.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(userListGlobalLicense) { + // [START datamanager_v1_generated_UserListGlobalLicenseService_UpdateUserListGlobalLicense_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The licenses' `name` field is used to identify the license to + * update. + */ + // const userListGlobalLicense = {} + /** + * Optional. The list of fields to update. The special character `*` is not + * supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + */ + // const updateMask = {} + + // Imports the Datamanager library + const {UserListGlobalLicenseServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListGlobalLicenseServiceClient(); + + async function callUpdateUserListGlobalLicense() { + // Construct request + const request = { + userListGlobalLicense, + }; + + // Run request + const response = await datamanagerClient.updateUserListGlobalLicense(request); + console.log(response); + } + + callUpdateUserListGlobalLicense(); + // [END datamanager_v1_generated_UserListGlobalLicenseService_UpdateUserListGlobalLicense_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_service.create_user_list.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.create_user_list.js new file mode 100644 index 00000000000..2be25ee4ba0 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.create_user_list.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userList) { + // [START datamanager_v1_generated_UserListService_CreateUserList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent account where this user list will be created. + * Format: accountTypes/{account_type}/accounts/{account} + */ + // const parent = 'abc123' + /** + * Required. The user list to create. + */ + // const userList = {} + /** + * Optional. If true, the request is validated but not executed. + */ + // const validateOnly = true + + // Imports the Datamanager library + const {UserListServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListServiceClient(); + + async function callCreateUserList() { + // Construct request + const request = { + parent, + userList, + }; + + // Run request + const response = await datamanagerClient.createUserList(request); + console.log(response); + } + + callCreateUserList(); + // [END datamanager_v1_generated_UserListService_CreateUserList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_service.delete_user_list.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.delete_user_list.js new file mode 100644 index 00000000000..4b7516e670a --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.delete_user_list.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamanager_v1_generated_UserListService_DeleteUserList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the user list to delete. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + */ + // const name = 'abc123' + /** + * Optional. If true, the request is validated but not executed. + */ + // const validateOnly = true + + // Imports the Datamanager library + const {UserListServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListServiceClient(); + + async function callDeleteUserList() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datamanagerClient.deleteUserList(request); + console.log(response); + } + + callDeleteUserList(); + // [END datamanager_v1_generated_UserListService_DeleteUserList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_service.get_user_list.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.get_user_list.js new file mode 100644 index 00000000000..12fc66f37d0 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.get_user_list.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamanager_v1_generated_UserListService_GetUserList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the UserList to retrieve. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + */ + // const name = 'abc123' + + // Imports the Datamanager library + const {UserListServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListServiceClient(); + + async function callGetUserList() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datamanagerClient.getUserList(request); + console.log(response); + } + + callGetUserList(); + // [END datamanager_v1_generated_UserListService_GetUserList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_service.list_user_lists.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.list_user_lists.js new file mode 100644 index 00000000000..bf1639eae24 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.list_user_lists.js @@ -0,0 +1,101 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamanager_v1_generated_UserListService_ListUserLists_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent account which owns this collection of user lists. + * Format: accountTypes/{account_type}/accounts/{account} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of user lists to return. The service may + * return fewer than this value. If unspecified, at most 50 user lists will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListUserLists` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUserLists` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter string (//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `display_name = "list + * 1"`). + * Supported operations: + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * - `:` (has) + * Supported fields: + * - `id` + * - `display_name` + * - `description` + * - `membership_status` + * - `integration_code` + * - `access_reason` + * - `ingested_user_list_info.upload_key_types` + */ + // const filter = 'abc123' + + // Imports the Datamanager library + const {UserListServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListServiceClient(); + + async function callListUserLists() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = datamanagerClient.listUserListsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUserLists(); + // [END datamanager_v1_generated_UserListService_ListUserLists_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/samples/generated/v1/user_list_service.update_user_list.js b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.update_user_list.js new file mode 100644 index 00000000000..8b4c2e01336 --- /dev/null +++ b/packages/google-ads-datamanager/samples/generated/v1/user_list_service.update_user_list.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(userList) { + // [START datamanager_v1_generated_UserListService_UpdateUserList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The user list to update. + * The user list's `name` field is used to identify the user list to update. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + */ + // const userList = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + /** + * Optional. If true, the request is validated but not executed. + */ + // const validateOnly = true + + // Imports the Datamanager library + const {UserListServiceClient} = require('@google-ads/datamanager').v1; + + // Instantiates a client + const datamanagerClient = new UserListServiceClient(); + + async function callUpdateUserList() { + // Construct request + const request = { + userList, + }; + + // Run request + const response = await datamanagerClient.updateUserList(request); + console.log(response); + } + + callUpdateUserList(); + // [END datamanager_v1_generated_UserListService_UpdateUserList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ads-datamanager/src/index.ts b/packages/google-ads-datamanager/src/index.ts index fa151fd1fe7..f2dc3b71128 100644 --- a/packages/google-ads-datamanager/src/index.ts +++ b/packages/google-ads-datamanager/src/index.ts @@ -20,8 +20,18 @@ import * as v1 from './v1'; const IngestionServiceClient = v1.IngestionServiceClient; type IngestionServiceClient = v1.IngestionServiceClient; +const MarketingDataInsightsServiceClient = v1.MarketingDataInsightsServiceClient; +type MarketingDataInsightsServiceClient = v1.MarketingDataInsightsServiceClient; +const PartnerLinkServiceClient = v1.PartnerLinkServiceClient; +type PartnerLinkServiceClient = v1.PartnerLinkServiceClient; +const UserListDirectLicenseServiceClient = v1.UserListDirectLicenseServiceClient; +type UserListDirectLicenseServiceClient = v1.UserListDirectLicenseServiceClient; +const UserListGlobalLicenseServiceClient = v1.UserListGlobalLicenseServiceClient; +type UserListGlobalLicenseServiceClient = v1.UserListGlobalLicenseServiceClient; +const UserListServiceClient = v1.UserListServiceClient; +type UserListServiceClient = v1.UserListServiceClient; -export {v1, IngestionServiceClient}; -export default {v1, IngestionServiceClient}; +export {v1, IngestionServiceClient, MarketingDataInsightsServiceClient, PartnerLinkServiceClient, UserListDirectLicenseServiceClient, UserListGlobalLicenseServiceClient, UserListServiceClient}; +export default {v1, IngestionServiceClient, MarketingDataInsightsServiceClient, PartnerLinkServiceClient, UserListDirectLicenseServiceClient, UserListGlobalLicenseServiceClient, UserListServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-ads-datamanager/src/v1/gapic_metadata.json b/packages/google-ads-datamanager/src/v1/gapic_metadata.json index 534830bfeb4..97528f86755 100644 --- a/packages/google-ads-datamanager/src/v1/gapic_metadata.json +++ b/packages/google-ads-datamanager/src/v1/gapic_metadata.json @@ -58,6 +58,276 @@ } } } + }, + "MarketingDataInsightsService": { + "clients": { + "grpc": { + "libraryClient": "MarketingDataInsightsServiceClient", + "rpcs": { + "RetrieveInsights": { + "methods": [ + "retrieveInsights" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MarketingDataInsightsServiceClient", + "rpcs": { + "RetrieveInsights": { + "methods": [ + "retrieveInsights" + ] + } + } + } + } + }, + "PartnerLinkService": { + "clients": { + "grpc": { + "libraryClient": "PartnerLinkServiceClient", + "rpcs": { + "CreatePartnerLink": { + "methods": [ + "createPartnerLink" + ] + }, + "DeletePartnerLink": { + "methods": [ + "deletePartnerLink" + ] + }, + "SearchPartnerLinks": { + "methods": [ + "searchPartnerLinks", + "searchPartnerLinksStream", + "searchPartnerLinksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PartnerLinkServiceClient", + "rpcs": { + "CreatePartnerLink": { + "methods": [ + "createPartnerLink" + ] + }, + "DeletePartnerLink": { + "methods": [ + "deletePartnerLink" + ] + }, + "SearchPartnerLinks": { + "methods": [ + "searchPartnerLinks", + "searchPartnerLinksStream", + "searchPartnerLinksAsync" + ] + } + } + } + } + }, + "UserListDirectLicenseService": { + "clients": { + "grpc": { + "libraryClient": "UserListDirectLicenseServiceClient", + "rpcs": { + "CreateUserListDirectLicense": { + "methods": [ + "createUserListDirectLicense" + ] + }, + "GetUserListDirectLicense": { + "methods": [ + "getUserListDirectLicense" + ] + }, + "UpdateUserListDirectLicense": { + "methods": [ + "updateUserListDirectLicense" + ] + }, + "ListUserListDirectLicenses": { + "methods": [ + "listUserListDirectLicenses", + "listUserListDirectLicensesStream", + "listUserListDirectLicensesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UserListDirectLicenseServiceClient", + "rpcs": { + "CreateUserListDirectLicense": { + "methods": [ + "createUserListDirectLicense" + ] + }, + "GetUserListDirectLicense": { + "methods": [ + "getUserListDirectLicense" + ] + }, + "UpdateUserListDirectLicense": { + "methods": [ + "updateUserListDirectLicense" + ] + }, + "ListUserListDirectLicenses": { + "methods": [ + "listUserListDirectLicenses", + "listUserListDirectLicensesStream", + "listUserListDirectLicensesAsync" + ] + } + } + } + } + }, + "UserListGlobalLicenseService": { + "clients": { + "grpc": { + "libraryClient": "UserListGlobalLicenseServiceClient", + "rpcs": { + "CreateUserListGlobalLicense": { + "methods": [ + "createUserListGlobalLicense" + ] + }, + "UpdateUserListGlobalLicense": { + "methods": [ + "updateUserListGlobalLicense" + ] + }, + "GetUserListGlobalLicense": { + "methods": [ + "getUserListGlobalLicense" + ] + }, + "ListUserListGlobalLicenses": { + "methods": [ + "listUserListGlobalLicenses", + "listUserListGlobalLicensesStream", + "listUserListGlobalLicensesAsync" + ] + }, + "ListUserListGlobalLicenseCustomerInfos": { + "methods": [ + "listUserListGlobalLicenseCustomerInfos", + "listUserListGlobalLicenseCustomerInfosStream", + "listUserListGlobalLicenseCustomerInfosAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UserListGlobalLicenseServiceClient", + "rpcs": { + "CreateUserListGlobalLicense": { + "methods": [ + "createUserListGlobalLicense" + ] + }, + "UpdateUserListGlobalLicense": { + "methods": [ + "updateUserListGlobalLicense" + ] + }, + "GetUserListGlobalLicense": { + "methods": [ + "getUserListGlobalLicense" + ] + }, + "ListUserListGlobalLicenses": { + "methods": [ + "listUserListGlobalLicenses", + "listUserListGlobalLicensesStream", + "listUserListGlobalLicensesAsync" + ] + }, + "ListUserListGlobalLicenseCustomerInfos": { + "methods": [ + "listUserListGlobalLicenseCustomerInfos", + "listUserListGlobalLicenseCustomerInfosStream", + "listUserListGlobalLicenseCustomerInfosAsync" + ] + } + } + } + } + }, + "UserListService": { + "clients": { + "grpc": { + "libraryClient": "UserListServiceClient", + "rpcs": { + "GetUserList": { + "methods": [ + "getUserList" + ] + }, + "CreateUserList": { + "methods": [ + "createUserList" + ] + }, + "UpdateUserList": { + "methods": [ + "updateUserList" + ] + }, + "DeleteUserList": { + "methods": [ + "deleteUserList" + ] + }, + "ListUserLists": { + "methods": [ + "listUserLists", + "listUserListsStream", + "listUserListsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UserListServiceClient", + "rpcs": { + "GetUserList": { + "methods": [ + "getUserList" + ] + }, + "CreateUserList": { + "methods": [ + "createUserList" + ] + }, + "UpdateUserList": { + "methods": [ + "updateUserList" + ] + }, + "DeleteUserList": { + "methods": [ + "deleteUserList" + ] + }, + "ListUserLists": { + "methods": [ + "listUserLists", + "listUserListsStream", + "listUserListsAsync" + ] + } + } + } + } } } } diff --git a/packages/google-ads-datamanager/src/v1/index.ts b/packages/google-ads-datamanager/src/v1/index.ts index 7b4fc264b59..b7d57ada5bc 100644 --- a/packages/google-ads-datamanager/src/v1/index.ts +++ b/packages/google-ads-datamanager/src/v1/index.ts @@ -17,3 +17,8 @@ // ** All changes to this file may be overwritten. ** export {IngestionServiceClient} from './ingestion_service_client'; +export {MarketingDataInsightsServiceClient} from './marketing_data_insights_service_client'; +export {PartnerLinkServiceClient} from './partner_link_service_client'; +export {UserListDirectLicenseServiceClient} from './user_list_direct_license_service_client'; +export {UserListGlobalLicenseServiceClient} from './user_list_global_license_service_client'; +export {UserListServiceClient} from './user_list_service_client'; diff --git a/packages/google-ads-datamanager/src/v1/ingestion_service_client.ts b/packages/google-ads-datamanager/src/v1/ingestion_service_client.ts index 54548f713a6..30ad66231cf 100644 --- a/packages/google-ads-datamanager/src/v1/ingestion_service_client.ts +++ b/packages/google-ads-datamanager/src/v1/ingestion_service_client.ts @@ -58,6 +58,7 @@ export class IngestionServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; ingestionServiceStub?: Promise<{[name: string]: Function}>; /** @@ -172,6 +173,27 @@ export class IngestionServiceClient { // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.ads.datamanager.v1.IngestionService', gapicConfig as gax.ClientConfig, @@ -745,6 +767,267 @@ export class IngestionServiceClient { }); } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } /** * Terminate the gRPC channel and close the client. diff --git a/packages/google-ads-datamanager/src/v1/ingestion_service_proto_list.json b/packages/google-ads-datamanager/src/v1/ingestion_service_proto_list.json index fe9dcc928fc..ec5cc61b87e 100644 --- a/packages/google-ads-datamanager/src/v1/ingestion_service_proto_list.json +++ b/packages/google-ads-datamanager/src/v1/ingestion_service_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/ads/datamanager/v1/age_range.proto", "../../protos/google/ads/datamanager/v1/audience.proto", "../../protos/google/ads/datamanager/v1/cart_data.proto", "../../protos/google/ads/datamanager/v1/consent.proto", @@ -8,12 +9,26 @@ "../../protos/google/ads/datamanager/v1/error.proto", "../../protos/google/ads/datamanager/v1/event.proto", "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", "../../protos/google/ads/datamanager/v1/item_parameter.proto", "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", "../../protos/google/ads/datamanager/v1/processing_errors.proto", "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", "../../protos/google/ads/datamanager/v1/terms_of_service.proto", "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", "../../protos/google/ads/datamanager/v1/user_properties.proto" ] diff --git a/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client.ts b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client.ts new file mode 100644 index 00000000000..e2953da9aa4 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client.ts @@ -0,0 +1,737 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/marketing_data_insights_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './marketing_data_insights_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to return insights on marketing data. + * + * This feature is only available to data partners. + * @class + * @memberof v1 + */ +export class MarketingDataInsightsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('datamanager'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + marketingDataInsightsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MarketingDataInsightsServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MarketingDataInsightsServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MarketingDataInsightsServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'datamanager.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ads.datamanager.v1.MarketingDataInsightsService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.marketingDataInsightsServiceStub) { + return this.marketingDataInsightsServiceStub; + } + + // Put together the "service stub" for + // google.ads.datamanager.v1.MarketingDataInsightsService. + this.marketingDataInsightsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.ads.datamanager.v1.MarketingDataInsightsService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ads.datamanager.v1.MarketingDataInsightsService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const marketingDataInsightsServiceStubMethods = + ['retrieveInsights']; + for (const methodName of marketingDataInsightsServiceStubMethods) { + const callPromise = this.marketingDataInsightsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.marketingDataInsightsServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/datamanager' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieves marketing data insights for a given user list. + * + * This feature is only available to data partners. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent account that owns the user list. + * Format: `accountTypes/{account_type}/accounts/{account}` + * @param {google.ads.datamanager.v1.Baseline} request.baseline + * Required. Baseline for the insights requested. + * @param {string} request.userListId + * Required. The user list ID for which insights are requested. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.RetrieveInsightsResponse|RetrieveInsightsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/marketing_data_insights_service.retrieve_insights.js + * region_tag:datamanager_v1_generated_MarketingDataInsightsService_RetrieveInsights_async + */ + retrieveInsights( + request?: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|undefined, {}|undefined + ]>; + retrieveInsights( + request: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|null|undefined, + {}|null|undefined>): void; + retrieveInsights( + request: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|null|undefined, + {}|null|undefined>): void; + retrieveInsights( + request?: protos.google.ads.datamanager.v1.IRetrieveInsightsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('retrieveInsights request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('retrieveInsights response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.retrieveInsights(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IRetrieveInsightsResponse, + protos.google.ads.datamanager.v1.IRetrieveInsightsRequest|undefined, + {}|undefined + ]) => { + this._log.info('retrieveInsights response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.marketingDataInsightsServiceStub && !this._terminated) { + return this.marketingDataInsightsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client_config.json b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client_config.json new file mode 100644 index 00000000000..2c6feed7fbd --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.ads.datamanager.v1.MarketingDataInsightsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RetrieveInsights": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_proto_list.json b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_proto_list.json new file mode 100644 index 00000000000..ec5cc61b87e --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/marketing_data_insights_service_proto_list.json @@ -0,0 +1,34 @@ +[ + "../../protos/google/ads/datamanager/v1/age_range.proto", + "../../protos/google/ads/datamanager/v1/audience.proto", + "../../protos/google/ads/datamanager/v1/cart_data.proto", + "../../protos/google/ads/datamanager/v1/consent.proto", + "../../protos/google/ads/datamanager/v1/destination.proto", + "../../protos/google/ads/datamanager/v1/device_info.proto", + "../../protos/google/ads/datamanager/v1/encryption_info.proto", + "../../protos/google/ads/datamanager/v1/error.proto", + "../../protos/google/ads/datamanager/v1/event.proto", + "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", + "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", + "../../protos/google/ads/datamanager/v1/item_parameter.proto", + "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", + "../../protos/google/ads/datamanager/v1/processing_errors.proto", + "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", + "../../protos/google/ads/datamanager/v1/terms_of_service.proto", + "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", + "../../protos/google/ads/datamanager/v1/user_properties.proto" +] diff --git a/packages/google-ads-datamanager/src/v1/partner_link_service_client.ts b/packages/google-ads-datamanager/src/v1/partner_link_service_client.ts new file mode 100644 index 00000000000..091a6ea2985 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/partner_link_service_client.ts @@ -0,0 +1,1191 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/partner_link_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './partner_link_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing partner links. + * @class + * @memberof v1 + */ +export class PartnerLinkServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('datamanager'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + partnerLinkServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PartnerLinkServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PartnerLinkServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PartnerLinkServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'datamanager.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accountPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}' + ), + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + searchPartnerLinks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'partnerLinks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ads.datamanager.v1.PartnerLinkService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.partnerLinkServiceStub) { + return this.partnerLinkServiceStub; + } + + // Put together the "service stub" for + // google.ads.datamanager.v1.PartnerLinkService. + this.partnerLinkServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.ads.datamanager.v1.PartnerLinkService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ads.datamanager.v1.PartnerLinkService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const partnerLinkServiceStubMethods = + ['createPartnerLink', 'deletePartnerLink', 'searchPartnerLinks']; + for (const methodName of partnerLinkServiceStubMethods) { + const callPromise = this.partnerLinkServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.partnerLinkServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/datamanager' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a partner link for the given account. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of partner links. + * Format: accountTypes/{account_type}/accounts/{account} + * @param {google.ads.datamanager.v1.PartnerLink} request.partnerLink + * Required. The partner link to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.PartnerLink|PartnerLink}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/partner_link_service.create_partner_link.js + * region_tag:datamanager_v1_generated_PartnerLinkService_CreatePartnerLink_async + */ + createPartnerLink( + request?: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|undefined, {}|undefined + ]>; + createPartnerLink( + request: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|null|undefined, + {}|null|undefined>): void; + createPartnerLink( + request: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|null|undefined, + {}|null|undefined>): void; + createPartnerLink( + request?: protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createPartnerLink request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPartnerLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createPartnerLink(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IPartnerLink, + protos.google.ads.datamanager.v1.ICreatePartnerLinkRequest|undefined, + {}|undefined + ]) => { + this._log.info('createPartnerLink response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a partner link for the given account. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the partner link to delete. + * Format: + * accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/partner_link_service.delete_partner_link.js + * region_tag:datamanager_v1_generated_PartnerLinkService_DeletePartnerLink_async + */ + deletePartnerLink( + request?: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|undefined, {}|undefined + ]>; + deletePartnerLink( + request: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|null|undefined, + {}|null|undefined>): void; + deletePartnerLink( + request: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|null|undefined, + {}|null|undefined>): void; + deletePartnerLink( + request?: protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deletePartnerLink request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePartnerLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deletePartnerLink(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeletePartnerLinkRequest|undefined, + {}|undefined + ]) => { + this._log.info('deletePartnerLink response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Searches for all partner links to and from a given account. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Account to search for partner links. If no `filter` is specified, + * all partner links where this account is either the `owning_account` or + * `partner_account` are returned. + * + * Format: `accountTypes/{account_type}/accounts/{account}` + * @param {number} request.pageSize + * The maximum number of partner links to return. The service may return + * fewer than this value. + * If unspecified, at most 10 partner links will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `SearchPartnerLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `SearchPartnerLinks` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `partner_link_id = + * 123456789`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * + * Supported fields: + * + * - `partner_link_id` + * - `owning_account.account_type` + * - `owning_account.account_id` + * - `partner_account.account_type` + * - `partner_account.account_id` + * + * Example: + * `owning_account.account_type = "GOOGLE_ADS" OR partner_account.account_id = + * 987654321` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ads.datamanager.v1.PartnerLink|PartnerLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchPartnerLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchPartnerLinks( + request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IPartnerLink[], + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest|null, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse + ]>; + searchPartnerLinks( + request: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse|null|undefined, + protos.google.ads.datamanager.v1.IPartnerLink>): void; + searchPartnerLinks( + request: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse|null|undefined, + protos.google.ads.datamanager.v1.IPartnerLink>): void; + searchPartnerLinks( + request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse|null|undefined, + protos.google.ads.datamanager.v1.IPartnerLink>, + callback?: PaginationCallback< + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse|null|undefined, + protos.google.ads.datamanager.v1.IPartnerLink>): + Promise<[ + protos.google.ads.datamanager.v1.IPartnerLink[], + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest|null, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse|null|undefined, + protos.google.ads.datamanager.v1.IPartnerLink>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchPartnerLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchPartnerLinks request %j', request); + return this.innerApiCalls + .searchPartnerLinks(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.ads.datamanager.v1.IPartnerLink[], + protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest|null, + protos.google.ads.datamanager.v1.ISearchPartnerLinksResponse + ]) => { + this._log.info('searchPartnerLinks values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchPartnerLinks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Account to search for partner links. If no `filter` is specified, + * all partner links where this account is either the `owning_account` or + * `partner_account` are returned. + * + * Format: `accountTypes/{account_type}/accounts/{account}` + * @param {number} request.pageSize + * The maximum number of partner links to return. The service may return + * fewer than this value. + * If unspecified, at most 10 partner links will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `SearchPartnerLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `SearchPartnerLinks` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `partner_link_id = + * 123456789`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * + * Supported fields: + * + * - `partner_link_id` + * - `owning_account.account_type` + * - `owning_account.account_id` + * - `partner_account.account_type` + * - `partner_account.account_id` + * + * Example: + * `owning_account.account_type = "GOOGLE_ADS" OR partner_account.account_id = + * 987654321` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ads.datamanager.v1.PartnerLink|PartnerLink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchPartnerLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchPartnerLinksStream( + request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchPartnerLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchPartnerLinks stream %j', request); + return this.descriptors.page.searchPartnerLinks.createStream( + this.innerApiCalls.searchPartnerLinks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchPartnerLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Account to search for partner links. If no `filter` is specified, + * all partner links where this account is either the `owning_account` or + * `partner_account` are returned. + * + * Format: `accountTypes/{account_type}/accounts/{account}` + * @param {number} request.pageSize + * The maximum number of partner links to return. The service may return + * fewer than this value. + * If unspecified, at most 10 partner links will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `SearchPartnerLinks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `SearchPartnerLinks` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `partner_link_id = + * 123456789`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * + * Supported fields: + * + * - `partner_link_id` + * - `owning_account.account_type` + * - `owning_account.account_id` + * - `partner_account.account_type` + * - `partner_account.account_id` + * + * Example: + * `owning_account.account_type = "GOOGLE_ADS" OR partner_account.account_id = + * 987654321` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ads.datamanager.v1.PartnerLink|PartnerLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/partner_link_service.search_partner_links.js + * region_tag:datamanager_v1_generated_PartnerLinkService_SearchPartnerLinks_async + */ + searchPartnerLinksAsync( + request?: protos.google.ads.datamanager.v1.ISearchPartnerLinksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['searchPartnerLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchPartnerLinks iterate %j', request); + return this.descriptors.page.searchPartnerLinks.asyncIterate( + this.innerApiCalls['searchPartnerLinks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account_type + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(accountType:string,account:string) { + return this.pathTemplates.accountPathTemplate.render({ + account_type: accountType, + account: account, + }); + } + + /** + * Parse the account_type from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account_type; + } + + /** + * Parse the account from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account; + } + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.partnerLinkServiceStub && !this._terminated) { + return this.partnerLinkServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-ads-datamanager/src/v1/partner_link_service_client_config.json b/packages/google-ads-datamanager/src/v1/partner_link_service_client_config.json new file mode 100644 index 00000000000..38cbd9a3e8b --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/partner_link_service_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.ads.datamanager.v1.PartnerLinkService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePartnerLink": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePartnerLink": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchPartnerLinks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ads-datamanager/src/v1/partner_link_service_proto_list.json b/packages/google-ads-datamanager/src/v1/partner_link_service_proto_list.json new file mode 100644 index 00000000000..ec5cc61b87e --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/partner_link_service_proto_list.json @@ -0,0 +1,34 @@ +[ + "../../protos/google/ads/datamanager/v1/age_range.proto", + "../../protos/google/ads/datamanager/v1/audience.proto", + "../../protos/google/ads/datamanager/v1/cart_data.proto", + "../../protos/google/ads/datamanager/v1/consent.proto", + "../../protos/google/ads/datamanager/v1/destination.proto", + "../../protos/google/ads/datamanager/v1/device_info.proto", + "../../protos/google/ads/datamanager/v1/encryption_info.proto", + "../../protos/google/ads/datamanager/v1/error.proto", + "../../protos/google/ads/datamanager/v1/event.proto", + "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", + "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", + "../../protos/google/ads/datamanager/v1/item_parameter.proto", + "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", + "../../protos/google/ads/datamanager/v1/processing_errors.proto", + "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", + "../../protos/google/ads/datamanager/v1/terms_of_service.proto", + "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", + "../../protos/google/ads/datamanager/v1/user_properties.proto" +] diff --git a/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client.ts b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client.ts new file mode 100644 index 00000000000..d9382a2d597 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client.ts @@ -0,0 +1,1251 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/user_list_direct_license_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './user_list_direct_license_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing user list direct licenses. Delete is not a supported + * operation for UserListDirectLicenses. Callers should update the + * license status to DISABLED to instead to deactivate a license. + * + * This feature is only available to data partners. + * @class + * @memberof v1 + */ +export class UserListDirectLicenseServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('datamanager'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + userListDirectLicenseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UserListDirectLicenseServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new UserListDirectLicenseServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof UserListDirectLicenseServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'datamanager.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accountPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}' + ), + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUserListDirectLicenses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userListDirectLicenses') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ads.datamanager.v1.UserListDirectLicenseService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.userListDirectLicenseServiceStub) { + return this.userListDirectLicenseServiceStub; + } + + // Put together the "service stub" for + // google.ads.datamanager.v1.UserListDirectLicenseService. + this.userListDirectLicenseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.ads.datamanager.v1.UserListDirectLicenseService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ads.datamanager.v1.UserListDirectLicenseService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const userListDirectLicenseServiceStubMethods = + ['createUserListDirectLicense', 'getUserListDirectLicense', 'updateUserListDirectLicense', 'listUserListDirectLicenses']; + for (const methodName of userListDirectLicenseServiceStubMethods) { + const callPromise = this.userListDirectLicenseServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.userListDirectLicenseServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/datamanager' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a user list direct license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account that owns the user list being licensed. Should be in + * the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {google.ads.datamanager.v1.UserListDirectLicense} request.userListDirectLicense + * Required. The user list direct license to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_direct_license_service.create_user_list_direct_license.js + * region_tag:datamanager_v1_generated_UserListDirectLicenseService_CreateUserListDirectLicense_async + */ + createUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|undefined, {}|undefined + ]>; + createUserListDirectLicense( + request: protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + createUserListDirectLicense( + request: protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + createUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUserListDirectLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUserListDirectLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUserListDirectLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.ICreateUserListDirectLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUserListDirectLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieves a user list direct license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the user list direct license. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_direct_license_service.get_user_list_direct_license.js + * region_tag:datamanager_v1_generated_UserListDirectLicenseService_GetUserListDirectLicense_async + */ + getUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|undefined, {}|undefined + ]>; + getUserListDirectLicense( + request: protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + getUserListDirectLicense( + request: protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + getUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUserListDirectLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUserListDirectLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUserListDirectLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IGetUserListDirectLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUserListDirectLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a user list direct license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ads.datamanager.v1.UserListDirectLicense} request.userListDirectLicense + * Required. The licenses' `name` field is used to identify the license to + * update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. The special character `*` is not + * supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_direct_license_service.update_user_list_direct_license.js + * region_tag:datamanager_v1_generated_UserListDirectLicenseService_UpdateUserListDirectLicense_async + */ + updateUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|undefined, {}|undefined + ]>; + updateUserListDirectLicense( + request: protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + updateUserListDirectLicense( + request: protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): void; + updateUserListDirectLicense( + request?: protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user_list_direct_license.name': request.userListDirectLicense!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUserListDirectLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUserListDirectLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUserListDirectLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListDirectLicense, + protos.google.ads.datamanager.v1.IUpdateUserListDirectLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUserListDirectLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists all user list direct licenses owned by the parent account. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return per page. The service + * may return fewer than this value. If unspecified, at most 50 licenses will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUserListDirectLicensesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListDirectLicenses( + request?: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense[], + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse + ]>; + listUserListDirectLicenses( + request: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListDirectLicense>): void; + listUserListDirectLicenses( + request: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListDirectLicense>): void; + listUserListDirectLicenses( + request?: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListDirectLicense>, + callback?: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListDirectLicense>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListDirectLicense[], + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListDirectLicense>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUserListDirectLicenses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUserListDirectLicenses request %j', request); + return this.innerApiCalls + .listUserListDirectLicenses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.ads.datamanager.v1.IUserListDirectLicense[], + protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListDirectLicensesResponse + ]) => { + this._log.info('listUserListDirectLicenses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUserListDirectLicenses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return per page. The service + * may return fewer than this value. If unspecified, at most 50 licenses will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUserListDirectLicensesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListDirectLicensesStream( + request?: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListDirectLicenses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListDirectLicenses stream %j', request); + return this.descriptors.page.listUserListDirectLicenses.createStream( + this.innerApiCalls.listUserListDirectLicenses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUserListDirectLicenses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return per page. The service + * may return fewer than this value. If unspecified, at most 50 licenses will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ads.datamanager.v1.UserListDirectLicense|UserListDirectLicense}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_direct_license_service.list_user_list_direct_licenses.js + * region_tag:datamanager_v1_generated_UserListDirectLicenseService_ListUserListDirectLicenses_async + */ + listUserListDirectLicensesAsync( + request?: protos.google.ads.datamanager.v1.IListUserListDirectLicensesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListDirectLicenses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListDirectLicenses iterate %j', request); + return this.descriptors.page.listUserListDirectLicenses.asyncIterate( + this.innerApiCalls['listUserListDirectLicenses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account_type + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(accountType:string,account:string) { + return this.pathTemplates.accountPathTemplate.render({ + account_type: accountType, + account: account, + }); + } + + /** + * Parse the account_type from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account_type; + } + + /** + * Parse the account from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account; + } + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.userListDirectLicenseServiceStub && !this._terminated) { + return this.userListDirectLicenseServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client_config.json b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client_config.json new file mode 100644 index 00000000000..19705c3315d --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.ads.datamanager.v1.UserListDirectLicenseService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateUserListDirectLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUserListDirectLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUserListDirectLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUserListDirectLicenses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_proto_list.json b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_proto_list.json new file mode 100644 index 00000000000..ec5cc61b87e --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_direct_license_service_proto_list.json @@ -0,0 +1,34 @@ +[ + "../../protos/google/ads/datamanager/v1/age_range.proto", + "../../protos/google/ads/datamanager/v1/audience.proto", + "../../protos/google/ads/datamanager/v1/cart_data.proto", + "../../protos/google/ads/datamanager/v1/consent.proto", + "../../protos/google/ads/datamanager/v1/destination.proto", + "../../protos/google/ads/datamanager/v1/device_info.proto", + "../../protos/google/ads/datamanager/v1/encryption_info.proto", + "../../protos/google/ads/datamanager/v1/error.proto", + "../../protos/google/ads/datamanager/v1/event.proto", + "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", + "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", + "../../protos/google/ads/datamanager/v1/item_parameter.proto", + "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", + "../../protos/google/ads/datamanager/v1/processing_errors.proto", + "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", + "../../protos/google/ads/datamanager/v1/terms_of_service.proto", + "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", + "../../protos/google/ads/datamanager/v1/user_properties.proto" +] diff --git a/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client.ts b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client.ts new file mode 100644 index 00000000000..eb92cd4aea4 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client.ts @@ -0,0 +1,1548 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/user_list_global_license_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './user_list_global_license_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing user list global licenses. Delete is not a supported + * operation for UserListGlobalLicenses. Callers should update the + * license status to DISABLED to instead to deactivate a license. + * + * This feature is only available to data partners. + * @class + * @memberof v1 + */ +export class UserListGlobalLicenseServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('datamanager'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + userListGlobalLicenseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UserListGlobalLicenseServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new UserListGlobalLicenseServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof UserListGlobalLicenseServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'datamanager.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accountPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}' + ), + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUserListGlobalLicenses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userListGlobalLicenses'), + listUserListGlobalLicenseCustomerInfos: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userListGlobalLicenseCustomerInfos') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ads.datamanager.v1.UserListGlobalLicenseService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.userListGlobalLicenseServiceStub) { + return this.userListGlobalLicenseServiceStub; + } + + // Put together the "service stub" for + // google.ads.datamanager.v1.UserListGlobalLicenseService. + this.userListGlobalLicenseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.ads.datamanager.v1.UserListGlobalLicenseService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ads.datamanager.v1.UserListGlobalLicenseService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const userListGlobalLicenseServiceStubMethods = + ['createUserListGlobalLicense', 'updateUserListGlobalLicense', 'getUserListGlobalLicense', 'listUserListGlobalLicenses', 'listUserListGlobalLicenseCustomerInfos']; + for (const methodName of userListGlobalLicenseServiceStubMethods) { + const callPromise = this.userListGlobalLicenseServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.userListGlobalLicenseServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/datamanager' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a user list global license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account that owns the user list being licensed. Should be in + * the format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {google.ads.datamanager.v1.UserListGlobalLicense} request.userListGlobalLicense + * Required. The user list global license to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_global_license_service.create_user_list_global_license.js + * region_tag:datamanager_v1_generated_UserListGlobalLicenseService_CreateUserListGlobalLicense_async + */ + createUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|undefined, {}|undefined + ]>; + createUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + createUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + createUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUserListGlobalLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUserListGlobalLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUserListGlobalLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.ICreateUserListGlobalLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUserListGlobalLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a user list global license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ads.datamanager.v1.UserListGlobalLicense} request.userListGlobalLicense + * Required. The licenses' `name` field is used to identify the license to + * update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. The special character `*` is not + * supported and an `INVALID_UPDATE_MASK` error will be thrown if used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_global_license_service.update_user_list_global_license.js + * region_tag:datamanager_v1_generated_UserListGlobalLicenseService_UpdateUserListGlobalLicense_async + */ + updateUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|undefined, {}|undefined + ]>; + updateUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + updateUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + updateUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user_list_global_license.name': request.userListGlobalLicense!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUserListGlobalLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUserListGlobalLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUserListGlobalLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IUpdateUserListGlobalLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUserListGlobalLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieves a user list global license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the user list global license. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_global_license_service.get_user_list_global_license.js + * region_tag:datamanager_v1_generated_UserListGlobalLicenseService_GetUserListGlobalLicense_async + */ + getUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|undefined, {}|undefined + ]>; + getUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + getUserListGlobalLicense( + request: protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): void; + getUserListGlobalLicense( + request?: protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUserListGlobalLicense request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUserListGlobalLicense response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUserListGlobalLicense(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserListGlobalLicense, + protos.google.ads.datamanager.v1.IGetUserListGlobalLicenseRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUserListGlobalLicense response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists all user list global licenses owned by the parent account. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListGlobalLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUserListGlobalLicensesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListGlobalLicenses( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse + ]>; + listUserListGlobalLicenses( + request: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicense>): void; + listUserListGlobalLicenses( + request: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicense>): void; + listUserListGlobalLicenses( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicense>, + callback?: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicense>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicense[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicense>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUserListGlobalLicenses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUserListGlobalLicenses request %j', request); + return this.innerApiCalls + .listUserListGlobalLicenses(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.ads.datamanager.v1.IUserListGlobalLicense[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicensesResponse + ]) => { + this._log.info('listUserListGlobalLicenses values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUserListGlobalLicenses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListGlobalLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUserListGlobalLicensesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListGlobalLicensesStream( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListGlobalLicenses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListGlobalLicenses stream %j', request); + return this.descriptors.page.listUserListGlobalLicenses.createStream( + this.innerApiCalls.listUserListGlobalLicenses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUserListGlobalLicenses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account whose licenses are being queried. Should be in the + * format accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID} + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListGlobalLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ads.datamanager.v1.UserListGlobalLicense|UserListGlobalLicense}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_global_license_service.list_user_list_global_licenses.js + * region_tag:datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenses_async + */ + listUserListGlobalLicensesAsync( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicensesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListGlobalLicenses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListGlobalLicenses iterate %j', request); + return this.descriptors.page.listUserListGlobalLicenses.asyncIterate( + this.innerApiCalls['listUserListGlobalLicenses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all customer info for a user list global license. + * + * This feature is only available to data partners. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The global license whose customer info are being queried. Should + * be in the format + * `accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID}/userListGlobalLicenses/{USER_LIST_GLOBAL_LICENSE_ID}`. + * To list all global license customer info under an account, replace the user + * list global license id with a '-' (for example, + * `accountTypes/DATA_PARTNER/accounts/123/userListGlobalLicenses/-`) + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo|UserListGlobalLicenseCustomerInfo}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUserListGlobalLicenseCustomerInfosAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListGlobalLicenseCustomerInfos( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse + ]>; + listUserListGlobalLicenseCustomerInfos( + request: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo>): void; + listUserListGlobalLicenseCustomerInfos( + request: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo>): void; + listUserListGlobalLicenseCustomerInfos( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo>, + callback?: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo>): + Promise<[ + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUserListGlobalLicenseCustomerInfos values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUserListGlobalLicenseCustomerInfos request %j', request); + return this.innerApiCalls + .listUserListGlobalLicenseCustomerInfos(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[], + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest|null, + protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosResponse + ]) => { + this._log.info('listUserListGlobalLicenseCustomerInfos values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUserListGlobalLicenseCustomerInfos`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The global license whose customer info are being queried. Should + * be in the format + * `accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID}/userListGlobalLicenses/{USER_LIST_GLOBAL_LICENSE_ID}`. + * To list all global license customer info under an account, replace the user + * list global license id with a '-' (for example, + * `accountTypes/DATA_PARTNER/accounts/123/userListGlobalLicenses/-`) + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo|UserListGlobalLicenseCustomerInfo} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUserListGlobalLicenseCustomerInfosAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListGlobalLicenseCustomerInfosStream( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListGlobalLicenseCustomerInfos']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListGlobalLicenseCustomerInfos stream %j', request); + return this.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream( + this.innerApiCalls.listUserListGlobalLicenseCustomerInfos as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUserListGlobalLicenseCustomerInfos`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The global license whose customer info are being queried. Should + * be in the format + * `accountTypes/{ACCOUNT_TYPE}/accounts/{ACCOUNT_ID}/userListGlobalLicenses/{USER_LIST_GLOBAL_LICENSE_ID}`. + * To list all global license customer info under an account, replace the user + * list global license id with a '-' (for example, + * `accountTypes/DATA_PARTNER/accounts/123/userListGlobalLicenses/-`) + * @param {string} [request.filter] + * Optional. Filters to apply to the list request. All fields need to be on + * the left hand side of each condition (for example: user_list_id = 123). + * + * **Supported Operations:** + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * + * **Unsupported Fields:** + * + * - `name` (use get method instead) + * - `historical_pricings` and all its subfields + * - `pricing.start_time` + * - `pricing.end_time` + * @param {number} [request.pageSize] + * Optional. The maximum number of licenses to return. The service may return + * fewer than this value. If unspecified, at most 50 licenses will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListUserListDirectLicense` call. Provide this to retrieve the subsequent + * page. + * + * When paginating, all other parameters provided to + * `ListUserListDirectLicense` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo|UserListGlobalLicenseCustomerInfo}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_global_license_service.list_user_list_global_license_customer_infos.js + * region_tag:datamanager_v1_generated_UserListGlobalLicenseService_ListUserListGlobalLicenseCustomerInfos_async + */ + listUserListGlobalLicenseCustomerInfosAsync( + request?: protos.google.ads.datamanager.v1.IListUserListGlobalLicenseCustomerInfosRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserListGlobalLicenseCustomerInfos']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserListGlobalLicenseCustomerInfos iterate %j', request); + return this.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate( + this.innerApiCalls['listUserListGlobalLicenseCustomerInfos'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account_type + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(accountType:string,account:string) { + return this.pathTemplates.accountPathTemplate.render({ + account_type: accountType, + account: account, + }); + } + + /** + * Parse the account_type from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account_type; + } + + /** + * Parse the account from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account; + } + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.userListGlobalLicenseServiceStub && !this._terminated) { + return this.userListGlobalLicenseServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client_config.json b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client_config.json new file mode 100644 index 00000000000..c71805278ff --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.ads.datamanager.v1.UserListGlobalLicenseService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateUserListGlobalLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUserListGlobalLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUserListGlobalLicense": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUserListGlobalLicenses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUserListGlobalLicenseCustomerInfos": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ads-datamanager/src/v1/user_list_global_license_service_proto_list.json b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_proto_list.json new file mode 100644 index 00000000000..ec5cc61b87e --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_global_license_service_proto_list.json @@ -0,0 +1,34 @@ +[ + "../../protos/google/ads/datamanager/v1/age_range.proto", + "../../protos/google/ads/datamanager/v1/audience.proto", + "../../protos/google/ads/datamanager/v1/cart_data.proto", + "../../protos/google/ads/datamanager/v1/consent.proto", + "../../protos/google/ads/datamanager/v1/destination.proto", + "../../protos/google/ads/datamanager/v1/device_info.proto", + "../../protos/google/ads/datamanager/v1/encryption_info.proto", + "../../protos/google/ads/datamanager/v1/error.proto", + "../../protos/google/ads/datamanager/v1/event.proto", + "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", + "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", + "../../protos/google/ads/datamanager/v1/item_parameter.proto", + "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", + "../../protos/google/ads/datamanager/v1/processing_errors.proto", + "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", + "../../protos/google/ads/datamanager/v1/terms_of_service.proto", + "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", + "../../protos/google/ads/datamanager/v1/user_properties.proto" +] diff --git a/packages/google-ads-datamanager/src/v1/user_list_service_client.ts b/packages/google-ads-datamanager/src/v1/user_list_service_client.ts new file mode 100644 index 00000000000..7760dc4a860 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_service_client.ts @@ -0,0 +1,1419 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/user_list_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './user_list_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing UserList resources. + * @class + * @memberof v1 + */ +export class UserListServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('datamanager'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + userListServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UserListServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new UserListServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof UserListServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'datamanager.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accountPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}' + ), + partnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/partnerLinks/{partner_link}' + ), + userListPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userLists/{user_list}' + ), + userListDirectLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListDirectLicenses/{user_list_direct_license}' + ), + userListGlobalLicensePathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}' + ), + userListGlobalLicenseCustomerInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accountTypes/{account_type}/accounts/{account}/userListGlobalLicenses/{user_list_global_license}/customerInfos/{license_customer_info}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUserLists: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'userLists') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ads.datamanager.v1.UserListService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.userListServiceStub) { + return this.userListServiceStub; + } + + // Put together the "service stub" for + // google.ads.datamanager.v1.UserListService. + this.userListServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.ads.datamanager.v1.UserListService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ads.datamanager.v1.UserListService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const userListServiceStubMethods = + ['getUserList', 'listUserLists', 'createUserList', 'updateUserList', 'deleteUserList']; + for (const methodName of userListServiceStubMethods) { + const callPromise = this.userListServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.userListServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'datamanager.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/datamanager' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a UserList. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the UserList to retrieve. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserList|UserList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_service.get_user_list.js + * region_tag:datamanager_v1_generated_UserListService_GetUserList_async + */ + getUserList( + request?: protos.google.ads.datamanager.v1.IGetUserListRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|undefined, {}|undefined + ]>; + getUserList( + request: protos.google.ads.datamanager.v1.IGetUserListRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|null|undefined, + {}|null|undefined>): void; + getUserList( + request: protos.google.ads.datamanager.v1.IGetUserListRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|null|undefined, + {}|null|undefined>): void; + getUserList( + request?: protos.google.ads.datamanager.v1.IGetUserListRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUserList request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUserList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUserList(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IGetUserListRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUserList response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a UserList. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent account where this user list will be created. + * Format: accountTypes/{account_type}/accounts/{account} + * @param {google.ads.datamanager.v1.UserList} request.userList + * Required. The user list to create. + * @param {boolean} [request.validateOnly] + * Optional. If true, the request is validated but not executed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserList|UserList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_service.create_user_list.js + * region_tag:datamanager_v1_generated_UserListService_CreateUserList_async + */ + createUserList( + request?: protos.google.ads.datamanager.v1.ICreateUserListRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|undefined, {}|undefined + ]>; + createUserList( + request: protos.google.ads.datamanager.v1.ICreateUserListRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|null|undefined, + {}|null|undefined>): void; + createUserList( + request: protos.google.ads.datamanager.v1.ICreateUserListRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|null|undefined, + {}|null|undefined>): void; + createUserList( + request?: protos.google.ads.datamanager.v1.ICreateUserListRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUserList request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUserList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUserList(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.ICreateUserListRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUserList response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a UserList. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ads.datamanager.v1.UserList} request.userList + * Required. The user list to update. + * + * The user list's `name` field is used to identify the user list to update. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {boolean} [request.validateOnly] + * Optional. If true, the request is validated but not executed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ads.datamanager.v1.UserList|UserList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_service.update_user_list.js + * region_tag:datamanager_v1_generated_UserListService_UpdateUserList_async + */ + updateUserList( + request?: protos.google.ads.datamanager.v1.IUpdateUserListRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|undefined, {}|undefined + ]>; + updateUserList( + request: protos.google.ads.datamanager.v1.IUpdateUserListRequest, + options: CallOptions, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|null|undefined, + {}|null|undefined>): void; + updateUserList( + request: protos.google.ads.datamanager.v1.IUpdateUserListRequest, + callback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|null|undefined, + {}|null|undefined>): void; + updateUserList( + request?: protos.google.ads.datamanager.v1.IUpdateUserListRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user_list.name': request.userList!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUserList request %j', request); + const wrappedCallback: Callback< + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUserList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUserList(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.ads.datamanager.v1.IUserList, + protos.google.ads.datamanager.v1.IUpdateUserListRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUserList response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a UserList. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the user list to delete. + * Format: + * accountTypes/{account_type}/accounts/{account}/userLists/{user_list} + * @param {boolean} [request.validateOnly] + * Optional. If true, the request is validated but not executed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_service.delete_user_list.js + * region_tag:datamanager_v1_generated_UserListService_DeleteUserList_async + */ + deleteUserList( + request?: protos.google.ads.datamanager.v1.IDeleteUserListRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|undefined, {}|undefined + ]>; + deleteUserList( + request: protos.google.ads.datamanager.v1.IDeleteUserListRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|null|undefined, + {}|null|undefined>): void; + deleteUserList( + request: protos.google.ads.datamanager.v1.IDeleteUserListRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|null|undefined, + {}|null|undefined>): void; + deleteUserList( + request?: protos.google.ads.datamanager.v1.IDeleteUserListRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteUserList request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUserList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteUserList(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.ads.datamanager.v1.IDeleteUserListRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteUserList response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists UserLists. + * + * Authorization Headers: + * + * This method supports the following optional headers to define how the API + * authorizes access for the request: + * + * * `login-account`: (Optional) The resource name of the account where the + * Google Account of the credentials is a user. If not set, defaults to the + * account of the request. Format: + * `accountTypes/{loginAccountType}/accounts/{loginAccountId}` + * * `linked-account`: (Optional) The resource name of the account with an + * established product link to the `login-account`. Format: + * `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent account which owns this collection of user lists. + * Format: accountTypes/{account_type}/accounts/{account} + * @param {number} [request.pageSize] + * Optional. The maximum number of user lists to return. The service may + * return fewer than this value. If unspecified, at most 50 user lists will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUserLists` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUserLists` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `display_name = "list + * 1"`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * - `:` (has) + * + * Supported fields: + * + * - `id` + * - `display_name` + * - `description` + * - `membership_status` + * - `integration_code` + * - `access_reason` + * - `ingested_user_list_info.upload_key_types` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ads.datamanager.v1.UserList|UserList}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUserListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserLists( + request?: protos.google.ads.datamanager.v1.IListUserListsRequest, + options?: CallOptions): + Promise<[ + protos.google.ads.datamanager.v1.IUserList[], + protos.google.ads.datamanager.v1.IListUserListsRequest|null, + protos.google.ads.datamanager.v1.IListUserListsResponse + ]>; + listUserLists( + request: protos.google.ads.datamanager.v1.IListUserListsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListsRequest, + protos.google.ads.datamanager.v1.IListUserListsResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserList>): void; + listUserLists( + request: protos.google.ads.datamanager.v1.IListUserListsRequest, + callback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListsRequest, + protos.google.ads.datamanager.v1.IListUserListsResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserList>): void; + listUserLists( + request?: protos.google.ads.datamanager.v1.IListUserListsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListsRequest, + protos.google.ads.datamanager.v1.IListUserListsResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserList>, + callback?: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListsRequest, + protos.google.ads.datamanager.v1.IListUserListsResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserList>): + Promise<[ + protos.google.ads.datamanager.v1.IUserList[], + protos.google.ads.datamanager.v1.IListUserListsRequest|null, + protos.google.ads.datamanager.v1.IListUserListsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.ads.datamanager.v1.IListUserListsRequest, + protos.google.ads.datamanager.v1.IListUserListsResponse|null|undefined, + protos.google.ads.datamanager.v1.IUserList>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUserLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUserLists request %j', request); + return this.innerApiCalls + .listUserLists(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.ads.datamanager.v1.IUserList[], + protos.google.ads.datamanager.v1.IListUserListsRequest|null, + protos.google.ads.datamanager.v1.IListUserListsResponse + ]) => { + this._log.info('listUserLists values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUserLists`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent account which owns this collection of user lists. + * Format: accountTypes/{account_type}/accounts/{account} + * @param {number} [request.pageSize] + * Optional. The maximum number of user lists to return. The service may + * return fewer than this value. If unspecified, at most 50 user lists will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUserLists` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUserLists` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `display_name = "list + * 1"`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * - `:` (has) + * + * Supported fields: + * + * - `id` + * - `display_name` + * - `description` + * - `membership_status` + * - `integration_code` + * - `access_reason` + * - `ingested_user_list_info.upload_key_types` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ads.datamanager.v1.UserList|UserList} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUserListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUserListsStream( + request?: protos.google.ads.datamanager.v1.IListUserListsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserLists stream %j', request); + return this.descriptors.page.listUserLists.createStream( + this.innerApiCalls.listUserLists as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUserLists`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent account which owns this collection of user lists. + * Format: accountTypes/{account_type}/accounts/{account} + * @param {number} [request.pageSize] + * Optional. The maximum number of user lists to return. The service may + * return fewer than this value. If unspecified, at most 50 user lists will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUserLists` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUserLists` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A [filter string](//google.aip.dev/160). All fields need to be on + * the left hand side of each condition (for example: `display_name = "list + * 1"`). + * + * Supported operations: + * + * - `AND` + * - `=` + * - `!=` + * - `>` + * - `>=` + * - `<` + * - `<=` + * - `:` (has) + * + * Supported fields: + * + * - `id` + * - `display_name` + * - `description` + * - `membership_status` + * - `integration_code` + * - `access_reason` + * - `ingested_user_list_info.upload_key_types` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ads.datamanager.v1.UserList|UserList}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/user_list_service.list_user_lists.js + * region_tag:datamanager_v1_generated_UserListService_ListUserLists_async + */ + listUserListsAsync( + request?: protos.google.ads.datamanager.v1.IListUserListsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUserLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUserLists iterate %j', request); + return this.descriptors.page.listUserLists.asyncIterate( + this.innerApiCalls['listUserLists'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account_type + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(accountType:string,account:string) { + return this.pathTemplates.accountPathTemplate.render({ + account_type: accountType, + account: account, + }); + } + + /** + * Parse the account_type from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account_type; + } + + /** + * Parse the account from Account resource. + * + * @param {string} accountName + * A fully-qualified path representing Account resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountName(accountName: string) { + return this.pathTemplates.accountPathTemplate.match(accountName).account; + } + + /** + * Return a fully-qualified partnerLink resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} partner_link + * @returns {string} Resource name string. + */ + partnerLinkPath(accountType:string,account:string,partnerLink:string) { + return this.pathTemplates.partnerLinkPathTemplate.render({ + account_type: accountType, + account: account, + partner_link: partnerLink, + }); + } + + /** + * Parse the account_type from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account_type; + } + + /** + * Parse the account from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).account; + } + + /** + * Parse the partner_link from PartnerLink resource. + * + * @param {string} partnerLinkName + * A fully-qualified path representing PartnerLink resource. + * @returns {string} A string representing the partner_link. + */ + matchPartnerLinkFromPartnerLinkName(partnerLinkName: string) { + return this.pathTemplates.partnerLinkPathTemplate.match(partnerLinkName).partner_link; + } + + /** + * Return a fully-qualified userList resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list + * @returns {string} Resource name string. + */ + userListPath(accountType:string,account:string,userList:string) { + return this.pathTemplates.userListPathTemplate.render({ + account_type: accountType, + account: account, + user_list: userList, + }); + } + + /** + * Parse the account_type from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account_type; + } + + /** + * Parse the account from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).account; + } + + /** + * Parse the user_list from UserList resource. + * + * @param {string} userListName + * A fully-qualified path representing UserList resource. + * @returns {string} A string representing the user_list. + */ + matchUserListFromUserListName(userListName: string) { + return this.pathTemplates.userListPathTemplate.match(userListName).user_list; + } + + /** + * Return a fully-qualified userListDirectLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_direct_license + * @returns {string} Resource name string. + */ + userListDirectLicensePath(accountType:string,account:string,userListDirectLicense:string) { + return this.pathTemplates.userListDirectLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_direct_license: userListDirectLicense, + }); + } + + /** + * Parse the account_type from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account_type; + } + + /** + * Parse the account from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).account; + } + + /** + * Parse the user_list_direct_license from UserListDirectLicense resource. + * + * @param {string} userListDirectLicenseName + * A fully-qualified path representing UserListDirectLicense resource. + * @returns {string} A string representing the user_list_direct_license. + */ + matchUserListDirectLicenseFromUserListDirectLicenseName(userListDirectLicenseName: string) { + return this.pathTemplates.userListDirectLicensePathTemplate.match(userListDirectLicenseName).user_list_direct_license; + } + + /** + * Return a fully-qualified userListGlobalLicense resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @returns {string} Resource name string. + */ + userListGlobalLicensePath(accountType:string,account:string,userListGlobalLicense:string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + }); + } + + /** + * Parse the account_type from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account_type; + } + + /** + * Parse the account from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicense resource. + * + * @param {string} userListGlobalLicenseName + * A fully-qualified path representing UserListGlobalLicense resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseName(userListGlobalLicenseName: string) { + return this.pathTemplates.userListGlobalLicensePathTemplate.match(userListGlobalLicenseName).user_list_global_license; + } + + /** + * Return a fully-qualified userListGlobalLicenseCustomerInfo resource name string. + * + * @param {string} account_type + * @param {string} account + * @param {string} user_list_global_license + * @param {string} license_customer_info + * @returns {string} Resource name string. + */ + userListGlobalLicenseCustomerInfoPath(accountType:string,account:string,userListGlobalLicense:string,licenseCustomerInfo:string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render({ + account_type: accountType, + account: account, + user_list_global_license: userListGlobalLicense, + license_customer_info: licenseCustomerInfo, + }); + } + + /** + * Parse the account_type from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account_type. + */ + matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account_type; + } + + /** + * Parse the account from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).account; + } + + /** + * Parse the user_list_global_license from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the user_list_global_license. + */ + matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).user_list_global_license; + } + + /** + * Parse the license_customer_info from UserListGlobalLicenseCustomerInfo resource. + * + * @param {string} userListGlobalLicenseCustomerInfoName + * A fully-qualified path representing UserListGlobalLicenseCustomerInfo resource. + * @returns {string} A string representing the license_customer_info. + */ + matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(userListGlobalLicenseCustomerInfoName: string) { + return this.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match(userListGlobalLicenseCustomerInfoName).license_customer_info; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.userListServiceStub && !this._terminated) { + return this.userListServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-ads-datamanager/src/v1/user_list_service_client_config.json b/packages/google-ads-datamanager/src/v1/user_list_service_client_config.json new file mode 100644 index 00000000000..c8abe723125 --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.ads.datamanager.v1.UserListService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetUserList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUserLists": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUserList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUserList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUserList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ads-datamanager/src/v1/user_list_service_proto_list.json b/packages/google-ads-datamanager/src/v1/user_list_service_proto_list.json new file mode 100644 index 00000000000..ec5cc61b87e --- /dev/null +++ b/packages/google-ads-datamanager/src/v1/user_list_service_proto_list.json @@ -0,0 +1,34 @@ +[ + "../../protos/google/ads/datamanager/v1/age_range.proto", + "../../protos/google/ads/datamanager/v1/audience.proto", + "../../protos/google/ads/datamanager/v1/cart_data.proto", + "../../protos/google/ads/datamanager/v1/consent.proto", + "../../protos/google/ads/datamanager/v1/destination.proto", + "../../protos/google/ads/datamanager/v1/device_info.proto", + "../../protos/google/ads/datamanager/v1/encryption_info.proto", + "../../protos/google/ads/datamanager/v1/error.proto", + "../../protos/google/ads/datamanager/v1/event.proto", + "../../protos/google/ads/datamanager/v1/experimental_field.proto", + "../../protos/google/ads/datamanager/v1/gender.proto", + "../../protos/google/ads/datamanager/v1/ingestion_service.proto", + "../../protos/google/ads/datamanager/v1/insights_service.proto", + "../../protos/google/ads/datamanager/v1/item_parameter.proto", + "../../protos/google/ads/datamanager/v1/match_rate.proto", + "../../protos/google/ads/datamanager/v1/partner_link_service.proto", + "../../protos/google/ads/datamanager/v1/processing_errors.proto", + "../../protos/google/ads/datamanager/v1/request_status_per_destination.proto", + "../../protos/google/ads/datamanager/v1/terms_of_service.proto", + "../../protos/google/ads/datamanager/v1/user_data.proto", + "../../protos/google/ads/datamanager/v1/user_list.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_direct_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_service.proto", + "../../protos/google/ads/datamanager/v1/user_list_global_license_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_client_account_type.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_metrics.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_pricing.proto", + "../../protos/google/ads/datamanager/v1/user_list_license_status.proto", + "../../protos/google/ads/datamanager/v1/user_list_service.proto", + "../../protos/google/ads/datamanager/v1/user_properties.proto" +] diff --git a/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.js b/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.js index 09b725fb367..da1c9a355b4 100644 --- a/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.js +++ b/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.js @@ -22,6 +22,11 @@ const datamanager = require('@google-ads/datamanager'); function main() { const ingestionServiceClient = new datamanager.IngestionServiceClient(); + const marketingDataInsightsServiceClient = new datamanager.MarketingDataInsightsServiceClient(); + const partnerLinkServiceClient = new datamanager.PartnerLinkServiceClient(); + const userListDirectLicenseServiceClient = new datamanager.UserListDirectLicenseServiceClient(); + const userListGlobalLicenseServiceClient = new datamanager.UserListGlobalLicenseServiceClient(); + const userListServiceClient = new datamanager.UserListServiceClient(); } main(); diff --git a/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.ts b/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.ts index d12f8482e11..2e2810220ae 100644 --- a/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.ts +++ b/packages/google-ads-datamanager/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,47 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {IngestionServiceClient} from '@google-ads/datamanager'; +import {IngestionServiceClient, MarketingDataInsightsServiceClient, PartnerLinkServiceClient, UserListDirectLicenseServiceClient, UserListGlobalLicenseServiceClient, UserListServiceClient} from '@google-ads/datamanager'; // check that the client class type name can be used function doStuffWithIngestionServiceClient(client: IngestionServiceClient) { client.close(); } +function doStuffWithMarketingDataInsightsServiceClient(client: MarketingDataInsightsServiceClient) { + client.close(); +} +function doStuffWithPartnerLinkServiceClient(client: PartnerLinkServiceClient) { + client.close(); +} +function doStuffWithUserListDirectLicenseServiceClient(client: UserListDirectLicenseServiceClient) { + client.close(); +} +function doStuffWithUserListGlobalLicenseServiceClient(client: UserListGlobalLicenseServiceClient) { + client.close(); +} +function doStuffWithUserListServiceClient(client: UserListServiceClient) { + client.close(); +} function main() { // check that the client instance can be created const ingestionServiceClient = new IngestionServiceClient(); doStuffWithIngestionServiceClient(ingestionServiceClient); + // check that the client instance can be created + const marketingDataInsightsServiceClient = new MarketingDataInsightsServiceClient(); + doStuffWithMarketingDataInsightsServiceClient(marketingDataInsightsServiceClient); + // check that the client instance can be created + const partnerLinkServiceClient = new PartnerLinkServiceClient(); + doStuffWithPartnerLinkServiceClient(partnerLinkServiceClient); + // check that the client instance can be created + const userListDirectLicenseServiceClient = new UserListDirectLicenseServiceClient(); + doStuffWithUserListDirectLicenseServiceClient(userListDirectLicenseServiceClient); + // check that the client instance can be created + const userListGlobalLicenseServiceClient = new UserListGlobalLicenseServiceClient(); + doStuffWithUserListGlobalLicenseServiceClient(userListGlobalLicenseServiceClient); + // check that the client instance can be created + const userListServiceClient = new UserListServiceClient(); + doStuffWithUserListServiceClient(userListServiceClient); } main(); diff --git a/packages/google-ads-datamanager/test/gapic_ingestion_service_v1.ts b/packages/google-ads-datamanager/test/gapic_ingestion_service_v1.ts index 5cb6dc166e8..ab31bea65b7 100644 --- a/packages/google-ads-datamanager/test/gapic_ingestion_service_v1.ts +++ b/packages/google-ads-datamanager/test/gapic_ingestion_service_v1.ts @@ -511,4 +511,245 @@ describe('v1.IngestionServiceClient', () => { await assert.rejects(client.retrieveRequestStatus(request), expectedError); }); }); + + describe('Path templates', () => { + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new ingestionserviceModule.v1.IngestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new ingestionserviceModule.v1.IngestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new ingestionserviceModule.v1.IngestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new ingestionserviceModule.v1.IngestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new ingestionserviceModule.v1.IngestionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); }); diff --git a/packages/google-ads-datamanager/test/gapic_marketing_data_insights_service_v1.ts b/packages/google-ads-datamanager/test/gapic_marketing_data_insights_service_v1.ts new file mode 100644 index 00000000000..eabc01fa865 --- /dev/null +++ b/packages/google-ads-datamanager/test/gapic_marketing_data_insights_service_v1.ts @@ -0,0 +1,563 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as marketingdatainsightsserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1.MarketingDataInsightsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient.servicePath; + assert.strictEqual(servicePath, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.marketingDataInsightsServiceStub, undefined); + await client.initialize(); + assert(client.marketingDataInsightsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.marketingDataInsightsServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.marketingDataInsightsServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('retrieveInsights', () => { + it('invokes retrieveInsights without error', async () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.RetrieveInsightsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsResponse() + ); + client.innerApiCalls.retrieveInsights = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveInsights(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveInsights without error using callback', async () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.RetrieveInsightsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsResponse() + ); + client.innerApiCalls.retrieveInsights = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveInsights( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IRetrieveInsightsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveInsights with error', async () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.RetrieveInsightsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveInsights = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveInsights(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveInsights as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveInsights with closed client', async () => { + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.RetrieveInsightsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.RetrieveInsightsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.retrieveInsights(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new marketingdatainsightsserviceModule.v1.MarketingDataInsightsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-ads-datamanager/test/gapic_partner_link_service_v1.ts b/packages/google-ads-datamanager/test/gapic_partner_link_service_v1.ts new file mode 100644 index 00000000000..d279f6e51bd --- /dev/null +++ b/packages/google-ads-datamanager/test/gapic_partner_link_service_v1.ts @@ -0,0 +1,1001 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as partnerlinkserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.PartnerLinkServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = partnerlinkserviceModule.v1.PartnerLinkServiceClient.servicePath; + assert.strictEqual(servicePath, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = partnerlinkserviceModule.v1.PartnerLinkServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new partnerlinkserviceModule.v1.PartnerLinkServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = partnerlinkserviceModule.v1.PartnerLinkServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.partnerLinkServiceStub, undefined); + await client.initialize(); + assert(client.partnerLinkServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.partnerLinkServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.partnerLinkServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPartnerLink', () => { + it('invokes createPartnerLink without error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreatePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreatePartnerLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.PartnerLink() + ); + client.innerApiCalls.createPartnerLink = stubSimpleCall(expectedResponse); + const [response] = await client.createPartnerLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartnerLink without error using callback', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreatePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreatePartnerLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.PartnerLink() + ); + client.innerApiCalls.createPartnerLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPartnerLink( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IPartnerLink|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartnerLink with error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreatePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreatePartnerLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPartnerLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPartnerLink(request), expectedError); + const actualRequest = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartnerLink with closed client', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreatePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreatePartnerLinkRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createPartnerLink(request), expectedError); + }); + }); + + describe('deletePartnerLink', () => { + it('invokes deletePartnerLink without error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeletePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeletePartnerLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePartnerLink = stubSimpleCall(expectedResponse); + const [response] = await client.deletePartnerLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartnerLink without error using callback', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeletePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeletePartnerLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePartnerLink = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePartnerLink( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartnerLink with error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeletePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeletePartnerLinkRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePartnerLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePartnerLink(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePartnerLink as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartnerLink with closed client', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeletePartnerLinkRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeletePartnerLinkRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deletePartnerLink(request), expectedError); + }); + }); + + describe('searchPartnerLinks', () => { + it('invokes searchPartnerLinks without error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + ]; + client.innerApiCalls.searchPartnerLinks = stubSimpleCall(expectedResponse); + const [response] = await client.searchPartnerLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchPartnerLinks without error using callback', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + ]; + client.innerApiCalls.searchPartnerLinks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchPartnerLinks( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IPartnerLink[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchPartnerLinks with error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchPartnerLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchPartnerLinks(request), expectedError); + const actualRequest = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchPartnerLinks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchPartnerLinksStream without error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + ]; + client.descriptors.page.searchPartnerLinks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchPartnerLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.PartnerLink[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.PartnerLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchPartnerLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchPartnerLinks, request)); + assert( + (client.descriptors.page.searchPartnerLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchPartnerLinksStream with error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchPartnerLinks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchPartnerLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.PartnerLink[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.PartnerLink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchPartnerLinks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchPartnerLinks, request)); + assert( + (client.descriptors.page.searchPartnerLinks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchPartnerLinks without error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + generateSampleMessage(new protos.google.ads.datamanager.v1.PartnerLink()), + ]; + client.descriptors.page.searchPartnerLinks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ads.datamanager.v1.IPartnerLink[] = []; + const iterable = client.searchPartnerLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchPartnerLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchPartnerLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchPartnerLinks with error', async () => { + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.SearchPartnerLinksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.SearchPartnerLinksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchPartnerLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchPartnerLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ads.datamanager.v1.IPartnerLink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchPartnerLinks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchPartnerLinks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', async () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.accountPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath("accountTypeValue", "accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromAccountName', () => { + const result = client.matchAccountTypeFromAccountName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new partnerlinkserviceModule.v1.PartnerLinkServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-ads-datamanager/test/gapic_user_list_direct_license_service_v1.ts b/packages/google-ads-datamanager/test/gapic_user_list_direct_license_service_v1.ts new file mode 100644 index 00000000000..7a0268de80f --- /dev/null +++ b/packages/google-ads-datamanager/test/gapic_user_list_direct_license_service_v1.ts @@ -0,0 +1,1113 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as userlistdirectlicenseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.UserListDirectLicenseServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient.servicePath; + assert.strictEqual(servicePath, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListDirectLicenseServiceStub, undefined); + await client.initialize(); + assert(client.userListDirectLicenseServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.userListDirectLicenseServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListDirectLicenseServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createUserListDirectLicense', () => { + it('invokes createUserListDirectLicense without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.createUserListDirectLicense = stubSimpleCall(expectedResponse); + const [response] = await client.createUserListDirectLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListDirectLicense without error using callback', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.createUserListDirectLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUserListDirectLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListDirectLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListDirectLicense with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUserListDirectLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUserListDirectLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListDirectLicense with closed client', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListDirectLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUserListDirectLicense(request), expectedError); + }); + }); + + describe('getUserListDirectLicense', () => { + it('invokes getUserListDirectLicense without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListDirectLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.getUserListDirectLicense = stubSimpleCall(expectedResponse); + const [response] = await client.getUserListDirectLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListDirectLicense without error using callback', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListDirectLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.getUserListDirectLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUserListDirectLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListDirectLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListDirectLicense with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListDirectLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserListDirectLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUserListDirectLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListDirectLicense with closed client', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListDirectLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListDirectLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUserListDirectLicense(request), expectedError); + }); + }); + + describe('updateUserListDirectLicense', () => { + it('invokes updateUserListDirectLicense without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest() + ); + request.userListDirectLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest', ['userListDirectLicense', 'name']); + request.userListDirectLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_direct_license.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.updateUserListDirectLicense = stubSimpleCall(expectedResponse); + const [response] = await client.updateUserListDirectLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListDirectLicense without error using callback', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest() + ); + request.userListDirectLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest', ['userListDirectLicense', 'name']); + request.userListDirectLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_direct_license.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListDirectLicense() + ); + client.innerApiCalls.updateUserListDirectLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUserListDirectLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListDirectLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListDirectLicense with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest() + ); + request.userListDirectLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest', ['userListDirectLicense', 'name']); + request.userListDirectLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_direct_license.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserListDirectLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUserListDirectLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListDirectLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListDirectLicense with closed client', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest() + ); + request.userListDirectLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListDirectLicenseRequest', ['userListDirectLicense', 'name']); + request.userListDirectLicense.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUserListDirectLicense(request), expectedError); + }); + }); + + describe('listUserListDirectLicenses', () => { + it('invokes listUserListDirectLicenses without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + ]; + client.innerApiCalls.listUserListDirectLicenses = stubSimpleCall(expectedResponse); + const [response] = await client.listUserListDirectLicenses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListDirectLicenses without error using callback', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + ]; + client.innerApiCalls.listUserListDirectLicenses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUserListDirectLicenses( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListDirectLicense[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListDirectLicenses with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserListDirectLicenses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserListDirectLicenses(request), expectedError); + const actualRequest = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListDirectLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListDirectLicensesStream without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + ]; + client.descriptors.page.listUserListDirectLicenses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUserListDirectLicensesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListDirectLicense[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListDirectLicense) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUserListDirectLicenses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListDirectLicenses, request)); + assert( + (client.descriptors.page.listUserListDirectLicenses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUserListDirectLicensesStream with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListDirectLicenses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUserListDirectLicensesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListDirectLicense[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListDirectLicense) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUserListDirectLicenses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListDirectLicenses, request)); + assert( + (client.descriptors.page.listUserListDirectLicenses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListDirectLicenses without error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListDirectLicense()), + ]; + client.descriptors.page.listUserListDirectLicenses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ads.datamanager.v1.IUserListDirectLicense[] = []; + const iterable = client.listUserListDirectLicensesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUserListDirectLicenses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListDirectLicenses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListDirectLicenses with error', async () => { + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListDirectLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListDirectLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListDirectLicenses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUserListDirectLicensesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ads.datamanager.v1.IUserListDirectLicense[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUserListDirectLicenses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListDirectLicenses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', async () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.accountPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath("accountTypeValue", "accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromAccountName', () => { + const result = client.matchAccountTypeFromAccountName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new userlistdirectlicenseserviceModule.v1.UserListDirectLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-ads-datamanager/test/gapic_user_list_global_license_service_v1.ts b/packages/google-ads-datamanager/test/gapic_user_list_global_license_service_v1.ts new file mode 100644 index 00000000000..22cc88ec5fb --- /dev/null +++ b/packages/google-ads-datamanager/test/gapic_user_list_global_license_service_v1.ts @@ -0,0 +1,1358 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as userlistgloballicenseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.UserListGlobalLicenseServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient.servicePath; + assert.strictEqual(servicePath, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListGlobalLicenseServiceStub, undefined); + await client.initialize(); + assert(client.userListGlobalLicenseServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.userListGlobalLicenseServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListGlobalLicenseServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createUserListGlobalLicense', () => { + it('invokes createUserListGlobalLicense without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.createUserListGlobalLicense = stubSimpleCall(expectedResponse); + const [response] = await client.createUserListGlobalLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListGlobalLicense without error using callback', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.createUserListGlobalLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUserListGlobalLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListGlobalLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListGlobalLicense with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUserListGlobalLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUserListGlobalLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserListGlobalLicense with closed client', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListGlobalLicenseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUserListGlobalLicense(request), expectedError); + }); + }); + + describe('updateUserListGlobalLicense', () => { + it('invokes updateUserListGlobalLicense without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest() + ); + request.userListGlobalLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest', ['userListGlobalLicense', 'name']); + request.userListGlobalLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_global_license.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.updateUserListGlobalLicense = stubSimpleCall(expectedResponse); + const [response] = await client.updateUserListGlobalLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListGlobalLicense without error using callback', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest() + ); + request.userListGlobalLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest', ['userListGlobalLicense', 'name']); + request.userListGlobalLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_global_license.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.updateUserListGlobalLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUserListGlobalLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListGlobalLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListGlobalLicense with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest() + ); + request.userListGlobalLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest', ['userListGlobalLicense', 'name']); + request.userListGlobalLicense.name = defaultValue1; + const expectedHeaderRequestParams = `user_list_global_license.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserListGlobalLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUserListGlobalLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserListGlobalLicense with closed client', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest() + ); + request.userListGlobalLicense ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListGlobalLicenseRequest', ['userListGlobalLicense', 'name']); + request.userListGlobalLicense.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUserListGlobalLicense(request), expectedError); + }); + }); + + describe('getUserListGlobalLicense', () => { + it('invokes getUserListGlobalLicense without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.getUserListGlobalLicense = stubSimpleCall(expectedResponse); + const [response] = await client.getUserListGlobalLicense(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListGlobalLicense without error using callback', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserListGlobalLicense() + ); + client.innerApiCalls.getUserListGlobalLicense = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUserListGlobalLicense( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListGlobalLicense|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListGlobalLicense with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserListGlobalLicense = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUserListGlobalLicense(request), expectedError); + const actualRequest = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserListGlobalLicense as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserListGlobalLicense with closed client', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListGlobalLicenseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUserListGlobalLicense(request), expectedError); + }); + }); + + describe('listUserListGlobalLicenses', () => { + it('invokes listUserListGlobalLicenses without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + ]; + client.innerApiCalls.listUserListGlobalLicenses = stubSimpleCall(expectedResponse); + const [response] = await client.listUserListGlobalLicenses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicenses without error using callback', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + ]; + client.innerApiCalls.listUserListGlobalLicenses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUserListGlobalLicenses( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListGlobalLicense[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicenses with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserListGlobalLicenses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserListGlobalLicenses(request), expectedError); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicensesStream without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + ]; + client.descriptors.page.listUserListGlobalLicenses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUserListGlobalLicensesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListGlobalLicense[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListGlobalLicense) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUserListGlobalLicenses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListGlobalLicenses, request)); + assert( + (client.descriptors.page.listUserListGlobalLicenses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUserListGlobalLicensesStream with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListGlobalLicenses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUserListGlobalLicensesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListGlobalLicense[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListGlobalLicense) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUserListGlobalLicenses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListGlobalLicenses, request)); + assert( + (client.descriptors.page.listUserListGlobalLicenses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListGlobalLicenses without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicense()), + ]; + client.descriptors.page.listUserListGlobalLicenses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ads.datamanager.v1.IUserListGlobalLicense[] = []; + const iterable = client.listUserListGlobalLicensesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUserListGlobalLicenses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListGlobalLicenses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListGlobalLicenses with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicensesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListGlobalLicenses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUserListGlobalLicensesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ads.datamanager.v1.IUserListGlobalLicense[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUserListGlobalLicenses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListGlobalLicenses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUserListGlobalLicenseCustomerInfos', () => { + it('invokes listUserListGlobalLicenseCustomerInfos without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + ]; + client.innerApiCalls.listUserListGlobalLicenseCustomerInfos = stubSimpleCall(expectedResponse); + const [response] = await client.listUserListGlobalLicenseCustomerInfos(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicenseCustomerInfos without error using callback', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + ]; + client.innerApiCalls.listUserListGlobalLicenseCustomerInfos = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUserListGlobalLicenseCustomerInfos( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicenseCustomerInfos with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserListGlobalLicenseCustomerInfos = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserListGlobalLicenseCustomerInfos(request), expectedError); + const actualRequest = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserListGlobalLicenseCustomerInfos as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListGlobalLicenseCustomerInfosStream without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + ]; + client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUserListGlobalLicenseCustomerInfosStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListGlobalLicenseCustomerInfos, request)); + assert( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUserListGlobalLicenseCustomerInfosStream with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUserListGlobalLicenseCustomerInfosStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserListGlobalLicenseCustomerInfos, request)); + assert( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListGlobalLicenseCustomerInfos without error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserListGlobalLicenseCustomerInfo()), + ]; + client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[] = []; + const iterable = client.listUserListGlobalLicenseCustomerInfosAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserListGlobalLicenseCustomerInfos with error', async () => { + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListGlobalLicenseCustomerInfosRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUserListGlobalLicenseCustomerInfosAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ads.datamanager.v1.IUserListGlobalLicenseCustomerInfo[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserListGlobalLicenseCustomerInfos.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', async () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.accountPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath("accountTypeValue", "accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromAccountName', () => { + const result = client.matchAccountTypeFromAccountName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new userlistgloballicenseserviceModule.v1.UserListGlobalLicenseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-ads-datamanager/test/gapic_user_list_service_v1.ts b/packages/google-ads-datamanager/test/gapic_user_list_service_v1.ts new file mode 100644 index 00000000000..be3072a90ac --- /dev/null +++ b/packages/google-ads-datamanager/test/gapic_user_list_service_v1.ts @@ -0,0 +1,1221 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as userlistserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.UserListServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new userlistserviceModule.v1.UserListServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new userlistserviceModule.v1.UserListServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = userlistserviceModule.v1.UserListServiceClient.servicePath; + assert.strictEqual(servicePath, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = userlistserviceModule.v1.UserListServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'datamanager.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new userlistserviceModule.v1.UserListServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new userlistserviceModule.v1.UserListServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistserviceModule.v1.UserListServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new userlistserviceModule.v1.UserListServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'datamanager.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new userlistserviceModule.v1.UserListServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = userlistserviceModule.v1.UserListServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new userlistserviceModule.v1.UserListServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListServiceStub, undefined); + await client.initialize(); + assert(client.userListServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.userListServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userListServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getUserList', () => { + it('invokes getUserList without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.getUserList = stubSimpleCall(expectedResponse); + const [response] = await client.getUserList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserList without error using callback', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.getUserList = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUserList( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserList|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserList with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUserList = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUserList(request), expectedError); + const actualRequest = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUserList with closed client', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.GetUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.GetUserListRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUserList(request), expectedError); + }); + }); + + describe('createUserList', () => { + it('invokes createUserList without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.createUserList = stubSimpleCall(expectedResponse); + const [response] = await client.createUserList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserList without error using callback', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.createUserList = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUserList( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserList|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserList with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUserList = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUserList(request), expectedError); + const actualRequest = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUserList with closed client', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.CreateUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.CreateUserListRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUserList(request), expectedError); + }); + }); + + describe('updateUserList', () => { + it('invokes updateUserList without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListRequest() + ); + request.userList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListRequest', ['userList', 'name']); + request.userList.name = defaultValue1; + const expectedHeaderRequestParams = `user_list.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.updateUserList = stubSimpleCall(expectedResponse); + const [response] = await client.updateUserList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserList without error using callback', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListRequest() + ); + request.userList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListRequest', ['userList', 'name']); + request.userList.name = defaultValue1; + const expectedHeaderRequestParams = `user_list.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.ads.datamanager.v1.UserList() + ); + client.innerApiCalls.updateUserList = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUserList( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserList|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserList with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListRequest() + ); + request.userList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListRequest', ['userList', 'name']); + request.userList.name = defaultValue1; + const expectedHeaderRequestParams = `user_list.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUserList = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUserList(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUserList with closed client', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.UpdateUserListRequest() + ); + request.userList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.UpdateUserListRequest', ['userList', 'name']); + request.userList.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUserList(request), expectedError); + }); + }); + + describe('deleteUserList', () => { + it('invokes deleteUserList without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeleteUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeleteUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUserList = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUserList(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUserList without error using callback', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeleteUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeleteUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUserList = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUserList( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUserList with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeleteUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeleteUserListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUserList = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUserList(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUserList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUserList with closed client', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.DeleteUserListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.DeleteUserListRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteUserList(request), expectedError); + }); + }); + + describe('listUserLists', () => { + it('invokes listUserLists without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + ]; + client.innerApiCalls.listUserLists = stubSimpleCall(expectedResponse); + const [response] = await client.listUserLists(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserLists without error using callback', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + ]; + client.innerApiCalls.listUserLists = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUserLists( + request, + (err?: Error|null, result?: protos.google.ads.datamanager.v1.IUserList[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserLists with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUserLists = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUserLists(request), expectedError); + const actualRequest = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUserLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUserListsStream without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + ]; + client.descriptors.page.listUserLists.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUserListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserList[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserList) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUserLists.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserLists, request)); + assert( + (client.descriptors.page.listUserLists.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUserListsStream with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserLists.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUserListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ads.datamanager.v1.UserList[] = []; + stream.on('data', (response: protos.google.ads.datamanager.v1.UserList) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUserLists.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUserLists, request)); + assert( + (client.descriptors.page.listUserLists.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserLists without error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + generateSampleMessage(new protos.google.ads.datamanager.v1.UserList()), + ]; + client.descriptors.page.listUserLists.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ads.datamanager.v1.IUserList[] = []; + const iterable = client.listUserListsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUserLists.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserLists.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUserLists with error', async () => { + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.ads.datamanager.v1.ListUserListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.ads.datamanager.v1.ListUserListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUserLists.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUserListsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ads.datamanager.v1.IUserList[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUserLists.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUserLists.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', async () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.accountPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accountPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath("accountTypeValue", "accountValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromAccountName', () => { + const result = client.matchAccountTypeFromAccountName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('partnerLink', async () => { + const fakePath = "/rendered/path/partnerLink"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + partner_link: "partnerLinkValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.partnerLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.partnerLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('partnerLinkPath', () => { + const result = client.partnerLinkPath("accountTypeValue", "accountValue", "partnerLinkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.partnerLinkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromPartnerLinkName', () => { + const result = client.matchAccountTypeFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromPartnerLinkName', () => { + const result = client.matchAccountFromPartnerLinkName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPartnerLinkFromPartnerLinkName', () => { + const result = client.matchPartnerLinkFromPartnerLinkName(fakePath); + assert.strictEqual(result, "partnerLinkValue"); + assert((client.pathTemplates.partnerLinkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userList', async () => { + const fakePath = "/rendered/path/userList"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list: "userListValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListPath', () => { + const result = client.userListPath("accountTypeValue", "accountValue", "userListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListName', () => { + const result = client.matchAccountTypeFromUserListName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListName', () => { + const result = client.matchAccountFromUserListName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListFromUserListName', () => { + const result = client.matchUserListFromUserListName(fakePath); + assert.strictEqual(result, "userListValue"); + assert((client.pathTemplates.userListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListDirectLicense', async () => { + const fakePath = "/rendered/path/userListDirectLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_direct_license: "userListDirectLicenseValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListDirectLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListDirectLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListDirectLicensePath', () => { + const result = client.userListDirectLicensePath("accountTypeValue", "accountValue", "userListDirectLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListDirectLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListDirectLicenseName', () => { + const result = client.matchAccountTypeFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListDirectLicenseName', () => { + const result = client.matchAccountFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListDirectLicenseFromUserListDirectLicenseName', () => { + const result = client.matchUserListDirectLicenseFromUserListDirectLicenseName(fakePath); + assert.strictEqual(result, "userListDirectLicenseValue"); + assert((client.pathTemplates.userListDirectLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicense', async () => { + const fakePath = "/rendered/path/userListGlobalLicense"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicensePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicensePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicensePath', () => { + const result = client.userListGlobalLicensePath("accountTypeValue", "accountValue", "userListGlobalLicenseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseName', () => { + const result = client.matchAccountFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicensePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('userListGlobalLicenseCustomerInfo', async () => { + const fakePath = "/rendered/path/userListGlobalLicenseCustomerInfo"; + const expectedParameters = { + account_type: "accountTypeValue", + account: "accountValue", + user_list_global_license: "userListGlobalLicenseValue", + license_customer_info: "licenseCustomerInfoValue", + }; + const client = new userlistserviceModule.v1.UserListServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userListGlobalLicenseCustomerInfoPath', () => { + const result = client.userListGlobalLicenseCustomerInfoPath("accountTypeValue", "accountValue", "userListGlobalLicenseValue", "licenseCustomerInfoValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccountTypeFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountTypeFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountTypeValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccountFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchAccountFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "accountValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchUserListGlobalLicenseFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "userListGlobalLicenseValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName', () => { + const result = client.matchLicenseCustomerInfoFromUserListGlobalLicenseCustomerInfoName(fakePath); + assert.strictEqual(result, "licenseCustomerInfoValue"); + assert((client.pathTemplates.userListGlobalLicenseCustomerInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +});