diff --git a/packages/google-shopping-merchant-accounts/README.md b/packages/google-shopping-merchant-accounts/README.md index 8b3e4838b13..8f0d1912481 100644 --- a/packages/google-shopping-merchant-accounts/README.md +++ b/packages/google-shopping-merchant-accounts/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Merchant API API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -124,6 +124,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Accounts_service.list_accounts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.list_accounts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.list_accounts.js,packages/google-shopping-merchant-accounts/samples/README.md) | | Accounts_service.list_sub_accounts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.list_sub_accounts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.list_sub_accounts.js,packages/google-shopping-merchant-accounts/samples/README.md) | | Accounts_service.update_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.update_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.update_account.js,packages/google-shopping-merchant-accounts/samples/README.md) | +| Autofeed_settings_service.get_autofeed_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js,packages/google-shopping-merchant-accounts/samples/README.md) | +| Autofeed_settings_service.update_autofeed_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js,packages/google-shopping-merchant-accounts/samples/README.md) | | Business_identity_service.get_business_identity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_identity_service.get_business_identity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_identity_service.get_business_identity.js,packages/google-shopping-merchant-accounts/samples/README.md) | | Business_identity_service.update_business_identity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_identity_service.update_business_identity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_identity_service.update_business_identity.js,packages/google-shopping-merchant-accounts/samples/README.md) | | Business_info_service.get_business_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_info_service.get_business_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_info_service.get_business_info.js,packages/google-shopping-merchant-accounts/samples/README.md) | @@ -226,4 +228,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=merchantapi.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto index a6329d76ed2..8651baa5a2a 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto @@ -21,7 +21,6 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/shopping/type/types.proto"; -import "google/type/datetime.proto"; option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; option java_multiple_files = true; @@ -142,7 +141,7 @@ message ListAccountIssuesRequest { // Optional. The [IANA](https://www.iana.org/time-zones) timezone used to // localize times in human-readable fields. For example 'America/Los_Angeles'. // If not set, 'America/Los_Angeles' will be used. - google.type.TimeZone time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; } // Response message for the `ListAccountIssues` method. diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accounts.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accounts.proto index c223bcdfeaf..63a51cc07d4 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accounts.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accounts.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/shopping/merchant/accounts/v1beta/accountservices.proto"; import "google/shopping/merchant/accounts/v1beta/user.proto"; import "google/type/datetime.proto"; @@ -156,7 +157,10 @@ message GetAccountRequest { message CreateAndConfigureAccountRequest { // Reference to a Terms of Service resource. message AcceptTermsOfService { - // Required. The resource name of the terms of service version. + // Required. The resource name of the terms of service version in the format + // `termsOfService/{version}`. To retrieve the latest version, use the + // [termsOfService.retrieveLatest](/merchant/api/reference/rest/accounts_v1beta/termsOfService/retrieveLatest) + // method. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -173,12 +177,12 @@ message CreateAndConfigureAccountRequest { // Additional instructions to add account services during creation of the // account. message AddAccountService { - // Currently only supports - // [Multi-client](https://support.google.com/merchants/answer/188487) - // parent account type. + // The service type to be added. oneof service_type { - // The provider is an aggregator for the account. - google.protobuf.Empty account_aggregation = 2; + // The provider is an + // [aggregator](https://support.google.com/merchants/answer/188487) for + // the account. Payload for service type Account Aggregation. + AccountAggregation account_aggregation = 103; } // Optional. The provider of the service. @@ -202,11 +206,14 @@ message CreateAndConfigureAccountRequest { optional AcceptTermsOfService accept_terms_of_service = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If specified, an account service between the account to be - // created and the provider account is initialized as part of the - // creation. + // Required. An account service between the account to be created and the + // provider account is initialized as part of the creation. At least one such + // service needs to be provided. Currently exactly one of these needs to be + // `account_aggregation`, which means you can only create sub accounts, not + // standalone account through this method. Additional `account_management` or + // `product_management` services may be provided. repeated AddAccountService service = 4 - [(google.api.field_behavior) = OPTIONAL]; + [(google.api.field_behavior) = REQUIRED]; } // Request message for the `DeleteAccount` method. diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto new file mode 100644 index 00000000000..daeb15f3a98 --- /dev/null +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto @@ -0,0 +1,30 @@ +// Copyright 2024 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.shopping.merchant.accounts.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountServicesProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// `AccountAggregation` payload. +message AccountAggregation {} diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto new file mode 100644 index 00000000000..f6e0c1b3631 --- /dev/null +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto @@ -0,0 +1,106 @@ +// Copyright 2024 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.shopping.merchant.accounts.v1beta; + +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 go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AutofeedSettingsProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support +// [autofeed](https://support.google.com/merchants/answer/7538732) setting. +service AutofeedSettingsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the autofeed settings of an account. + rpc GetAutofeedSettings(GetAutofeedSettingsRequest) + returns (AutofeedSettings) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/autofeedSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the autofeed settings of an account. + rpc UpdateAutofeedSettings(UpdateAutofeedSettingsRequest) + returns (AutofeedSettings) { + option (google.api.http) = { + patch: "/accounts/v1beta/{autofeed_settings.name=accounts/*/autofeedSettings}" + body: "autofeed_settings" + }; + option (google.api.method_signature) = "autofeed_settings,update_mask"; + } +} + +// Collection of information related to the +// [autofeed](https://support.google.com/merchants/answer/7538732) settings. +message AutofeedSettings { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/AutofeedSettings" + pattern: "accounts/{account}/autofeedSettings" + plural: "autofeedSettings" + singular: "autofeedSettings" + }; + + // Identifier. The resource name of the autofeed settings. + // Format: `accounts/{account}/autofeedSettings`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Enables or disables product crawling through the autofeed for the + // given account. Autofeed accounts must meet [certain + // conditions](https://support.google.com/merchants/answer/7538732#Configure_automated_feeds_Standard_Experience), + // which can be checked through the `eligible` field. + // The account must **not** be a marketplace. + // When the autofeed is enabled for the first time, the products usually + // appear instantly. When re-enabling, it might take up to 24 hours for + // products to appear. + bool enable_products = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Determines whether merchant is eligible for being enrolled + // into an autofeed. + bool eligible = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the `GetAutofeedSettings` method. +message GetAutofeedSettingsRequest { + // Required. The resource name of the autofeed settings. + // Format: `accounts/{account}/autofeedSettings` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/AutofeedSettings" + } + ]; +} + +// Request message for the `UpdateAutofeedSettings` method. +message UpdateAutofeedSettingsRequest { + // Required. The new version of the autofeed setting. + AutofeedSettings autofeed_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto index f2cfed816d6..b040b3d1073 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto @@ -83,6 +83,12 @@ message BusinessInfo { // Optional. The customer service of the business. optional CustomerService customer_service = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The 10-digit [Korean business registration + // number](https://support.google.com/merchants/answer/9037766) separated with + // dashes in the format: XXX-XX-XXXXX. + optional string korean_business_registration_number = 6 + [(google.api.field_behavior) = OPTIONAL]; } // Request message for the `GetBusinessInfo` method. diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto index 73b8a3dd6a1..a7fac4a8a24 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto @@ -54,7 +54,7 @@ service ShippingSettingsService { } // The merchant account's [shipping -// setting]((https://support.google.com/merchants/answer/6069284). +// setting](https://support.google.com/merchants/answer/6069284). message ShippingSettings { option (google.api.resource) = { type: "merchantapi.googleapis.com/ShippingSettings" @@ -355,11 +355,15 @@ message DeliveryTime { // Minimum number of business days spent before an order is shipped. // 0 means same day shipped, 1 means next day shipped. + // 'min_handling_days' and 'max_handling_days' should be either set or not set + // at the same time. optional int32 min_handling_days = 4; // Maximum number of business days spent before an order is shipped. // 0 means same day shipped, 1 means next day shipped. // Must be greater than or equal to `min_handling_days`. + // 'min_handling_days' and 'max_handling_days' should be either set or not set + // at the same time. optional int32 max_handling_days = 5; // Transit time table, number of business days spent in transit based on row diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto index 549a3a941f4..86c0c37aaaf 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto @@ -110,13 +110,13 @@ message GetTermsOfServiceRequest { // Request message for the `RetrieveLatestTermsOfService` method. message RetrieveLatestTermsOfServiceRequest { - // Region code as defined by [CLDR](https://cldr.unicode.org/). This is either - // a country when the ToS applies specifically to that country or 001 when it - // applies globally. - string region_code = 1; + // Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + // is either a country when the ToS applies specifically to that country or + // 001 when it applies globally. + string region_code = 1 [(google.api.field_behavior) = REQUIRED]; - // The Kind this terms of service version applies to. - TermsOfServiceKind kind = 2; + // Required. The Kind this terms of service version applies to. + TermsOfServiceKind kind = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for the `AcceptTermsOfService` method. diff --git a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto index 3d3b76f2310..df3d93436d2 100644 --- a/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto +++ b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto @@ -85,6 +85,8 @@ message TermsOfServiceAgreementState { // Identifier. The resource name of the terms of service version. // Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + // The identifier format is: `{TermsOfServiceKind}-{country}` + // For example, an identifier could be: `MERCHANT_CENTER-US` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Region code as defined by https://cldr.unicode.org/. This is the @@ -144,6 +146,7 @@ message Required { message GetTermsOfServiceAgreementStateRequest { // Required. The resource name of the terms of service version. // Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + // The identifier format is: `{TermsOfServiceKind}-{country}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-shopping-merchant-accounts/protos/protos.d.ts b/packages/google-shopping-merchant-accounts/protos/protos.d.ts index e71a3a36d77..8e601a6f974 100644 --- a/packages/google-shopping-merchant-accounts/protos/protos.d.ts +++ b/packages/google-shopping-merchant-accounts/protos/protos.d.ts @@ -1301,7 +1301,7 @@ export namespace google { languageCode?: (string|null); /** ListAccountIssuesRequest timeZone */ - timeZone?: (google.type.ITimeZone|null); + timeZone?: (string|null); } /** Represents a ListAccountIssuesRequest. */ @@ -1326,7 +1326,7 @@ export namespace google { public languageCode: string; /** ListAccountIssuesRequest timeZone. */ - public timeZone?: (google.type.ITimeZone|null); + public timeZone: string; /** * Creates a new ListAccountIssuesRequest instance using the specified properties. @@ -2116,7 +2116,7 @@ export namespace google { interface IAddAccountService { /** AddAccountService accountAggregation */ - accountAggregation?: (google.protobuf.IEmpty|null); + accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); /** AddAccountService provider */ provider?: (string|null); @@ -2132,7 +2132,7 @@ export namespace google { constructor(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService); /** AddAccountService accountAggregation. */ - public accountAggregation?: (google.protobuf.IEmpty|null); + public accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); /** AddAccountService provider. */ public provider?: (string|null); @@ -2846,6 +2846,97 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AccountAggregation. */ + interface IAccountAggregation { + } + + /** Represents an AccountAggregation. */ + class AccountAggregation implements IAccountAggregation { + + /** + * Constructs a new AccountAggregation. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccountAggregation); + + /** + * Creates a new AccountAggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAggregation instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccountAggregation): google.shopping.merchant.accounts.v1beta.AccountAggregation; + + /** + * Encodes the specified AccountAggregation message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountAggregation.verify|verify} messages. + * @param message AccountAggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAccountAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountAggregation message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountAggregation.verify|verify} messages. + * @param message AccountAggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccountAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountAggregation + * @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.shopping.merchant.accounts.v1beta.AccountAggregation; + + /** + * Decodes an AccountAggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountAggregation + * @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.shopping.merchant.accounts.v1beta.AccountAggregation; + + /** + * Verifies an AccountAggregation 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 AccountAggregation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountAggregation + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountAggregation; + + /** + * Creates a plain object from an AccountAggregation message. Also converts values to other types if specified. + * @param message AccountAggregation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountAggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountAggregation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountAggregation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a UserService */ class UserService extends $protobuf.rpc.Service { @@ -3712,6 +3803,381 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Represents an AutofeedSettingsService */ + class AutofeedSettingsService extends $protobuf.rpc.Service { + + /** + * Constructs a new AutofeedSettingsService 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 AutofeedSettingsService 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): AutofeedSettingsService; + + /** + * Calls GetAutofeedSettings. + * @param request GetAutofeedSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutofeedSettings + */ + public getAutofeedSettings(request: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.GetAutofeedSettingsCallback): void; + + /** + * Calls GetAutofeedSettings. + * @param request GetAutofeedSettingsRequest message or plain object + * @returns Promise + */ + public getAutofeedSettings(request: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest): Promise; + + /** + * Calls UpdateAutofeedSettings. + * @param request UpdateAutofeedSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutofeedSettings + */ + public updateAutofeedSettings(request: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.UpdateAutofeedSettingsCallback): void; + + /** + * Calls UpdateAutofeedSettings. + * @param request UpdateAutofeedSettingsRequest message or plain object + * @returns Promise + */ + public updateAutofeedSettings(request: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest): Promise; + } + + namespace AutofeedSettingsService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AutofeedSettingsService|getAutofeedSettings}. + * @param error Error, if any + * @param [response] AutofeedSettings + */ + type GetAutofeedSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AutofeedSettings) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AutofeedSettingsService|updateAutofeedSettings}. + * @param error Error, if any + * @param [response] AutofeedSettings + */ + type UpdateAutofeedSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AutofeedSettings) => void; + } + + /** Properties of an AutofeedSettings. */ + interface IAutofeedSettings { + + /** AutofeedSettings name */ + name?: (string|null); + + /** AutofeedSettings enableProducts */ + enableProducts?: (boolean|null); + + /** AutofeedSettings eligible */ + eligible?: (boolean|null); + } + + /** Represents an AutofeedSettings. */ + class AutofeedSettings implements IAutofeedSettings { + + /** + * Constructs a new AutofeedSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAutofeedSettings); + + /** AutofeedSettings name. */ + public name: string; + + /** AutofeedSettings enableProducts. */ + public enableProducts: boolean; + + /** AutofeedSettings eligible. */ + public eligible: boolean; + + /** + * Creates a new AutofeedSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AutofeedSettings instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAutofeedSettings): google.shopping.merchant.accounts.v1beta.AutofeedSettings; + + /** + * Encodes the specified AutofeedSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AutofeedSettings.verify|verify} messages. + * @param message AutofeedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAutofeedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutofeedSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AutofeedSettings.verify|verify} messages. + * @param message AutofeedSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAutofeedSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutofeedSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutofeedSettings + * @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.shopping.merchant.accounts.v1beta.AutofeedSettings; + + /** + * Decodes an AutofeedSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutofeedSettings + * @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.shopping.merchant.accounts.v1beta.AutofeedSettings; + + /** + * Verifies an AutofeedSettings 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 AutofeedSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutofeedSettings + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AutofeedSettings; + + /** + * Creates a plain object from an AutofeedSettings message. Also converts values to other types if specified. + * @param message AutofeedSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AutofeedSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutofeedSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutofeedSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAutofeedSettingsRequest. */ + interface IGetAutofeedSettingsRequest { + + /** GetAutofeedSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetAutofeedSettingsRequest. */ + class GetAutofeedSettingsRequest implements IGetAutofeedSettingsRequest { + + /** + * Constructs a new GetAutofeedSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest); + + /** GetAutofeedSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetAutofeedSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAutofeedSettingsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest): google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest; + + /** + * Encodes the specified GetAutofeedSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest.verify|verify} messages. + * @param message GetAutofeedSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAutofeedSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest.verify|verify} messages. + * @param message GetAutofeedSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAutofeedSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAutofeedSettingsRequest + * @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.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest; + + /** + * Decodes a GetAutofeedSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAutofeedSettingsRequest + * @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.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest; + + /** + * Verifies a GetAutofeedSettingsRequest 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 GetAutofeedSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAutofeedSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest; + + /** + * Creates a plain object from a GetAutofeedSettingsRequest message. Also converts values to other types if specified. + * @param message GetAutofeedSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAutofeedSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAutofeedSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAutofeedSettingsRequest. */ + interface IUpdateAutofeedSettingsRequest { + + /** UpdateAutofeedSettingsRequest autofeedSettings */ + autofeedSettings?: (google.shopping.merchant.accounts.v1beta.IAutofeedSettings|null); + + /** UpdateAutofeedSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAutofeedSettingsRequest. */ + class UpdateAutofeedSettingsRequest implements IUpdateAutofeedSettingsRequest { + + /** + * Constructs a new UpdateAutofeedSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest); + + /** UpdateAutofeedSettingsRequest autofeedSettings. */ + public autofeedSettings?: (google.shopping.merchant.accounts.v1beta.IAutofeedSettings|null); + + /** UpdateAutofeedSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAutofeedSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAutofeedSettingsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest): google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest; + + /** + * Encodes the specified UpdateAutofeedSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.verify|verify} messages. + * @param message UpdateAutofeedSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAutofeedSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.verify|verify} messages. + * @param message UpdateAutofeedSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAutofeedSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAutofeedSettingsRequest + * @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.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest; + + /** + * Decodes an UpdateAutofeedSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAutofeedSettingsRequest + * @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.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest; + + /** + * Verifies an UpdateAutofeedSettingsRequest 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 UpdateAutofeedSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAutofeedSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest; + + /** + * Creates a plain object from an UpdateAutofeedSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateAutofeedSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAutofeedSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAutofeedSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a BusinessIdentityService */ class BusinessIdentityService extends $protobuf.rpc.Service { @@ -4311,6 +4777,9 @@ export namespace google { /** BusinessInfo customerService */ customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); + + /** BusinessInfo koreanBusinessRegistrationNumber */ + koreanBusinessRegistrationNumber?: (string|null); } /** Represents a BusinessInfo. */ @@ -4337,6 +4806,9 @@ export namespace google { /** BusinessInfo customerService. */ public customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); + /** BusinessInfo koreanBusinessRegistrationNumber. */ + public koreanBusinessRegistrationNumber?: (string|null); + /** BusinessInfo _address. */ public _address?: "address"; @@ -4349,6 +4821,9 @@ export namespace google { /** BusinessInfo _customerService. */ public _customerService?: "customerService"; + /** BusinessInfo _koreanBusinessRegistrationNumber. */ + public _koreanBusinessRegistrationNumber?: "koreanBusinessRegistrationNumber"; + /** * Creates a new BusinessInfo instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-shopping-merchant-accounts/protos/protos.js b/packages/google-shopping-merchant-accounts/protos/protos.js index 443e2de29f1..934fec7bdd4 100644 --- a/packages/google-shopping-merchant-accounts/protos/protos.js +++ b/packages/google-shopping-merchant-accounts/protos/protos.js @@ -3169,7 +3169,7 @@ * @property {number|null} [pageSize] ListAccountIssuesRequest pageSize * @property {string|null} [pageToken] ListAccountIssuesRequest pageToken * @property {string|null} [languageCode] ListAccountIssuesRequest languageCode - * @property {google.type.ITimeZone|null} [timeZone] ListAccountIssuesRequest timeZone + * @property {string|null} [timeZone] ListAccountIssuesRequest timeZone */ /** @@ -3221,11 +3221,11 @@ /** * ListAccountIssuesRequest timeZone. - * @member {google.type.ITimeZone|null|undefined} timeZone + * @member {string} timeZone * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest * @instance */ - ListAccountIssuesRequest.prototype.timeZone = null; + ListAccountIssuesRequest.prototype.timeZone = ""; /** * Creates a new ListAccountIssuesRequest instance using the specified properties. @@ -3260,7 +3260,7 @@ if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); return writer; }; @@ -3312,7 +3312,7 @@ break; } case 5: { - message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + message.timeZone = reader.string(); break; } default: @@ -3362,11 +3362,9 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - var error = $root.google.type.TimeZone.verify(message.timeZone); - if (error) - return "timeZone." + error; - } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; return null; }; @@ -3390,11 +3388,8 @@ message.pageToken = String(object.pageToken); if (object.languageCode != null) message.languageCode = String(object.languageCode); - if (object.timeZone != null) { - if (typeof object.timeZone !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.timeZone: object expected"); - message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); - } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); return message; }; @@ -3416,7 +3411,7 @@ object.pageSize = 0; object.pageToken = ""; object.languageCode = ""; - object.timeZone = null; + object.timeZone = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -3427,7 +3422,7 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + object.timeZone = message.timeZone; return object; }; @@ -5081,7 +5076,7 @@ * Properties of an AddAccountService. * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest * @interface IAddAccountService - * @property {google.protobuf.IEmpty|null} [accountAggregation] AddAccountService accountAggregation + * @property {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null} [accountAggregation] AddAccountService accountAggregation * @property {string|null} [provider] AddAccountService provider */ @@ -5102,7 +5097,7 @@ /** * AddAccountService accountAggregation. - * @member {google.protobuf.IEmpty|null|undefined} accountAggregation + * @member {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null|undefined} accountAggregation * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService * @instance */ @@ -5168,7 +5163,7 @@ if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.provider); if (message.accountAggregation != null && Object.hasOwnProperty.call(message, "accountAggregation")) - $root.google.protobuf.Empty.encode(message.accountAggregation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.encode(message.accountAggregation, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); return writer; }; @@ -5203,8 +5198,8 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.accountAggregation = $root.google.protobuf.Empty.decode(reader, reader.uint32()); + case 103: { + message.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.decode(reader, reader.uint32()); break; } case 1: { @@ -5250,7 +5245,7 @@ if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { properties.serviceType = 1; { - var error = $root.google.protobuf.Empty.verify(message.accountAggregation); + var error = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.verify(message.accountAggregation); if (error) return "accountAggregation." + error; } @@ -5278,7 +5273,7 @@ if (object.accountAggregation != null) { if (typeof object.accountAggregation !== "object") throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.accountAggregation: object expected"); - message.accountAggregation = $root.google.protobuf.Empty.fromObject(object.accountAggregation); + message.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.fromObject(object.accountAggregation); } if (object.provider != null) message.provider = String(object.provider); @@ -5304,7 +5299,7 @@ object._provider = "provider"; } if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { - object.accountAggregation = $root.google.protobuf.Empty.toObject(message.accountAggregation, options); + object.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.toObject(message.accountAggregation, options); if (options.oneofs) object.serviceType = "accountAggregation"; } @@ -6779,6 +6774,181 @@ return ListSubAccountsResponse; })(); + v1beta.AccountAggregation = (function() { + + /** + * Properties of an AccountAggregation. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAccountAggregation + */ + + /** + * Constructs a new AccountAggregation. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountAggregation. + * @implements IAccountAggregation + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAccountAggregation=} [properties] Properties to set + */ + function AccountAggregation(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 AccountAggregation instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountAggregation=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AccountAggregation} AccountAggregation instance + */ + AccountAggregation.create = function create(properties) { + return new AccountAggregation(properties); + }; + + /** + * Encodes the specified AccountAggregation message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountAggregation.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountAggregation} message AccountAggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AccountAggregation message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountAggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountAggregation} message AccountAggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccountAggregation message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.accounts.v1beta.AccountAggregation} AccountAggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.accounts.v1beta.AccountAggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccountAggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AccountAggregation} AccountAggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccountAggregation message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccountAggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AccountAggregation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AccountAggregation} AccountAggregation + */ + AccountAggregation.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountAggregation) + return object; + return new $root.google.shopping.merchant.accounts.v1beta.AccountAggregation(); + }; + + /** + * Creates a plain object from an AccountAggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountAggregation} message AccountAggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccountAggregation.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AccountAggregation to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @instance + * @returns {Object.} JSON object + */ + AccountAggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccountAggregation + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AccountAggregation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountAggregation"; + }; + + return AccountAggregation; + })(); + v1beta.UserService = (function() { /** @@ -8719,131 +8889,127 @@ return ListUsersResponse; })(); - v1beta.BusinessIdentityService = (function() { + v1beta.AutofeedSettingsService = (function() { /** - * Constructs a new BusinessIdentityService service. + * Constructs a new AutofeedSettingsService service. * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a BusinessIdentityService + * @classdesc Represents an AutofeedSettingsService * @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 BusinessIdentityService(rpcImpl, requestDelimited, responseDelimited) { + function AutofeedSettingsService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (BusinessIdentityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BusinessIdentityService; + (AutofeedSettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutofeedSettingsService; /** - * Creates new BusinessIdentityService service using the specified rpc implementation. + * Creates new AutofeedSettingsService service using the specified rpc implementation. * @function create - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService * @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 {BusinessIdentityService} RPC service. Useful where requests and/or responses are streamed. + * @returns {AutofeedSettingsService} RPC service. Useful where requests and/or responses are streamed. */ - BusinessIdentityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + AutofeedSettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|getBusinessIdentity}. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService - * @typedef GetBusinessIdentityCallback + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AutofeedSettingsService|getAutofeedSettings}. + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @typedef GetAutofeedSettingsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} [response] BusinessIdentity + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettings} [response] AutofeedSettings */ /** - * Calls GetBusinessIdentity. - * @function getBusinessIdentity - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * Calls GetAutofeedSettings. + * @function getAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} request GetBusinessIdentityRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentityCallback} callback Node-style callback called with the error, if any, and BusinessIdentity + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest} request GetAutofeedSettingsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.GetAutofeedSettingsCallback} callback Node-style callback called with the error, if any, and AutofeedSettings * @returns {undefined} * @variation 1 */ - Object.defineProperty(BusinessIdentityService.prototype.getBusinessIdentity = function getBusinessIdentity(request, callback) { - return this.rpcCall(getBusinessIdentity, $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity, request, callback); - }, "name", { value: "GetBusinessIdentity" }); + Object.defineProperty(AutofeedSettingsService.prototype.getAutofeedSettings = function getAutofeedSettings(request, callback) { + return this.rpcCall(getAutofeedSettings, $root.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings, request, callback); + }, "name", { value: "GetAutofeedSettings" }); /** - * Calls GetBusinessIdentity. - * @function getBusinessIdentity - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * Calls GetAutofeedSettings. + * @function getAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} request GetBusinessIdentityRequest message or plain object - * @returns {Promise} Promise + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest} request GetAutofeedSettingsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|updateBusinessIdentity}. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService - * @typedef UpdateBusinessIdentityCallback + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AutofeedSettingsService|updateAutofeedSettings}. + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @typedef UpdateAutofeedSettingsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} [response] BusinessIdentity + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettings} [response] AutofeedSettings */ /** - * Calls UpdateBusinessIdentity. - * @function updateBusinessIdentity - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * Calls UpdateAutofeedSettings. + * @function updateAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} request UpdateBusinessIdentityRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentityCallback} callback Node-style callback called with the error, if any, and BusinessIdentity + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} request UpdateAutofeedSettingsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.UpdateAutofeedSettingsCallback} callback Node-style callback called with the error, if any, and AutofeedSettings * @returns {undefined} * @variation 1 */ - Object.defineProperty(BusinessIdentityService.prototype.updateBusinessIdentity = function updateBusinessIdentity(request, callback) { - return this.rpcCall(updateBusinessIdentity, $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity, request, callback); - }, "name", { value: "UpdateBusinessIdentity" }); + Object.defineProperty(AutofeedSettingsService.prototype.updateAutofeedSettings = function updateAutofeedSettings(request, callback) { + return this.rpcCall(updateAutofeedSettings, $root.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings, request, callback); + }, "name", { value: "UpdateAutofeedSettings" }); /** - * Calls UpdateBusinessIdentity. - * @function updateBusinessIdentity - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * Calls UpdateAutofeedSettings. + * @function updateAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} request UpdateBusinessIdentityRequest message or plain object - * @returns {Promise} Promise + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} request UpdateAutofeedSettingsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return BusinessIdentityService; + return AutofeedSettingsService; })(); - v1beta.BusinessIdentity = (function() { + v1beta.AutofeedSettings = (function() { /** - * Properties of a BusinessIdentity. + * Properties of an AutofeedSettings. * @memberof google.shopping.merchant.accounts.v1beta - * @interface IBusinessIdentity - * @property {string|null} [name] BusinessIdentity name - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|null} [promotionsConsent] BusinessIdentity promotionsConsent - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [blackOwned] BusinessIdentity blackOwned - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [womenOwned] BusinessIdentity womenOwned - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [veteranOwned] BusinessIdentity veteranOwned - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [latinoOwned] BusinessIdentity latinoOwned - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [smallBusiness] BusinessIdentity smallBusiness + * @interface IAutofeedSettings + * @property {string|null} [name] AutofeedSettings name + * @property {boolean|null} [enableProducts] AutofeedSettings enableProducts + * @property {boolean|null} [eligible] AutofeedSettings eligible */ /** - * Constructs a new BusinessIdentity. + * Constructs a new AutofeedSettings. * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a BusinessIdentity. - * @implements IBusinessIdentity + * @classdesc Represents an AutofeedSettings. + * @implements IAutofeedSettings * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity=} [properties] Properties to set + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set */ - function BusinessIdentity(properties) { + function AutofeedSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8851,88 +9017,883 @@ } /** - * BusinessIdentity name. + * AutofeedSettings name. * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @instance - */ - BusinessIdentity.prototype.name = ""; - - /** - * BusinessIdentity promotionsConsent. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent} promotionsConsent - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @instance - */ - BusinessIdentity.prototype.promotionsConsent = 0; - - /** - * BusinessIdentity blackOwned. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} blackOwned - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @instance - */ - BusinessIdentity.prototype.blackOwned = null; - - /** - * BusinessIdentity womenOwned. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} womenOwned - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @instance - */ - BusinessIdentity.prototype.womenOwned = null; - - /** - * BusinessIdentity veteranOwned. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} veteranOwned - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings * @instance */ - BusinessIdentity.prototype.veteranOwned = null; + AutofeedSettings.prototype.name = ""; /** - * BusinessIdentity latinoOwned. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} latinoOwned - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * AutofeedSettings enableProducts. + * @member {boolean} enableProducts + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings * @instance */ - BusinessIdentity.prototype.latinoOwned = null; + AutofeedSettings.prototype.enableProducts = false; /** - * BusinessIdentity smallBusiness. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} smallBusiness - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * AutofeedSettings eligible. + * @member {boolean} eligible + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings * @instance */ - BusinessIdentity.prototype.smallBusiness = null; + AutofeedSettings.prototype.eligible = false; /** - * Creates a new BusinessIdentity instance using the specified properties. + * Creates a new AutofeedSettings instance using the specified properties. * @function create - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity instance + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings instance */ - BusinessIdentity.create = function create(properties) { - return new BusinessIdentity(properties); + AutofeedSettings.create = function create(properties) { + return new AutofeedSettings(properties); }; /** - * Encodes the specified BusinessIdentity message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. + * Encodes the specified AutofeedSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AutofeedSettings.verify|verify} messages. * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity} message BusinessIdentity message or plain object to encode + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings} message AutofeedSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BusinessIdentity.encode = function encode(message, writer) { + AutofeedSettings.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.promotionsConsent != null && Object.hasOwnProperty.call(message, "promotionsConsent")) + if (message.enableProducts != null && Object.hasOwnProperty.call(message, "enableProducts")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableProducts); + if (message.eligible != null && Object.hasOwnProperty.call(message, "eligible")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.eligible); + return writer; + }; + + /** + * Encodes the specified AutofeedSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AutofeedSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings} message AutofeedSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutofeedSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutofeedSettings message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutofeedSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enableProducts = reader.bool(); + break; + } + case 3: { + message.eligible = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutofeedSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutofeedSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutofeedSettings message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutofeedSettings.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.enableProducts != null && message.hasOwnProperty("enableProducts")) + if (typeof message.enableProducts !== "boolean") + return "enableProducts: boolean expected"; + if (message.eligible != null && message.hasOwnProperty("eligible")) + if (typeof message.eligible !== "boolean") + return "eligible: boolean expected"; + return null; + }; + + /** + * Creates an AutofeedSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings + */ + AutofeedSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.enableProducts != null) + message.enableProducts = Boolean(object.enableProducts); + if (object.eligible != null) + message.eligible = Boolean(object.eligible); + return message; + }; + + /** + * Creates a plain object from an AutofeedSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettings} message AutofeedSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutofeedSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enableProducts = false; + object.eligible = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enableProducts != null && message.hasOwnProperty("enableProducts")) + object.enableProducts = message.enableProducts; + if (message.eligible != null && message.hasOwnProperty("eligible")) + object.eligible = message.eligible; + return object; + }; + + /** + * Converts this AutofeedSettings to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @instance + * @returns {Object.} JSON object + */ + AutofeedSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutofeedSettings + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutofeedSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AutofeedSettings"; + }; + + return AutofeedSettings; + })(); + + v1beta.GetAutofeedSettingsRequest = (function() { + + /** + * Properties of a GetAutofeedSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetAutofeedSettingsRequest + * @property {string|null} [name] GetAutofeedSettingsRequest name + */ + + /** + * Constructs a new GetAutofeedSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetAutofeedSettingsRequest. + * @implements IGetAutofeedSettingsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest=} [properties] Properties to set + */ + function GetAutofeedSettingsRequest(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]]; + } + + /** + * GetAutofeedSettingsRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @instance + */ + GetAutofeedSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetAutofeedSettingsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest} GetAutofeedSettingsRequest instance + */ + GetAutofeedSettingsRequest.create = function create(properties) { + return new GetAutofeedSettingsRequest(properties); + }; + + /** + * Encodes the specified GetAutofeedSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest} message GetAutofeedSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutofeedSettingsRequest.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 GetAutofeedSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest} message GetAutofeedSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutofeedSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAutofeedSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest} GetAutofeedSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutofeedSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAutofeedSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest} GetAutofeedSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutofeedSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAutofeedSettingsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAutofeedSettingsRequest.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 GetAutofeedSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest} GetAutofeedSettingsRequest + */ + GetAutofeedSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAutofeedSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest} message GetAutofeedSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAutofeedSettingsRequest.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 GetAutofeedSettingsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetAutofeedSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAutofeedSettingsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAutofeedSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest"; + }; + + return GetAutofeedSettingsRequest; + })(); + + v1beta.UpdateAutofeedSettingsRequest = (function() { + + /** + * Properties of an UpdateAutofeedSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateAutofeedSettingsRequest + * @property {google.shopping.merchant.accounts.v1beta.IAutofeedSettings|null} [autofeedSettings] UpdateAutofeedSettingsRequest autofeedSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAutofeedSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateAutofeedSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateAutofeedSettingsRequest. + * @implements IUpdateAutofeedSettingsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest=} [properties] Properties to set + */ + function UpdateAutofeedSettingsRequest(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]]; + } + + /** + * UpdateAutofeedSettingsRequest autofeedSettings. + * @member {google.shopping.merchant.accounts.v1beta.IAutofeedSettings|null|undefined} autofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @instance + */ + UpdateAutofeedSettingsRequest.prototype.autofeedSettings = null; + + /** + * UpdateAutofeedSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @instance + */ + UpdateAutofeedSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAutofeedSettingsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest} UpdateAutofeedSettingsRequest instance + */ + UpdateAutofeedSettingsRequest.create = function create(properties) { + return new UpdateAutofeedSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateAutofeedSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} message UpdateAutofeedSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutofeedSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autofeedSettings != null && Object.hasOwnProperty.call(message, "autofeedSettings")) + $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings.encode(message.autofeedSettings, 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 UpdateAutofeedSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} message UpdateAutofeedSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutofeedSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAutofeedSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest} UpdateAutofeedSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutofeedSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.autofeedSettings = $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings.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 UpdateAutofeedSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest} UpdateAutofeedSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutofeedSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAutofeedSettingsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAutofeedSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autofeedSettings != null && message.hasOwnProperty("autofeedSettings")) { + var error = $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings.verify(message.autofeedSettings); + if (error) + return "autofeedSettings." + 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 UpdateAutofeedSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest} UpdateAutofeedSettingsRequest + */ + UpdateAutofeedSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest(); + if (object.autofeedSettings != null) { + if (typeof object.autofeedSettings !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.autofeedSettings: object expected"); + message.autofeedSettings = $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings.fromObject(object.autofeedSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAutofeedSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest} message UpdateAutofeedSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAutofeedSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autofeedSettings = null; + object.updateMask = null; + } + if (message.autofeedSettings != null && message.hasOwnProperty("autofeedSettings")) + object.autofeedSettings = $root.google.shopping.merchant.accounts.v1beta.AutofeedSettings.toObject(message.autofeedSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAutofeedSettingsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAutofeedSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAutofeedSettingsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAutofeedSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest"; + }; + + return UpdateAutofeedSettingsRequest; + })(); + + v1beta.BusinessIdentityService = (function() { + + /** + * Constructs a new BusinessIdentityService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a BusinessIdentityService + * @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 BusinessIdentityService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BusinessIdentityService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BusinessIdentityService; + + /** + * Creates new BusinessIdentityService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @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 {BusinessIdentityService} RPC service. Useful where requests and/or responses are streamed. + */ + BusinessIdentityService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|getBusinessIdentity}. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @typedef GetBusinessIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} [response] BusinessIdentity + */ + + /** + * Calls GetBusinessIdentity. + * @function getBusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} request GetBusinessIdentityRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentityCallback} callback Node-style callback called with the error, if any, and BusinessIdentity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BusinessIdentityService.prototype.getBusinessIdentity = function getBusinessIdentity(request, callback) { + return this.rpcCall(getBusinessIdentity, $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity, request, callback); + }, "name", { value: "GetBusinessIdentity" }); + + /** + * Calls GetBusinessIdentity. + * @function getBusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} request GetBusinessIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|updateBusinessIdentity}. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @typedef UpdateBusinessIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} [response] BusinessIdentity + */ + + /** + * Calls UpdateBusinessIdentity. + * @function updateBusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} request UpdateBusinessIdentityRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentityCallback} callback Node-style callback called with the error, if any, and BusinessIdentity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BusinessIdentityService.prototype.updateBusinessIdentity = function updateBusinessIdentity(request, callback) { + return this.rpcCall(updateBusinessIdentity, $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity, request, callback); + }, "name", { value: "UpdateBusinessIdentity" }); + + /** + * Calls UpdateBusinessIdentity. + * @function updateBusinessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentityService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} request UpdateBusinessIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BusinessIdentityService; + })(); + + v1beta.BusinessIdentity = (function() { + + /** + * Properties of a BusinessIdentity. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IBusinessIdentity + * @property {string|null} [name] BusinessIdentity name + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|null} [promotionsConsent] BusinessIdentity promotionsConsent + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [blackOwned] BusinessIdentity blackOwned + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [womenOwned] BusinessIdentity womenOwned + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [veteranOwned] BusinessIdentity veteranOwned + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [latinoOwned] BusinessIdentity latinoOwned + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null} [smallBusiness] BusinessIdentity smallBusiness + */ + + /** + * Constructs a new BusinessIdentity. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a BusinessIdentity. + * @implements IBusinessIdentity + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity=} [properties] Properties to set + */ + function BusinessIdentity(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]]; + } + + /** + * BusinessIdentity name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.name = ""; + + /** + * BusinessIdentity promotionsConsent. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent} promotionsConsent + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.promotionsConsent = 0; + + /** + * BusinessIdentity blackOwned. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} blackOwned + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.blackOwned = null; + + /** + * BusinessIdentity womenOwned. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} womenOwned + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.womenOwned = null; + + /** + * BusinessIdentity veteranOwned. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} veteranOwned + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.veteranOwned = null; + + /** + * BusinessIdentity latinoOwned. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} latinoOwned + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.latinoOwned = null; + + /** + * BusinessIdentity smallBusiness. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null|undefined} smallBusiness + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + */ + BusinessIdentity.prototype.smallBusiness = null; + + /** + * Creates a new BusinessIdentity instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity instance + */ + BusinessIdentity.create = function create(properties) { + return new BusinessIdentity(properties); + }; + + /** + * Encodes the specified BusinessIdentity message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessIdentity} message BusinessIdentity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BusinessIdentity.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.promotionsConsent != null && Object.hasOwnProperty.call(message, "promotionsConsent")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.promotionsConsent); if (message.blackOwned != null && Object.hasOwnProperty.call(message, "blackOwned")) $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.blackOwned, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); @@ -10022,6 +10983,7 @@ * @property {google.type.IPhoneNumber|null} [phone] BusinessInfo phone * @property {google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null} [phoneVerificationState] BusinessInfo phoneVerificationState * @property {google.shopping.merchant.accounts.v1beta.ICustomerService|null} [customerService] BusinessInfo customerService + * @property {string|null} [koreanBusinessRegistrationNumber] BusinessInfo koreanBusinessRegistrationNumber */ /** @@ -10079,6 +11041,14 @@ */ BusinessInfo.prototype.customerService = null; + /** + * BusinessInfo koreanBusinessRegistrationNumber. + * @member {string|null|undefined} koreanBusinessRegistrationNumber + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + BusinessInfo.prototype.koreanBusinessRegistrationNumber = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -10126,6 +11096,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * BusinessInfo _koreanBusinessRegistrationNumber. + * @member {"koreanBusinessRegistrationNumber"|undefined} _koreanBusinessRegistrationNumber + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + Object.defineProperty(BusinessInfo.prototype, "_koreanBusinessRegistrationNumber", { + get: $util.oneOfGetter($oneOfFields = ["koreanBusinessRegistrationNumber"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new BusinessInfo instance using the specified properties. * @function create @@ -10160,6 +11141,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.phoneVerificationState); if (message.customerService != null && Object.hasOwnProperty.call(message, "customerService")) $root.google.shopping.merchant.accounts.v1beta.CustomerService.encode(message.customerService, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.koreanBusinessRegistrationNumber != null && Object.hasOwnProperty.call(message, "koreanBusinessRegistrationNumber")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.koreanBusinessRegistrationNumber); return writer; }; @@ -10214,6 +11197,10 @@ message.customerService = $root.google.shopping.merchant.accounts.v1beta.CustomerService.decode(reader, reader.uint32()); break; } + case 6: { + message.koreanBusinessRegistrationNumber = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10288,6 +11275,11 @@ return "customerService." + error; } } + if (message.koreanBusinessRegistrationNumber != null && message.hasOwnProperty("koreanBusinessRegistrationNumber")) { + properties._koreanBusinessRegistrationNumber = 1; + if (!$util.isString(message.koreanBusinessRegistrationNumber)) + return "koreanBusinessRegistrationNumber: string expected"; + } return null; }; @@ -10340,6 +11332,8 @@ throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessInfo.customerService: object expected"); message.customerService = $root.google.shopping.merchant.accounts.v1beta.CustomerService.fromObject(object.customerService); } + if (object.koreanBusinessRegistrationNumber != null) + message.koreanBusinessRegistrationNumber = String(object.koreanBusinessRegistrationNumber); return message; }; @@ -10380,6 +11374,11 @@ if (options.oneofs) object._customerService = "customerService"; } + if (message.koreanBusinessRegistrationNumber != null && message.hasOwnProperty("koreanBusinessRegistrationNumber")) { + object.koreanBusinessRegistrationNumber = message.koreanBusinessRegistrationNumber; + if (options.oneofs) + object._koreanBusinessRegistrationNumber = "koreanBusinessRegistrationNumber"; + } return object; }; diff --git a/packages/google-shopping-merchant-accounts/protos/protos.json b/packages/google-shopping-merchant-accounts/protos/protos.json index e130560a3e1..5e24dc17bd5 100644 --- a/packages/google-shopping-merchant-accounts/protos/protos.json +++ b/packages/google-shopping-merchant-accounts/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -389,7 +392,7 @@ } }, "timeZone": { - "type": "google.type.TimeZone", + "type": "string", "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL" @@ -625,7 +628,7 @@ "type": "AddAccountService", "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } } }, @@ -664,8 +667,8 @@ }, "fields": { "accountAggregation": { - "type": "google.protobuf.Empty", - "id": 2 + "type": "AccountAggregation", + "id": 103 }, "provider": { "type": "string", @@ -787,6 +790,9 @@ } } }, + "AccountAggregation": { + "fields": {} + }, "UserService": { "options": { "(google.api.default_host)": "merchantapi.googleapis.com", @@ -1037,6 +1043,113 @@ } } }, + "AutofeedSettingsService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetAutofeedSettings": { + "requestType": "GetAutofeedSettingsRequest", + "responseType": "AutofeedSettings", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/autofeedSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/autofeedSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAutofeedSettings": { + "requestType": "UpdateAutofeedSettingsRequest", + "responseType": "AutofeedSettings", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{autofeed_settings.name=accounts/*/autofeedSettings}", + "(google.api.http).body": "autofeed_settings", + "(google.api.method_signature)": "autofeed_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{autofeed_settings.name=accounts/*/autofeedSettings}", + "body": "autofeed_settings" + } + }, + { + "(google.api.method_signature)": "autofeed_settings,update_mask" + } + ] + } + } + }, + "AutofeedSettings": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/AutofeedSettings", + "(google.api.resource).pattern": "accounts/{account}/autofeedSettings", + "(google.api.resource).plural": "autofeedSettings", + "(google.api.resource).singular": "autofeedSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "enableProducts": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "eligible": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetAutofeedSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/AutofeedSettings" + } + } + } + }, + "UpdateAutofeedSettingsRequest": { + "fields": { + "autofeedSettings": { + "type": "AutofeedSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "BusinessIdentityService": { "options": { "(google.api.default_host)": "merchantapi.googleapis.com", @@ -1274,6 +1387,11 @@ "oneof": [ "customerService" ] + }, + "_koreanBusinessRegistrationNumber": { + "oneof": [ + "koreanBusinessRegistrationNumber" + ] } }, "fields": { @@ -1315,6 +1433,14 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "koreanBusinessRegistrationNumber": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -3950,11 +4076,17 @@ "fields": { "regionCode": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "kind": { "type": "TermsOfServiceKind", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, diff --git a/packages/google-shopping-merchant-accounts/samples/README.md b/packages/google-shopping-merchant-accounts/samples/README.md index f38244fab32..c05737ac0a8 100644 --- a/packages/google-shopping-merchant-accounts/samples/README.md +++ b/packages/google-shopping-merchant-accounts/samples/README.md @@ -22,6 +22,8 @@ * [Accounts_service.list_accounts](#accounts_service.list_accounts) * [Accounts_service.list_sub_accounts](#accounts_service.list_sub_accounts) * [Accounts_service.update_account](#accounts_service.update_account) + * [Autofeed_settings_service.get_autofeed_settings](#autofeed_settings_service.get_autofeed_settings) + * [Autofeed_settings_service.update_autofeed_settings](#autofeed_settings_service.update_autofeed_settings) * [Business_identity_service.get_business_identity](#business_identity_service.get_business_identity) * [Business_identity_service.update_business_identity](#business_identity_service.update_business_identity) * [Business_info_service.get_business_info](#business_info_service.get_business_info) @@ -242,6 +244,40 @@ __Usage:__ +### Autofeed_settings_service.get_autofeed_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js` + + +----- + + + + +### Autofeed_settings_service.update_autofeed_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js` + + +----- + + + + ### Business_identity_service.get_business_identity View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-accounts/samples/generated/v1beta/business_identity_service.get_business_identity.js). diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/account_issue_service.list_account_issues.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/account_issue_service.list_account_issues.js index 88a1f77ca4d..26ab7580cda 100644 --- a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/account_issue_service.list_account_issues.js +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/account_issue_service.list_account_issues.js @@ -58,7 +58,7 @@ function main(parent) { * localize times in human-readable fields. For example 'America/Los_Angeles'. * If not set, 'America/Los_Angeles' will be used. */ - // const timeZone = {} + // const timeZone = 'abc123' // Imports the Accounts library const {AccountIssueServiceClient} = require('@google-shopping/accounts').v1beta; diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.create_and_configure_account.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.create_and_configure_account.js index 59c9750bb8e..19886628937 100644 --- a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.create_and_configure_account.js +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/accounts_service.create_and_configure_account.js @@ -20,7 +20,7 @@ 'use strict'; -function main(account) { +function main(account, service) { // [START merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -42,9 +42,12 @@ function main(account) { */ // const acceptTermsOfService = {} /** - * Optional. If specified, an account service between the account to be - * created and the provider account is initialized as part of the - * creation. + * Required. An account service between the account to be created and the + * provider account is initialized as part of the creation. At least one such + * service needs to be provided. Currently exactly one of these needs to be + * `account_aggregation`, which means you can only create sub accounts, not + * standalone account through this method. Additional `account_management` or + * `product_management` services may be provided. */ // const service = [1,2,3,4] @@ -58,6 +61,7 @@ function main(account) { // Construct request const request = { account, + service, }; // Run request diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js new file mode 100644 index 00000000000..f27491c5263 --- /dev/null +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_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 autofeed settings. + * Format: `accounts/{account}/autofeedSettings` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {AutofeedSettingsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AutofeedSettingsServiceClient(); + + async function callGetAutofeedSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getAutofeedSettings(request); + console.log(response); + } + + callGetAutofeedSettings(); + // [END merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js new file mode 100644 index 00000000000..602e79cdc6a --- /dev/null +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js @@ -0,0 +1,66 @@ +// Copyright 2024 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(autofeedSettings, updateMask) { + // [START merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_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 new version of the autofeed setting. + */ + // const autofeedSettings = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {AutofeedSettingsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AutofeedSettingsServiceClient(); + + async function callUpdateAutofeedSettings() { + // Construct request + const request = { + autofeedSettings, + updateMask, + }; + + // Run request + const response = await accountsClient.updateAutofeedSettings(request); + console.log(response); + } + + callUpdateAutofeedSettings(); + // [END merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json index 68a60cb5ca7..f59711d8b33 100644 --- a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json @@ -49,7 +49,7 @@ }, { "name": "time_zone", - "type": ".google.type.TimeZone" + "type": "TYPE_STRING" } ], "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse", @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 72, "type": "FULL" } ], @@ -471,6 +471,90 @@ } } }, + { + "regionTag": "merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_async", + "title": "AccountIssueService getAutofeedSettings Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the autofeed settings of an account.", + "canonical": true, + "file": "autofeed_settings_service.get_autofeed_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAutofeedSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.GetAutofeedSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.AutofeedSettings", + "client": { + "shortName": "AutofeedSettingsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsServiceClient" + }, + "method": { + "shortName": "GetAutofeedSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.GetAutofeedSettings", + "service": { + "shortName": "AutofeedSettingsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_async", + "title": "AccountIssueService updateAutofeedSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the autofeed settings of an account.", + "canonical": true, + "file": "autofeed_settings_service.update_autofeed_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAutofeedSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.UpdateAutofeedSettings", + "async": true, + "parameters": [ + { + "name": "autofeed_settings", + "type": ".google.shopping.merchant.accounts.v1beta.AutofeedSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.AutofeedSettings", + "client": { + "shortName": "AutofeedSettingsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsServiceClient" + }, + "method": { + "shortName": "UpdateAutofeedSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService.UpdateAutofeedSettings", + "service": { + "shortName": "AutofeedSettingsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService" + } + } + } + }, { "regionTag": "merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_async", "title": "AccountIssueService getBusinessIdentity Sample", @@ -1458,7 +1542,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -1578,7 +1662,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 60, "type": "FULL" } ], diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js index 291021e90e4..6a61dbac5ec 100644 --- a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js @@ -31,6 +31,7 @@ function main(name) { /** * Required. The resource name of the terms of service version. * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * The identifier format is: `{TermsOfServiceKind}-{country}` */ // const name = 'abc123' diff --git a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js index d4a66370638..b7ad2cd0eb2 100644 --- a/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js +++ b/packages/google-shopping-merchant-accounts/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js @@ -20,7 +20,7 @@ 'use strict'; -function main() { +function main(regionCode, kind) { // [START merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -29,13 +29,13 @@ function main() { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Region code as defined by CLDR (https://cldr.unicode.org/). This is either - * a country when the ToS applies specifically to that country or 001 when it - * applies globally. + * Required. Region code as defined by CLDR (https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. */ // const regionCode = 'abc123' /** - * The Kind this terms of service version applies to. + * Required. The Kind this terms of service version applies to. */ // const kind = {} @@ -48,6 +48,8 @@ function main() { async function callRetrieveLatestTermsOfService() { // Construct request const request = { + regionCode, + kind, }; // Run request diff --git a/packages/google-shopping-merchant-accounts/src/index.ts b/packages/google-shopping-merchant-accounts/src/index.ts index 32c9f0bf867..86820b38a40 100644 --- a/packages/google-shopping-merchant-accounts/src/index.ts +++ b/packages/google-shopping-merchant-accounts/src/index.ts @@ -24,6 +24,8 @@ const AccountsServiceClient = v1beta.AccountsServiceClient; type AccountsServiceClient = v1beta.AccountsServiceClient; const AccountTaxServiceClient = v1beta.AccountTaxServiceClient; type AccountTaxServiceClient = v1beta.AccountTaxServiceClient; +const AutofeedSettingsServiceClient = v1beta.AutofeedSettingsServiceClient; +type AutofeedSettingsServiceClient = v1beta.AutofeedSettingsServiceClient; const BusinessIdentityServiceClient = v1beta.BusinessIdentityServiceClient; type BusinessIdentityServiceClient = v1beta.BusinessIdentityServiceClient; const BusinessInfoServiceClient = v1beta.BusinessInfoServiceClient; @@ -54,6 +56,7 @@ export { AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, + AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, @@ -71,6 +74,7 @@ export default { AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, + AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client.ts index 431cab2d067..11bfb1c1eb6 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client.ts @@ -208,6 +208,9 @@ export class AccountIssueServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -443,7 +446,7 @@ export class AccountIssueServiceClient { * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be * used. - * @param {google.type.TimeZone} [request.timeZone] + * @param {string} [request.timeZone] * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to * localize times in human-readable fields. For example 'America/Los_Angeles'. * If not set, 'America/Los_Angeles' will be used. @@ -556,7 +559,7 @@ export class AccountIssueServiceClient { * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be * used. - * @param {google.type.TimeZone} [request.timeZone] + * @param {string} [request.timeZone] * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to * localize times in human-readable fields. For example 'America/Los_Angeles'. * If not set, 'America/Los_Angeles' will be used. @@ -617,7 +620,7 @@ export class AccountIssueServiceClient { * given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), * such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be * used. - * @param {google.type.TimeZone} [request.timeZone] + * @param {string} [request.timeZone] * Optional. The [IANA](https://www.iana.org/time-zones) timezone used to * localize times in human-readable fields. For example 'America/Los_Angeles'. * If not set, 'America/Los_Angeles' will be used. @@ -756,6 +759,31 @@ export class AccountIssueServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client_config.json index b19be3d6cfe..3c6eab21940 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,12 +20,22 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "ListAccountIssues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_issue_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client.ts index 41a69030d47..13d4ff2f620 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client.ts @@ -212,6 +212,9 @@ export class AccountTaxServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -919,6 +922,31 @@ export class AccountTaxServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client_config.json index 619d55383fa..4f2807b57b2 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,20 +20,32 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetAccountTax": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ListAccountTax": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateAccountTax": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/account_tax_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_client.ts index c14ebfb69c9..a2f4e2e2ab4 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_client.ts @@ -208,6 +208,9 @@ export class AccountsServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -543,10 +546,13 @@ export class AccountsServiceClient { * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} [request.acceptTermsOfService] * Optional. The Terms of Service (ToS) to be accepted immediately upon * account creation. - * @param {number[]} [request.service] - * Optional. If specified, an account service between the account to be - * created and the provider account is initialized as part of the - * creation. + * @param {number[]} request.service + * Required. An account service between the account to be created and the + * provider account is initialized as part of the creation. At least one such + * service needs to be provided. Currently exactly one of these needs to be + * `account_aggregation`, which means you can only create sub accounts, not + * standalone account through this method. Additional `account_management` or + * `product_management` services may be provided. * @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. @@ -1353,6 +1359,31 @@ export class AccountsServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/accounts_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts new file mode 100644 index 00000000000..10db249d7fa --- /dev/null +++ b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts @@ -0,0 +1,1113 @@ +// Copyright 2024 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'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/autofeed_settings_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './autofeed_settings_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support + * [autofeed](https://support.google.com/merchants/answer/7538732) setting. + * @class + * @memberof v1beta + */ +export class AutofeedSettingsServiceClient { + 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; + 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}; + autofeedSettingsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutofeedSettingsServiceClient. + * + * @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://developers.google.com/identity/protocols/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 AutofeedSettingsServiceClient({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 AutofeedSettingsServiceClient; + 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 = 'merchantapi.' + 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( + 'accounts/{account}' + ), + accountIssuePathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/issues/{issue}' + ), + accountTaxPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/accounttax/{tax}' + ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), + businessIdentityPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/businessIdentity' + ), + businessInfoPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/businessInfo' + ), + emailPreferencesPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/users/{email}/emailPreferences' + ), + homepagePathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/homepage' + ), + onlineReturnPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/onlineReturnPolicies/{return_policy}' + ), + programPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/programs/{program}' + ), + regionPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/regions/{region}' + ), + shippingSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/shippingSettings' + ), + termsOfServicePathTemplate: new this._gaxModule.PathTemplate( + 'termsOfService/{version}' + ), + termsOfServiceAgreementStatePathTemplate: + new this._gaxModule.PathTemplate( + 'accounts/{account}/termsOfServiceAgreementStates/{identifier}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/users/{email}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.AutofeedSettingsService', + 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.autofeedSettingsServiceStub) { + return this.autofeedSettingsServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.AutofeedSettingsService. + this.autofeedSettingsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.shopping.merchant.accounts.v1beta.AutofeedSettingsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta + .AutofeedSettingsService, + 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 autofeedSettingsServiceStubMethods = [ + 'getAutofeedSettings', + 'updateAutofeedSettings', + ]; + for (const methodName of autofeedSettingsServiceStubMethods) { + const callPromise = this.autofeedSettingsServiceStub.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.autofeedSettingsServiceStub; + } + + /** + * 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 'merchantapi.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 'merchantapi.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/content']; + } + + 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 the autofeed settings of an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the autofeed settings. + * Format: `accounts/{account}/autofeedSettings` + * @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.shopping.merchant.accounts.v1beta.AutofeedSettings|AutofeedSettings}. + * 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/v1beta/autofeed_settings_service.get_autofeed_settings.js + * region_tag:merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_async + */ + getAutofeedSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + ( + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getAutofeedSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAutofeedSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAutofeedSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + ( + | protos.google.shopping.merchant.accounts.v1beta.IGetAutofeedSettingsRequest + | 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(); + return this.innerApiCalls.getAutofeedSettings(request, options, callback); + } + /** + * Updates the autofeed settings of an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.AutofeedSettings} request.autofeedSettings + * Required. The new version of the autofeed setting. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. List of fields being updated. + * @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.shopping.merchant.accounts.v1beta.AutofeedSettings|AutofeedSettings}. + * 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/v1beta/autofeed_settings_service.update_autofeed_settings.js + * region_tag:merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_async + */ + updateAutofeedSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + ( + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateAutofeedSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAutofeedSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAutofeedSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings, + ( + | protos.google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest + | 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({ + 'autofeed_settings.name': request.autofeedSettings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAutofeedSettings( + request, + options, + callback + ); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified account resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + accountPath(account: string) { + return this.pathTemplates.accountPathTemplate.render({ + account: account, + }); + } + + /** + * 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 accountIssue resource name string. + * + * @param {string} account + * @param {string} issue + * @returns {string} Resource name string. + */ + accountIssuePath(account: string, issue: string) { + return this.pathTemplates.accountIssuePathTemplate.render({ + account: account, + issue: issue, + }); + } + + /** + * Parse the account from AccountIssue resource. + * + * @param {string} accountIssueName + * A fully-qualified path representing AccountIssue resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountIssueName(accountIssueName: string) { + return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName) + .account; + } + + /** + * Parse the issue from AccountIssue resource. + * + * @param {string} accountIssueName + * A fully-qualified path representing AccountIssue resource. + * @returns {string} A string representing the issue. + */ + matchIssueFromAccountIssueName(accountIssueName: string) { + return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName) + .issue; + } + + /** + * Return a fully-qualified accountTax resource name string. + * + * @param {string} account + * @param {string} tax + * @returns {string} Resource name string. + */ + accountTaxPath(account: string, tax: string) { + return this.pathTemplates.accountTaxPathTemplate.render({ + account: account, + tax: tax, + }); + } + + /** + * Parse the account from AccountTax resource. + * + * @param {string} accountTaxName + * A fully-qualified path representing AccountTax resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAccountTaxName(accountTaxName: string) { + return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName) + .account; + } + + /** + * Parse the tax from AccountTax resource. + * + * @param {string} accountTaxName + * A fully-qualified path representing AccountTax resource. + * @returns {string} A string representing the tax. + */ + matchTaxFromAccountTaxName(accountTaxName: string) { + return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; + } + + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + + /** + * Return a fully-qualified businessIdentity resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + businessIdentityPath(account: string) { + return this.pathTemplates.businessIdentityPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from BusinessIdentity resource. + * + * @param {string} businessIdentityName + * A fully-qualified path representing BusinessIdentity resource. + * @returns {string} A string representing the account. + */ + matchAccountFromBusinessIdentityName(businessIdentityName: string) { + return this.pathTemplates.businessIdentityPathTemplate.match( + businessIdentityName + ).account; + } + + /** + * Return a fully-qualified businessInfo resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + businessInfoPath(account: string) { + return this.pathTemplates.businessInfoPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from BusinessInfo resource. + * + * @param {string} businessInfoName + * A fully-qualified path representing BusinessInfo resource. + * @returns {string} A string representing the account. + */ + matchAccountFromBusinessInfoName(businessInfoName: string) { + return this.pathTemplates.businessInfoPathTemplate.match(businessInfoName) + .account; + } + + /** + * Return a fully-qualified emailPreferences resource name string. + * + * @param {string} account + * @param {string} email + * @returns {string} Resource name string. + */ + emailPreferencesPath(account: string, email: string) { + return this.pathTemplates.emailPreferencesPathTemplate.render({ + account: account, + email: email, + }); + } + + /** + * Parse the account from EmailPreferences resource. + * + * @param {string} emailPreferencesName + * A fully-qualified path representing EmailPreferences resource. + * @returns {string} A string representing the account. + */ + matchAccountFromEmailPreferencesName(emailPreferencesName: string) { + return this.pathTemplates.emailPreferencesPathTemplate.match( + emailPreferencesName + ).account; + } + + /** + * Parse the email from EmailPreferences resource. + * + * @param {string} emailPreferencesName + * A fully-qualified path representing EmailPreferences resource. + * @returns {string} A string representing the email. + */ + matchEmailFromEmailPreferencesName(emailPreferencesName: string) { + return this.pathTemplates.emailPreferencesPathTemplate.match( + emailPreferencesName + ).email; + } + + /** + * Return a fully-qualified homepage resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + homepagePath(account: string) { + return this.pathTemplates.homepagePathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from Homepage resource. + * + * @param {string} homepageName + * A fully-qualified path representing Homepage resource. + * @returns {string} A string representing the account. + */ + matchAccountFromHomepageName(homepageName: string) { + return this.pathTemplates.homepagePathTemplate.match(homepageName).account; + } + + /** + * Return a fully-qualified onlineReturnPolicy resource name string. + * + * @param {string} account + * @param {string} return_policy + * @returns {string} Resource name string. + */ + onlineReturnPolicyPath(account: string, returnPolicy: string) { + return this.pathTemplates.onlineReturnPolicyPathTemplate.render({ + account: account, + return_policy: returnPolicy, + }); + } + + /** + * Parse the account from OnlineReturnPolicy resource. + * + * @param {string} onlineReturnPolicyName + * A fully-qualified path representing OnlineReturnPolicy resource. + * @returns {string} A string representing the account. + */ + matchAccountFromOnlineReturnPolicyName(onlineReturnPolicyName: string) { + return this.pathTemplates.onlineReturnPolicyPathTemplate.match( + onlineReturnPolicyName + ).account; + } + + /** + * Parse the return_policy from OnlineReturnPolicy resource. + * + * @param {string} onlineReturnPolicyName + * A fully-qualified path representing OnlineReturnPolicy resource. + * @returns {string} A string representing the return_policy. + */ + matchReturnPolicyFromOnlineReturnPolicyName(onlineReturnPolicyName: string) { + return this.pathTemplates.onlineReturnPolicyPathTemplate.match( + onlineReturnPolicyName + ).return_policy; + } + + /** + * Return a fully-qualified program resource name string. + * + * @param {string} account + * @param {string} program + * @returns {string} Resource name string. + */ + programPath(account: string, program: string) { + return this.pathTemplates.programPathTemplate.render({ + account: account, + program: program, + }); + } + + /** + * Parse the account from Program resource. + * + * @param {string} programName + * A fully-qualified path representing Program resource. + * @returns {string} A string representing the account. + */ + matchAccountFromProgramName(programName: string) { + return this.pathTemplates.programPathTemplate.match(programName).account; + } + + /** + * Parse the program from Program resource. + * + * @param {string} programName + * A fully-qualified path representing Program resource. + * @returns {string} A string representing the program. + */ + matchProgramFromProgramName(programName: string) { + return this.pathTemplates.programPathTemplate.match(programName).program; + } + + /** + * Return a fully-qualified region resource name string. + * + * @param {string} account + * @param {string} region + * @returns {string} Resource name string. + */ + regionPath(account: string, region: string) { + return this.pathTemplates.regionPathTemplate.render({ + account: account, + region: region, + }); + } + + /** + * Parse the account from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the account. + */ + matchAccountFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).account; + } + + /** + * Parse the region from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the region. + */ + matchRegionFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).region; + } + + /** + * Return a fully-qualified shippingSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + shippingSettingsPath(account: string) { + return this.pathTemplates.shippingSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from ShippingSettings resource. + * + * @param {string} shippingSettingsName + * A fully-qualified path representing ShippingSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromShippingSettingsName(shippingSettingsName: string) { + return this.pathTemplates.shippingSettingsPathTemplate.match( + shippingSettingsName + ).account; + } + + /** + * Return a fully-qualified termsOfService resource name string. + * + * @param {string} version + * @returns {string} Resource name string. + */ + termsOfServicePath(version: string) { + return this.pathTemplates.termsOfServicePathTemplate.render({ + version: version, + }); + } + + /** + * Parse the version from TermsOfService resource. + * + * @param {string} termsOfServiceName + * A fully-qualified path representing TermsOfService resource. + * @returns {string} A string representing the version. + */ + matchVersionFromTermsOfServiceName(termsOfServiceName: string) { + return this.pathTemplates.termsOfServicePathTemplate.match( + termsOfServiceName + ).version; + } + + /** + * Return a fully-qualified termsOfServiceAgreementState resource name string. + * + * @param {string} account + * @param {string} identifier + * @returns {string} Resource name string. + */ + termsOfServiceAgreementStatePath(account: string, identifier: string) { + return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.render({ + account: account, + identifier: identifier, + }); + } + + /** + * Parse the account from TermsOfServiceAgreementState resource. + * + * @param {string} termsOfServiceAgreementStateName + * A fully-qualified path representing TermsOfServiceAgreementState resource. + * @returns {string} A string representing the account. + */ + matchAccountFromTermsOfServiceAgreementStateName( + termsOfServiceAgreementStateName: string + ) { + return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match( + termsOfServiceAgreementStateName + ).account; + } + + /** + * Parse the identifier from TermsOfServiceAgreementState resource. + * + * @param {string} termsOfServiceAgreementStateName + * A fully-qualified path representing TermsOfServiceAgreementState resource. + * @returns {string} A string representing the identifier. + */ + matchIdentifierFromTermsOfServiceAgreementStateName( + termsOfServiceAgreementStateName: string + ) { + return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match( + termsOfServiceAgreementStateName + ).identifier; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} account + * @param {string} email + * @returns {string} Resource name string. + */ + userPath(account: string, email: string) { + return this.pathTemplates.userPathTemplate.render({ + account: account, + email: email, + }); + } + + /** + * Parse the account from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the account. + */ + matchAccountFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).account; + } + + /** + * Parse the email from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the email. + */ + matchEmailFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).email; + } + + /** + * 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.autofeedSettingsServiceStub && !this._terminated) { + return this.autofeedSettingsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client_config.json new file mode 100644 index 00000000000..76605ca23ce --- /dev/null +++ b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetAutofeedSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAutofeedSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_proto_list.json @@ -0,0 +1,24 @@ +[ + "../../protos/google/shopping/merchant/accounts/v1beta/accessright.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/homepage.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/programs.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/regions.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/user.proto", + "../../protos/google/shopping/type/types.proto" +] diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client.ts index 0b6c9dca8b0..8adc23160fe 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client.ts @@ -208,6 +208,9 @@ export class BusinessIdentityServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -714,6 +717,31 @@ export class BusinessIdentityServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client_config.json index b091387b2ef..3f53a2e5cc4 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,16 +20,27 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetBusinessIdentity": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateBusinessIdentity": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_identity_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client.ts index fdbfe44e92a..9e852717c1e 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client.ts @@ -206,6 +206,9 @@ export class BusinessInfoServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -708,6 +711,31 @@ export class BusinessInfoServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client_config.json index 4db7c7c0c8a..df02eede533 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,16 +20,27 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetBusinessInfo": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateBusinessInfo": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/business_info_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client.ts index fd25cb2bff9..7bba28fbb08 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client.ts @@ -210,6 +210,9 @@ export class EmailPreferencesServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -728,6 +731,31 @@ export class EmailPreferencesServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client_config.json index 9b63a7b00f1..e16984f64b8 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,16 +20,27 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetEmailPreferences": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateEmailPreferences": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/email_preferences_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/gapic_metadata.json b/packages/google-shopping-merchant-accounts/src/v1beta/gapic_metadata.json index 77926af95f8..effe3375d06 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/gapic_metadata.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/gapic_metadata.json @@ -163,6 +163,40 @@ } } }, + "AutofeedSettingsService": { + "clients": { + "grpc": { + "libraryClient": "AutofeedSettingsServiceClient", + "rpcs": { + "GetAutofeedSettings": { + "methods": [ + "getAutofeedSettings" + ] + }, + "UpdateAutofeedSettings": { + "methods": [ + "updateAutofeedSettings" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutofeedSettingsServiceClient", + "rpcs": { + "GetAutofeedSettings": { + "methods": [ + "getAutofeedSettings" + ] + }, + "UpdateAutofeedSettings": { + "methods": [ + "updateAutofeedSettings" + ] + } + } + } + } + }, "BusinessIdentityService": { "clients": { "grpc": { diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client.ts index 2a7ccde579f..ff8476cdbb2 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client.ts @@ -206,6 +206,9 @@ export class HomepageServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -916,6 +919,31 @@ export class HomepageServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client_config.json index 6c5c7a43c5e..acf219e28d2 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,24 +20,37 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetHomepage": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateHomepage": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ClaimHomepage": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UnclaimHomepage": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/homepage_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/index.ts b/packages/google-shopping-merchant-accounts/src/v1beta/index.ts index 8a0267c920b..af8a76c6320 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/index.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/index.ts @@ -19,6 +19,7 @@ export {AccountIssueServiceClient} from './account_issue_service_client'; export {AccountsServiceClient} from './accounts_service_client'; export {AccountTaxServiceClient} from './account_tax_service_client'; +export {AutofeedSettingsServiceClient} from './autofeed_settings_service_client'; export {BusinessIdentityServiceClient} from './business_identity_service_client'; export {BusinessInfoServiceClient} from './business_info_service_client'; export {EmailPreferencesServiceClient} from './email_preferences_service_client'; diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_client.ts index eb421294113..67f7ce74ac6 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_client.ts @@ -213,6 +213,9 @@ export class OnlineReturnPolicyServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -853,6 +856,31 @@ export class OnlineReturnPolicyServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/online_return_policy_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client.ts index 667a0a85e30..e6207f7db48 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client.ts @@ -218,6 +218,9 @@ export class ProgramsServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -1028,6 +1031,31 @@ export class ProgramsServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client_config.json index 6b8af94a560..aa73367335c 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,24 +20,37 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetProgram": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ListPrograms": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "EnableProgram": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "DisableProgram": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/programs_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client.ts index 27b4fc111d4..8725add5dd3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client.ts @@ -212,6 +212,9 @@ export class RegionsServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -1141,6 +1144,31 @@ export class RegionsServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client_config.json index 38d164fb36c..05c1621e970 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,28 +20,42 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetRegion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "CreateRegion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateRegion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "DeleteRegion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ListRegions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/regions_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_client.ts index e3895eee2ee..965dcf75476 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_client.ts @@ -208,6 +208,9 @@ export class ShippingSettingsServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -715,6 +718,31 @@ export class ShippingSettingsServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/shipping_settings_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client.ts index 632c005ec2d..c133364a0cd 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client.ts @@ -207,6 +207,9 @@ export class TermsOfServiceAgreementStateServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -418,6 +421,7 @@ export class TermsOfServiceAgreementStateServiceClient { * @param {string} request.name * Required. The resource name of the terms of service version. * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * The identifier format is: `{TermsOfServiceKind}-{country}` * @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. @@ -715,6 +719,31 @@ export class TermsOfServiceAgreementStateServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client_config.json index a895364cbdf..312be76fc62 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,16 +20,27 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetTermsOfServiceAgreementState": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "RetrieveForApplicationTermsOfServiceAgreementState": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_agreement_state_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_client.ts index cbbf1217dce..2e501da3eb6 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_client.ts @@ -207,6 +207,9 @@ export class TermsOfServiceServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -515,11 +518,11 @@ export class TermsOfServiceServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.regionCode - * Region code as defined by [CLDR](https://cldr.unicode.org/). This is either - * a country when the ToS applies specifically to that country or 001 when it - * applies globally. + * Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This + * is either a country when the ToS applies specifically to that country or + * 001 when it applies globally. * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} request.kind - * The Kind this terms of service version applies to. + * Required. The Kind this terms of service version applies to. * @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. @@ -815,6 +818,31 @@ export class TermsOfServiceServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/terms_of_service_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client.ts index 3154d4e67c6..7dd42e87127 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client.ts @@ -208,6 +208,9 @@ export class UserServiceClient { accountTaxPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/accounttax/{tax}' ), + autofeedSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/autofeedSettings' + ), businessIdentityPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/businessIdentity' ), @@ -1142,6 +1145,31 @@ export class UserServiceClient { return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).tax; } + /** + * Return a fully-qualified autofeedSettings resource name string. + * + * @param {string} account + * @returns {string} Resource name string. + */ + autofeedSettingsPath(account: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.render({ + account: account, + }); + } + + /** + * Parse the account from AutofeedSettings resource. + * + * @param {string} autofeedSettingsName + * A fully-qualified path representing AutofeedSettings resource. + * @returns {string} A string representing the account. + */ + matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; + } + /** * Return a fully-qualified businessIdentity resource name string. * diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client_config.json index fab8c8e3b49..fcd414e87d4 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client_config.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,28 +20,42 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "GetUser": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "CreateUser": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "DeleteUser": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "UpdateUser": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "ListUsers": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_proto_list.json index 506dbed2e3f..28ca4b888d3 100644 --- a/packages/google-shopping-merchant-accounts/src/v1beta/user_service_proto_list.json +++ b/packages/google-shopping-merchant-accounts/src/v1beta/user_service_proto_list.json @@ -3,6 +3,8 @@ "../../protos/google/shopping/merchant/accounts/v1beta/account_tax.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accountissue.proto", "../../protos/google/shopping/merchant/accounts/v1beta/accounts.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/accountservices.proto", + "../../protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto", "../../protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto", "../../protos/google/shopping/merchant/accounts/v1beta/customerservice.proto", diff --git a/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.js b/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.js index 5661204e4a3..885b0a66a43 100644 --- a/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.js +++ b/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.js @@ -23,6 +23,8 @@ function main() { const accountIssueServiceClient = new accounts.AccountIssueServiceClient(); const accountsServiceClient = new accounts.AccountsServiceClient(); const accountTaxServiceClient = new accounts.AccountTaxServiceClient(); + const autofeedSettingsServiceClient = + new accounts.AutofeedSettingsServiceClient(); const businessIdentityServiceClient = new accounts.BusinessIdentityServiceClient(); const businessInfoServiceClient = new accounts.BusinessInfoServiceClient(); diff --git a/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.ts b/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.ts index 1c4d6efcd03..ec02788d9a7 100644 --- a/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.ts +++ b/packages/google-shopping-merchant-accounts/system-test/fixtures/sample/src/index.ts @@ -20,6 +20,7 @@ import { AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, + AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, @@ -45,6 +46,11 @@ function doStuffWithAccountsServiceClient(client: AccountsServiceClient) { function doStuffWithAccountTaxServiceClient(client: AccountTaxServiceClient) { client.close(); } +function doStuffWithAutofeedSettingsServiceClient( + client: AutofeedSettingsServiceClient +) { + client.close(); +} function doStuffWithBusinessIdentityServiceClient( client: BusinessIdentityServiceClient ) { @@ -104,6 +110,9 @@ function main() { const accountTaxServiceClient = new AccountTaxServiceClient(); doStuffWithAccountTaxServiceClient(accountTaxServiceClient); // check that the client instance can be created + const autofeedSettingsServiceClient = new AutofeedSettingsServiceClient(); + doStuffWithAutofeedSettingsServiceClient(autofeedSettingsServiceClient); + // check that the client instance can be created const businessIdentityServiceClient = new BusinessIdentityServiceClient(); doStuffWithBusinessIdentityServiceClient(businessIdentityServiceClient); // check that the client instance can be created diff --git a/packages/google-shopping-merchant-accounts/test/gapic_account_issue_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_account_issue_service_v1beta.ts index 1accfcf1ac9..5468366d860 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_account_issue_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_account_issue_service_v1beta.ts @@ -803,6 +803,48 @@ describe('v1beta.AccountIssueServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_account_tax_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_account_tax_service_v1beta.ts index a8ceead150d..892bf5b3904 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_account_tax_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_account_tax_service_v1beta.ts @@ -1094,6 +1094,49 @@ describe('v1beta.AccountTaxServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_accounts_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_accounts_service_v1beta.ts index 7af69aa9ab5..20ed961da2d 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_accounts_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_accounts_service_v1beta.ts @@ -1505,6 +1505,47 @@ describe('v1beta.AccountsServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_autofeed_settings_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_autofeed_settings_service_v1beta.ts new file mode 100644 index 00000000000..970d572f1be --- /dev/null +++ b/packages/google-shopping-merchant-accounts/test/gapic_autofeed_settings_service_v1beta.ts @@ -0,0 +1,1255 @@ +// Copyright 2024 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 autofeedsettingsserviceModule 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('v1beta.AutofeedSettingsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient(); + 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 = + autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient + .servicePath; + assert.strictEqual(servicePath, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.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 autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.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 autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.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 autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autofeedSettingsServiceStub, undefined); + await client.initialize(); + assert(client.autofeedSettingsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autofeedSettingsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autofeedSettingsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + 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 autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + 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('getAutofeedSettings', () => { + it('invokes getAutofeedSettings without error', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AutofeedSettings() + ); + client.innerApiCalls.getAutofeedSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getAutofeedSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutofeedSettings without error using callback', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AutofeedSettings() + ); + client.innerApiCalls.getAutofeedSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAutofeedSettings( + request, + ( + err?: Error | null, + result?: protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutofeedSettings with error', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAutofeedSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAutofeedSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutofeedSettings with closed client', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.GetAutofeedSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAutofeedSettings(request), expectedError); + }); + }); + + describe('updateAutofeedSettings', () => { + it('invokes updateAutofeedSettings without error', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest() + ); + request.autofeedSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest', + ['autofeedSettings', 'name'] + ); + request.autofeedSettings.name = defaultValue1; + const expectedHeaderRequestParams = `autofeed_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AutofeedSettings() + ); + client.innerApiCalls.updateAutofeedSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateAutofeedSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutofeedSettings without error using callback', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest() + ); + request.autofeedSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest', + ['autofeedSettings', 'name'] + ); + request.autofeedSettings.name = defaultValue1; + const expectedHeaderRequestParams = `autofeed_settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AutofeedSettings() + ); + client.innerApiCalls.updateAutofeedSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAutofeedSettings( + request, + ( + err?: Error | null, + result?: protos.google.shopping.merchant.accounts.v1beta.IAutofeedSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutofeedSettings with error', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest() + ); + request.autofeedSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest', + ['autofeedSettings', 'name'] + ); + request.autofeedSettings.name = defaultValue1; + const expectedHeaderRequestParams = `autofeed_settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutofeedSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateAutofeedSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAutofeedSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutofeedSettings with closed client', async () => { + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest() + ); + request.autofeedSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.shopping.merchant.accounts.v1beta.UpdateAutofeedSettingsRequest', + ['autofeedSettings', 'name'] + ); + request.autofeedSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateAutofeedSettings(request), + expectedError + ); + }); + }); + + describe('Path templates', () => { + describe('account', () => { + const fakePath = '/rendered/path/account'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accountPath', () => { + const result = client.accountPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAccountName', () => { + const result = client.matchAccountFromAccountName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.accountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('accountIssue', () => { + const fakePath = '/rendered/path/accountIssue'; + const expectedParameters = { + account: 'accountValue', + issue: 'issueValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountIssuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accountIssuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accountIssuePath', () => { + const result = client.accountIssuePath('accountValue', 'issueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accountIssuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAccountIssueName', () => { + const result = client.matchAccountFromAccountIssueName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.accountIssuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIssueFromAccountIssueName', () => { + const result = client.matchIssueFromAccountIssueName(fakePath); + assert.strictEqual(result, 'issueValue'); + assert( + (client.pathTemplates.accountIssuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('accountTax', () => { + const fakePath = '/rendered/path/accountTax'; + const expectedParameters = { + account: 'accountValue', + tax: 'taxValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accountTaxPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accountTaxPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accountTaxPath', () => { + const result = client.accountTaxPath('accountValue', 'taxValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accountTaxPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAccountTaxName', () => { + const result = client.matchAccountFromAccountTaxName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.accountTaxPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxFromAccountTaxName', () => { + const result = client.matchTaxFromAccountTaxName(fakePath); + assert.strictEqual(result, 'taxValue'); + assert( + (client.pathTemplates.accountTaxPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('businessIdentity', () => { + const fakePath = '/rendered/path/businessIdentity'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.businessIdentityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.businessIdentityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('businessIdentityPath', () => { + const result = client.businessIdentityPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.businessIdentityPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromBusinessIdentityName', () => { + const result = client.matchAccountFromBusinessIdentityName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.businessIdentityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('businessInfo', () => { + const fakePath = '/rendered/path/businessInfo'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.businessInfoPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.businessInfoPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('businessInfoPath', () => { + const result = client.businessInfoPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.businessInfoPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromBusinessInfoName', () => { + const result = client.matchAccountFromBusinessInfoName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.businessInfoPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('emailPreferences', () => { + const fakePath = '/rendered/path/emailPreferences'; + const expectedParameters = { + account: 'accountValue', + email: 'emailValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.emailPreferencesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.emailPreferencesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('emailPreferencesPath', () => { + const result = client.emailPreferencesPath( + 'accountValue', + 'emailValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.emailPreferencesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromEmailPreferencesName', () => { + const result = client.matchAccountFromEmailPreferencesName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.emailPreferencesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEmailFromEmailPreferencesName', () => { + const result = client.matchEmailFromEmailPreferencesName(fakePath); + assert.strictEqual(result, 'emailValue'); + assert( + (client.pathTemplates.emailPreferencesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('homepage', () => { + const fakePath = '/rendered/path/homepage'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.homepagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.homepagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('homepagePath', () => { + const result = client.homepagePath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.homepagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromHomepageName', () => { + const result = client.matchAccountFromHomepageName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.homepagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('onlineReturnPolicy', () => { + const fakePath = '/rendered/path/onlineReturnPolicy'; + const expectedParameters = { + account: 'accountValue', + return_policy: 'returnPolicyValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.onlineReturnPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.onlineReturnPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('onlineReturnPolicyPath', () => { + const result = client.onlineReturnPolicyPath( + 'accountValue', + 'returnPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.onlineReturnPolicyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromOnlineReturnPolicyName', () => { + const result = client.matchAccountFromOnlineReturnPolicyName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.onlineReturnPolicyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReturnPolicyFromOnlineReturnPolicyName', () => { + const result = + client.matchReturnPolicyFromOnlineReturnPolicyName(fakePath); + assert.strictEqual(result, 'returnPolicyValue'); + assert( + ( + client.pathTemplates.onlineReturnPolicyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('program', () => { + const fakePath = '/rendered/path/program'; + const expectedParameters = { + account: 'accountValue', + program: 'programValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.programPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.programPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('programPath', () => { + const result = client.programPath('accountValue', 'programValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.programPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromProgramName', () => { + const result = client.matchAccountFromProgramName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.programPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProgramFromProgramName', () => { + const result = client.matchProgramFromProgramName(fakePath); + assert.strictEqual(result, 'programValue'); + assert( + (client.pathTemplates.programPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('region', () => { + const fakePath = '/rendered/path/region'; + const expectedParameters = { + account: 'accountValue', + region: 'regionValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.regionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.regionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('regionPath', () => { + const result = client.regionPath('accountValue', 'regionValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.regionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromRegionName', () => { + const result = client.matchAccountFromRegionName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRegionFromRegionName', () => { + const result = client.matchRegionFromRegionName(fakePath); + assert.strictEqual(result, 'regionValue'); + assert( + (client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('shippingSettings', () => { + const fakePath = '/rendered/path/shippingSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.shippingSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.shippingSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('shippingSettingsPath', () => { + const result = client.shippingSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.shippingSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromShippingSettingsName', () => { + const result = client.matchAccountFromShippingSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.shippingSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('termsOfService', () => { + const fakePath = '/rendered/path/termsOfService'; + const expectedParameters = { + version: 'versionValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.termsOfServicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.termsOfServicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('termsOfServicePath', () => { + const result = client.termsOfServicePath('versionValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.termsOfServicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchVersionFromTermsOfServiceName', () => { + const result = client.matchVersionFromTermsOfServiceName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.termsOfServicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('termsOfServiceAgreementState', () => { + const fakePath = '/rendered/path/termsOfServiceAgreementState'; + const expectedParameters = { + account: 'accountValue', + identifier: 'identifierValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.termsOfServiceAgreementStatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.termsOfServiceAgreementStatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('termsOfServiceAgreementStatePath', () => { + const result = client.termsOfServiceAgreementStatePath( + 'accountValue', + 'identifierValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.termsOfServiceAgreementStatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromTermsOfServiceAgreementStateName', () => { + const result = + client.matchAccountFromTermsOfServiceAgreementStateName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.termsOfServiceAgreementStatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIdentifierFromTermsOfServiceAgreementStateName', () => { + const result = + client.matchIdentifierFromTermsOfServiceAgreementStateName(fakePath); + assert.strictEqual(result, 'identifierValue'); + assert( + ( + client.pathTemplates.termsOfServiceAgreementStatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + account: 'accountValue', + email: 'emailValue', + }; + const client = + new autofeedsettingsserviceModule.v1beta.AutofeedSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('accountValue', 'emailValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromUserName', () => { + const result = client.matchAccountFromUserName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEmailFromUserName', () => { + const result = client.matchEmailFromUserName(fakePath); + assert.strictEqual(result, 'emailValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-shopping-merchant-accounts/test/gapic_business_identity_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_business_identity_service_v1beta.ts index 6ff60c5ed34..5b8ddc54e62 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_business_identity_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_business_identity_service_v1beta.ts @@ -678,6 +678,48 @@ describe('v1beta.BusinessIdentityServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_business_info_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_business_info_service_v1beta.ts index 9f525c469a4..36979a4d507 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_business_info_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_business_info_service_v1beta.ts @@ -671,6 +671,48 @@ describe('v1beta.BusinessInfoServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_email_preferences_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_email_preferences_service_v1beta.ts index f8ee27be9ca..57cd3c03d2b 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_email_preferences_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_email_preferences_service_v1beta.ts @@ -678,6 +678,48 @@ describe('v1beta.EmailPreferencesServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_homepage_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_homepage_service_v1beta.ts index bf0b6672e67..4c726b3b101 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_homepage_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_homepage_service_v1beta.ts @@ -904,6 +904,47 @@ describe('v1beta.HomepageServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_online_return_policy_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_online_return_policy_service_v1beta.ts index 7072745b6cd..0c379682ef2 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_online_return_policy_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_online_return_policy_service_v1beta.ts @@ -1008,6 +1008,50 @@ describe('v1beta.OnlineReturnPolicyServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_programs_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_programs_service_v1beta.ts index c9064553e6f..6dd64b31639 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_programs_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_programs_service_v1beta.ts @@ -1170,6 +1170,47 @@ describe('v1beta.ProgramsServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_regions_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_regions_service_v1beta.ts index f6b47518677..323b7a3e7cb 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_regions_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_regions_service_v1beta.ts @@ -1302,6 +1302,47 @@ describe('v1beta.RegionsServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_shipping_settings_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_shipping_settings_service_v1beta.ts index 5c162f59e96..f14b7b5eba9 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_shipping_settings_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_shipping_settings_service_v1beta.ts @@ -674,6 +674,48 @@ describe('v1beta.ShippingSettingsServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_agreement_state_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_agreement_state_service_v1beta.ts index 619db0c31f0..26d0fa76fdd 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_agreement_state_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_agreement_state_service_v1beta.ts @@ -727,6 +727,50 @@ describe('v1beta.TermsOfServiceAgreementStateServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_service_v1beta.ts index d4a2aaa1481..93fa38536c0 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_terms_of_service_service_v1beta.ts @@ -761,6 +761,48 @@ describe('v1beta.TermsOfServiceServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = + new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = { diff --git a/packages/google-shopping-merchant-accounts/test/gapic_user_service_v1beta.ts b/packages/google-shopping-merchant-accounts/test/gapic_user_service_v1beta.ts index 46d78cdf2ec..a950be377c8 100644 --- a/packages/google-shopping-merchant-accounts/test/gapic_user_service_v1beta.ts +++ b/packages/google-shopping-merchant-accounts/test/gapic_user_service_v1beta.ts @@ -1293,6 +1293,47 @@ describe('v1beta.UserServiceClient', () => { }); }); + describe('autofeedSettings', () => { + const fakePath = '/rendered/path/autofeedSettings'; + const expectedParameters = { + account: 'accountValue', + }; + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.autofeedSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.autofeedSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('autofeedSettingsPath', () => { + const result = client.autofeedSettingsPath('accountValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.autofeedSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromAutofeedSettingsName', () => { + const result = client.matchAccountFromAutofeedSettingsName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.autofeedSettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('businessIdentity', () => { const fakePath = '/rendered/path/businessIdentity'; const expectedParameters = {